From d3646f158656bf47bc9a6dd86d79f1b7d4a0c7f7 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 5 Jun 2003 04:48:18 +0000 Subject: [PATCH] Use a constant expr GEP instead of an actual instruction git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6620 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Instrumentation/TraceValues.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/Transforms/Instrumentation/TraceValues.cpp b/lib/Transforms/Instrumentation/TraceValues.cpp index 499bc4cf9d0..618466a4030 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(2,ConstantSInt::get(Type::LongTy, 0)), - "trstrp", InsertBefore); + Constant *GEP =ConstantExpr::getGetElementPtr(ConstantPointerRef::get(fmtVal), + vector(2,Constant::getNullValue(Type::LongTy))); // Insert a call to the hash function if this is a pointer value if (V && isa(V->getType()) && !DisablePtrHashing) {