diff options
Diffstat (limited to 'lib/Transforms/Utils')
-rw-r--r-- | lib/Transforms/Utils/LowerInvoke.cpp | 6 | ||||
-rw-r--r-- | lib/Transforms/Utils/ValueMapper.cpp | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/Transforms/Utils/LowerInvoke.cpp b/lib/Transforms/Utils/LowerInvoke.cpp index bde4ff56b0..835a5ae789 100644 --- a/lib/Transforms/Utils/LowerInvoke.cpp +++ b/lib/Transforms/Utils/LowerInvoke.cpp @@ -135,7 +135,7 @@ bool LowerInvoke::doInitialization(Module &M) { if (MsgGV) { std::vector<Constant*> GEPIdx(2, Constant::getNullValue(Type::LongTy)); AbortMessage = - ConstantExpr::getGetElementPtr(ConstantPointerRef::get(MsgGV), GEPIdx); + ConstantExpr::getGetElementPtr(MsgGV, GEPIdx); } } else { @@ -154,7 +154,7 @@ bool LowerInvoke::doInitialization(Module &M) { if (MsgGV) { std::vector<Constant*> GEPIdx(2, Constant::getNullValue(Type::LongTy)); AbortMessage = - ConstantExpr::getGetElementPtr(ConstantPointerRef::get(MsgGV), GEPIdx); + ConstantExpr::getGetElementPtr(MsgGV, GEPIdx); } } @@ -191,7 +191,7 @@ void LowerInvoke::writeAbortMessage(Instruction *IB) { WriteFn->getParent()); std::vector<Constant*> GEPIdx(2, Constant::getNullValue(Type::LongTy)); AbortMessage = - ConstantExpr::getGetElementPtr(ConstantPointerRef::get(MsgGV), GEPIdx); + ConstantExpr::getGetElementPtr(MsgGV, GEPIdx); } // These are the arguments we WANT... 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) { |