Fixed various whitespace/spelling/80+ issues.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196310 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Michael Gottesman 2013-12-03 20:21:17 +00:00
parent ca3da883b8
commit 3916f6c45a

View File

@ -1,4 +1,4 @@
//====----- MachineBlockFrequencyInfo.cpp - Machine Block Frequency Analysis ----====// //====------ MachineBlockFrequencyInfo.cpp - MBB Frequency Analysis ------====//
// //
// The LLVM Compiler Infrastructure // The LLVM Compiler Infrastructure
// //
@ -33,7 +33,7 @@ static cl::opt<GVDAGType>
ViewMachineBlockFreqPropagationDAG("view-machine-block-freq-propagation-dags", ViewMachineBlockFreqPropagationDAG("view-machine-block-freq-propagation-dags",
cl::Hidden, cl::Hidden,
cl::desc("Pop up a window to show a dag displaying how machine block " cl::desc("Pop up a window to show a dag displaying how machine block "
"frequencies propgate through the CFG."), "frequencies propagate through the CFG."),
cl::values( cl::values(
clEnumValN(GVDT_None, "none", clEnumValN(GVDT_None, "none",
"do not display graphs."), "do not display graphs."),
@ -51,25 +51,31 @@ struct GraphTraits<MachineBlockFrequencyInfo *> {
typedef MachineBasicBlock::const_succ_iterator ChildIteratorType; typedef MachineBasicBlock::const_succ_iterator ChildIteratorType;
typedef MachineFunction::const_iterator nodes_iterator; typedef MachineFunction::const_iterator nodes_iterator;
static inline const NodeType *getEntryNode(const MachineBlockFrequencyInfo *G) { static inline
const NodeType *getEntryNode(const MachineBlockFrequencyInfo *G) {
return G->getFunction()->begin(); return G->getFunction()->begin();
} }
static ChildIteratorType child_begin(const NodeType *N) { static ChildIteratorType child_begin(const NodeType *N) {
return N->succ_begin(); return N->succ_begin();
} }
static ChildIteratorType child_end(const NodeType *N) { static ChildIteratorType child_end(const NodeType *N) {
return N->succ_end(); return N->succ_end();
} }
static nodes_iterator nodes_begin(const MachineBlockFrequencyInfo *G) { static nodes_iterator nodes_begin(const MachineBlockFrequencyInfo *G) {
return G->getFunction()->begin(); return G->getFunction()->begin();
} }
static nodes_iterator nodes_end(const MachineBlockFrequencyInfo *G) { static nodes_iterator nodes_end(const MachineBlockFrequencyInfo *G) {
return G->getFunction()->end(); return G->getFunction()->end();
} }
}; };
template<> template<>
struct DOTGraphTraits<MachineBlockFrequencyInfo*> : public DefaultDOTGraphTraits { struct DOTGraphTraits<MachineBlockFrequencyInfo*> :
public DefaultDOTGraphTraits {
explicit DOTGraphTraits(bool isSimple=false) : explicit DOTGraphTraits(bool isSimple=false) :
DefaultDOTGraphTraits(isSimple) {} DefaultDOTGraphTraits(isSimple) {}
@ -112,7 +118,8 @@ INITIALIZE_PASS_END(MachineBlockFrequencyInfo, "machine-block-freq",
char MachineBlockFrequencyInfo::ID = 0; char MachineBlockFrequencyInfo::ID = 0;
MachineBlockFrequencyInfo::MachineBlockFrequencyInfo() : MachineFunctionPass(ID) { MachineBlockFrequencyInfo::
MachineBlockFrequencyInfo() :MachineFunctionPass(ID) {
initializeMachineBlockFrequencyInfoPass(*PassRegistry::getPassRegistry()); initializeMachineBlockFrequencyInfoPass(*PassRegistry::getPassRegistry());
MBFI = new BlockFrequencyImpl<MachineBasicBlock, MachineFunction, MBFI = new BlockFrequencyImpl<MachineBasicBlock, MachineFunction,
MachineBranchProbabilityInfo>(); MachineBranchProbabilityInfo>();
@ -129,7 +136,8 @@ void MachineBlockFrequencyInfo::getAnalysisUsage(AnalysisUsage &AU) const {
} }
bool MachineBlockFrequencyInfo::runOnMachineFunction(MachineFunction &F) { bool MachineBlockFrequencyInfo::runOnMachineFunction(MachineFunction &F) {
MachineBranchProbabilityInfo &MBPI = getAnalysis<MachineBranchProbabilityInfo>(); MachineBranchProbabilityInfo &MBPI =
getAnalysis<MachineBranchProbabilityInfo>();
MBFI->doFunction(&F, &MBPI); MBFI->doFunction(&F, &MBPI);
#ifndef NDEBUG #ifndef NDEBUG
if (ViewMachineBlockFreqPropagationDAG != GVDT_None) { if (ViewMachineBlockFreqPropagationDAG != GVDT_None) {
@ -147,8 +155,8 @@ void MachineBlockFrequencyInfo::view() const {
ViewGraph(const_cast<MachineBlockFrequencyInfo *>(this), ViewGraph(const_cast<MachineBlockFrequencyInfo *>(this),
"MachineBlockFrequencyDAGs"); "MachineBlockFrequencyDAGs");
#else #else
errs() << "BlockFrequencyInfo::view is only available in debug builds on " errs() << "MachineBlockFrequencyInfo::view is only available in debug builds "
"systems with Graphviz or gv!\n"; "on systems with Graphviz or gv!\n";
#endif // NDEBUG #endif // NDEBUG
} }
@ -160,4 +168,3 @@ getBlockFreq(const MachineBasicBlock *MBB) const {
MachineFunction *MachineBlockFrequencyInfo::getFunction() const { MachineFunction *MachineBlockFrequencyInfo::getFunction() const {
return MBFI->Fn; return MBFI->Fn;
} }