From 221d688a5ef21a22c2368c9fff0e92d7966c95e5 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 12 Feb 2002 21:07:25 +0000 Subject: Method.h no longer includes BasicBlock.h Method::inst_* is now in llvm/Support/InstIterator.h GraphTraits specializations for BasicBlock and Methods are now in llvm/Support/CFG.h git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1746 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Linker/LinkModules.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'lib/Linker/LinkModules.cpp') diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp index e1622529c2..f265bb05d1 100644 --- a/lib/Linker/LinkModules.cpp +++ b/lib/Linker/LinkModules.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; -- cgit v1.2.3-18-g5258