aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Instrumentation/TraceValues.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/Instrumentation/TraceValues.cpp')
-rw-r--r--lib/Transforms/Instrumentation/TraceValues.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Transforms/Instrumentation/TraceValues.cpp b/lib/Transforms/Instrumentation/TraceValues.cpp
index 499bc4cf9d..618466a403 100644
--- a/lib/Transforms/Instrumentation/TraceValues.cpp
+++ b/lib/Transforms/Instrumentation/TraceValues.cpp
@@ -231,10 +231,8 @@ static void InsertPrintInst(Value *V, BasicBlock *BB, Instruction *InsertBefore,
GlobalVariable *fmtVal = getStringRef(Mod, Message+getPrintfCodeFor(V)+"\n");
// Turn the format string into an sbyte *
- Instruction *GEP =
- new GetElementPtrInst(fmtVal,
- vector<Value*>(2,ConstantSInt::get(Type::LongTy, 0)),
- "trstrp", InsertBefore);
+ Constant *GEP =ConstantExpr::getGetElementPtr(ConstantPointerRef::get(fmtVal),
+ vector<Constant*>(2,Constant::getNullValue(Type::LongTy)));
// Insert a call to the hash function if this is a pointer value
if (V && isa<PointerType>(V->getType()) && !DisablePtrHashing) {