Use a constant expr GEP instead of an actual instruction
authorChris Lattner <sabre@nondot.org>
Thu, 5 Jun 2003 04:48:18 +0000 (04:48 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 5 Jun 2003 04:48:18 +0000 (04:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6620 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Instrumentation/TraceValues.cpp

index 499bc4cf9d0a40466157a5cde74452d1373d0c13..618466a403091b38b7014025f2cd737fb7827ef2 100644 (file)
@@ -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) {