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 | e4dbb1af4261ae30b8cf6e5035edc8db42e75209 (patch) | |
| tree | 526a0797eecd111b43e2a514c4a718be7ee1f444 /llvm/lib/Transforms/Utils/CloneFunction.cpp | |
| parent | a35d7412c6cb95998e6da665c325006a939daa00 (diff) | |
| download | bcm5719-llvm-e4dbb1af4261ae30b8cf6e5035edc8db42e75209.tar.gz bcm5719-llvm-e4dbb1af4261ae30b8cf6e5035edc8db42e75209.zip | |
Initial checkin of Module cloning support stuff
llvm-svn: 4788
Diffstat (limited to 'llvm/lib/Transforms/Utils/CloneFunction.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Utils/CloneFunction.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp index 29c7aaa0374..ca22003b409 100644 --- a/llvm/lib/Transforms/Utils/CloneFunction.cpp +++ b/llvm/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; |

