[llvm-commits] CVS: llvm/lib/Transforms/Utils/ValueMapper.cpp
LLVM
llvm at cs.uiuc.edu
Sat Jul 17 17:32:49 PDT 2004
Changes in directory llvm/lib/Transforms/Utils:
ValueMapper.cpp updated: 1.14 -> 1.15
---
Log message:
bug 122: http://llvm.cs.uiuc.edu/PR122 :
- Replace ConstantPointerRef usage with GlobalValue usage
---
Diffs of the changes: (+3 -3)
Index: llvm/lib/Transforms/Utils/ValueMapper.cpp
diff -u llvm/lib/Transforms/Utils/ValueMapper.cpp:1.14 llvm/lib/Transforms/Utils/ValueMapper.cpp:1.15
--- llvm/lib/Transforms/Utils/ValueMapper.cpp:1.14 Wed Jul 14 21:06:12 2004
+++ llvm/lib/Transforms/Utils/ValueMapper.cpp Sat Jul 17 19:32:39 2004
@@ -14,6 +14,7 @@
#include "ValueMapper.h"
#include "llvm/Constants.h"
+#include "llvm/GlobalValue.h"
#include "llvm/Instruction.h"
#include <iostream>
@@ -32,9 +33,8 @@
if (isa<ConstantIntegral>(C) || isa<ConstantFP>(C) ||
isa<ConstantPointerNull>(C) || isa<ConstantAggregateZero>(C))
return VMSlot = C; // Primitive constants map directly
- else if (ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(C)) {
- GlobalValue *MV = cast<GlobalValue>(MapValue((Value*)CPR->getValue(),VM));
- return VMSlot = ConstantPointerRef::get(MV);
+ else if (GlobalValue *GV = dyn_cast<GlobalValue>(C)) {
+ return VMSlot = GV;
} else if (ConstantArray *CA = dyn_cast<ConstantArray>(C)) {
const std::vector<Use> &Vals = CA->getValues();
for (unsigned i = 0, e = Vals.size(); i != e; ++i) {
More information about the llvm-commits
mailing list