summaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/ValueMapper.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-07-18 00:44:37 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-07-18 00:44:37 +0000
commit518310cb0d136906ff0a99d7a24cb460794de5bf (patch)
treed8ad6b32edf261c90ce2c190f4c74dc3d044502f /lib/Transforms/Utils/ValueMapper.cpp
parent593eb952281138e1877adbfb11b88b6e32fdd732 (diff)
downloadllvm-518310cb0d136906ff0a99d7a24cb460794de5bf.tar.gz
llvm-518310cb0d136906ff0a99d7a24cb460794de5bf.tar.bz2
llvm-518310cb0d136906ff0a99d7a24cb460794de5bf.tar.xz
bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14953 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/ValueMapper.cpp')
-rw-r--r--lib/Transforms/Utils/ValueMapper.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Transforms/Utils/ValueMapper.cpp b/lib/Transforms/Utils/ValueMapper.cpp
index 7a5fcff111..9f52556527 100644
--- a/lib/Transforms/Utils/ValueMapper.cpp
+++ b/lib/Transforms/Utils/ValueMapper.cpp
@@ -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 @@ Value *llvm::MapValue(const Value *V, std::map<const Value*, Value*> &VM) {
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) {