From 3cc301834e1c4678f941850ff1a37400ac97679d Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 5 Jun 2003 04:48:18 +0000 Subject: Use a constant expr GEP instead of an actual instruction llvm-svn: 6620 --- llvm/lib/Transforms/Instrumentation/TraceValues.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Transforms/Instrumentation/TraceValues.cpp') diff --git a/llvm/lib/Transforms/Instrumentation/TraceValues.cpp b/llvm/lib/Transforms/Instrumentation/TraceValues.cpp index 499bc4cf9d0..618466a4030 100644 --- a/llvm/lib/Transforms/Instrumentation/TraceValues.cpp +++ b/llvm/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) { -- cgit v1.2.3