[llvm-commits] CVS: llvm/lib/Transforms/Utils/CloneModule.cpp ValueMapper.cpp ValueMapper.h CloneFunction.cpp
Chris Lattner
lattner at cs.uiuc.edu
Wed Nov 20 14:48:01 PST 2002
Changes in directory llvm/lib/Transforms/Utils:
CloneModule.cpp added (r1.1)
ValueMapper.cpp added (r1.1)
ValueMapper.h added (r1.1)
CloneFunction.cpp updated: 1.13 -> 1.14
---
Log message:
Initial checkin of Module cloning support stuff
---
Diffs of the changes:
Index: llvm/lib/Transforms/Utils/CloneFunction.cpp
diff -u llvm/lib/Transforms/Utils/CloneFunction.cpp:1.13 llvm/lib/Transforms/Utils/CloneFunction.cpp:1.14
--- llvm/lib/Transforms/Utils/CloneFunction.cpp:1.13 Wed Nov 20 12:32:31 2002
+++ llvm/lib/Transforms/Utils/CloneFunction.cpp Wed Nov 20 14:47:41 2002
@@ -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 @@
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;
More information about the llvm-commits
mailing list