aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore
diff options
context:
space:
mode:
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/Dominators.cpp1
-rw-r--r--lib/VMCore/Instruction.cpp1
-rw-r--r--lib/VMCore/Linker.cpp18
-rw-r--r--lib/VMCore/Pass.cpp1
-rw-r--r--lib/VMCore/SlotCalculator.cpp2
5 files changed, 15 insertions, 8 deletions
diff --git a/lib/VMCore/Dominators.cpp b/lib/VMCore/Dominators.cpp
index aad6e1cb38..33e14e9fc5 100644
--- a/lib/VMCore/Dominators.cpp
+++ b/lib/VMCore/Dominators.cpp
@@ -7,6 +7,7 @@
#include "llvm/Analysis/Dominators.h"
#include "llvm/Transforms/UnifyMethodExitNodes.h"
#include "llvm/Method.h"
+#include "llvm/Support/CFG.h"
#include "Support/DepthFirstIterator.h"
#include "Support/STLExtras.h"
#include "Support/SetOperations.h"
diff --git a/lib/VMCore/Instruction.cpp b/lib/VMCore/Instruction.cpp
index 50fdd44227..e729a65a38 100644
--- a/lib/VMCore/Instruction.cpp
+++ b/lib/VMCore/Instruction.cpp
@@ -5,6 +5,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/Instruction.h"
+#include "llvm/BasicBlock.h"
#include "llvm/Method.h"
#include "llvm/SymbolTable.h"
diff --git a/lib/VMCore/Linker.cpp b/lib/VMCore/Linker.cpp
index e1622529c2..f265bb05d1 100644
--- a/lib/VMCore/Linker.cpp
+++ b/lib/VMCore/Linker.cpp
@@ -12,6 +12,7 @@
#include "llvm/Transforms/Linker.h"
#include "llvm/Module.h"
#include "llvm/Method.h"
+#include "llvm/BasicBlock.h"
#include "llvm/GlobalVariable.h"
#include "llvm/SymbolTable.h"
#include "llvm/DerivedTypes.h"
@@ -337,13 +338,16 @@ static bool LinkMethodBody(Method *Dest, const Method *Src,
// in the Source method as operands. Loop through all of the operands of the
// methods and patch them up to point to the local versions...
//
- for (Method::inst_iterator I = Dest->inst_begin(), E = Dest->inst_end();
- I != E; ++I) {
- Instruction *Inst = *I;
-
- for (Instruction::op_iterator OI = Inst->op_begin(), OE = Inst->op_end();
- OI != OE; ++OI)
- *OI = RemapOperand(*OI, LocalMap, &GlobalMap);
+ for (Method::iterator BI = Dest->begin(), BE = Dest->end();
+ BI != BE; ++BI) {
+ BasicBlock *BB = *BI;
+ for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I) {
+ Instruction *Inst = *I;
+
+ for (Instruction::op_iterator OI = Inst->op_begin(), OE = Inst->op_end();
+ OI != OE; ++OI)
+ *OI = RemapOperand(*OI, LocalMap, &GlobalMap);
+ }
}
return false;
diff --git a/lib/VMCore/Pass.cpp b/lib/VMCore/Pass.cpp
index c18ff0adcc..b6e222d98a 100644
--- a/lib/VMCore/Pass.cpp
+++ b/lib/VMCore/Pass.cpp
@@ -9,6 +9,7 @@
#include "llvm/PassManager.h"
#include "llvm/Module.h"
#include "llvm/Method.h"
+#include "llvm/BasicBlock.h"
#include "Support/STLExtras.h"
#include <algorithm>
diff --git a/lib/VMCore/SlotCalculator.cpp b/lib/VMCore/SlotCalculator.cpp
index 4738f712a1..43a4591cb8 100644
--- a/lib/VMCore/SlotCalculator.cpp
+++ b/lib/VMCore/SlotCalculator.cpp
@@ -171,7 +171,7 @@ void SlotCalculator::incorporateMethod(const Method *M) {
SC_DEBUG("Inserting Instructions:\n");
// Add all of the instructions to the type planes...
- for_each(M->inst_begin(), M->inst_end(),
+ for_each(inst_begin(M), inst_end(M),
bind_obj(this, &SlotCalculator::insertValue));
if (M->hasSymbolTable() && !IgnoreNamedNodes) {