diff options
author | Chris Lattner <sabre@nondot.org> | 2002-11-20 20:47:41 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-11-20 20:47:41 +0000 |
commit | 51cbcbf435d1aaa1a5269d62b5d0b31b57316b4a (patch) | |
tree | 742cf387a1a4ada1158c8dfa300d833c9acf4874 /lib/Transforms/Utils/CloneFunction.cpp | |
parent | d4fd3978056928b156bc51bff7cd4eb825bffb1a (diff) |
Initial checkin of Module cloning support stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4788 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/CloneFunction.cpp')
-rw-r--r-- | lib/Transforms/Utils/CloneFunction.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Transforms/Utils/CloneFunction.cpp b/lib/Transforms/Utils/CloneFunction.cpp index 29c7aaa037..ca22003b40 100644 --- a/lib/Transforms/Utils/CloneFunction.cpp +++ b/lib/Transforms/Utils/CloneFunction.cpp @@ -10,6 +10,7 @@ #include "llvm/iTerminators.h" #include "llvm/DerivedTypes.h" #include "llvm/Function.h" +#include "ValueMapper.h" // RemapInstruction - Convert the instruction operands from referencing the // current values into those specified by ValueMap. @@ -18,10 +19,7 @@ static inline void RemapInstruction(Instruction *I, std::map<const Value *, Value*> &ValueMap) { for (unsigned op = 0, E = I->getNumOperands(); op != E; ++op) { const Value *Op = I->getOperand(op); - Value *V = ValueMap[Op]; - if (!V && (isa<GlobalValue>(Op) || isa<Constant>(Op))) - continue; // Globals and constants don't get relocated - + Value *V = MapValue(Op, ValueMap); #ifndef NDEBUG if (!V) { std::cerr << "Val = \n" << Op << "Addr = " << (void*)Op; |