diff options
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/InstrSched/SchedPriorities.cpp | 1 | ||||
-rw-r--r-- | lib/CodeGen/InstrSelection/InstrForest.cpp | 9 | ||||
-rw-r--r-- | lib/CodeGen/MachineFunction.cpp | 13 | ||||
-rw-r--r-- | lib/CodeGen/RegAlloc/LiveRangeInfo.cpp | 1 | ||||
-rw-r--r-- | lib/CodeGen/RegAlloc/PhyRegAlloc.cpp | 1 |
5 files changed, 16 insertions, 9 deletions
diff --git a/lib/CodeGen/InstrSched/SchedPriorities.cpp b/lib/CodeGen/InstrSched/SchedPriorities.cpp index 1d4983130e..ef9f9e4599 100644 --- a/lib/CodeGen/InstrSched/SchedPriorities.cpp +++ b/lib/CodeGen/InstrSched/SchedPriorities.cpp @@ -20,6 +20,7 @@ #include "SchedPriorities.h" #include "llvm/Analysis/LiveVar/MethodLiveVarInfo.h" +#include "llvm/Support/CFG.h" #include "Support/PostOrderIterator.h" #include <iostream> using std::cerr; diff --git a/lib/CodeGen/InstrSelection/InstrForest.cpp b/lib/CodeGen/InstrSelection/InstrForest.cpp index 29090e06cc..b11d71e1f6 100644 --- a/lib/CodeGen/InstrSelection/InstrForest.cpp +++ b/lib/CodeGen/InstrSelection/InstrForest.cpp @@ -189,15 +189,18 @@ LabelNode::dumpNode(int indent) const InstrForest::InstrForest(Method *M) { - for (Method::inst_iterator I = M->inst_begin(); I != M->inst_end(); ++I) - this->buildTreeForInstruction(*I); + for (Method::iterator MI = M->begin(), ME = M->end(); MI != ME; ++MI) { + BasicBlock *BB = *MI; + for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I) + buildTreeForInstruction(*I); + } } InstrForest::~InstrForest() { for (std::hash_map<const Instruction*,InstructionNode*>::iterator I = begin(); I != end(); ++I) - delete (*I).second; + delete I->second; } void diff --git a/lib/CodeGen/MachineFunction.cpp b/lib/CodeGen/MachineFunction.cpp index 3ff3e8ceea..4bb17f15fe 100644 --- a/lib/CodeGen/MachineFunction.cpp +++ b/lib/CodeGen/MachineFunction.cpp @@ -12,6 +12,7 @@ #include "llvm/Target/MachineFrameInfo.h" #include "llvm/Target/MachineCacheInfo.h" #include "llvm/Method.h" +#include "llvm/BasicBlock.h" #include "llvm/iOther.h" #include <limits.h> @@ -56,11 +57,11 @@ ComputeMaxOptionalArgsSize(const TargetMachine& target, const Method* method) unsigned int maxSize = 0; - for (Method::const_inst_iterator I=method->inst_begin(),E=method->inst_end(); - I != E; ++I) - if ((*I)->getOpcode() == Instruction::Call) - { - CallInst* callInst = cast<CallInst>(*I); + for (Method::const_iterator MI=method->begin(), ME=method->end(); + MI != ME; ++MI) { + const BasicBlock *BB = *MI; + for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I != E; ++I) + if (CallInst *callInst = dyn_cast<CallInst>(*I)) { unsigned int numOperands = callInst->getNumOperands() - 1; int numExtra = (int) numOperands - frameInfo.getNumFixedOutgoingArgs(); if (numExtra <= 0) @@ -84,7 +85,7 @@ ComputeMaxOptionalArgsSize(const TargetMachine& target, const Method* method) if (maxSize < sizeForThisCall) maxSize = sizeForThisCall; } - + } return maxSize; } diff --git a/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp b/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp index 7302baa286..32951769e0 100644 --- a/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp +++ b/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp @@ -3,6 +3,7 @@ #include "llvm/CodeGen/MachineInstr.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Method.h" +#include "llvm/BasicBlock.h" #include "Support/SetOperations.h" #include <iostream> using std::cerr; diff --git a/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp b/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp index 18d019e8f4..c78b971e79 100644 --- a/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp +++ b/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp @@ -18,6 +18,7 @@ #include "llvm/Analysis/LoopInfo.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/MachineFrameInfo.h" +#include "llvm/BasicBlock.h" #include "llvm/Method.h" #include "llvm/Type.h" #include <iostream> |