[llvm-commits] CVS: llvm/lib/Transforms/Instrumentation/TraceValues.cpp

Chris Lattner lattner at cs.uiuc.edu
Wed Jun 4 23:49:00 PDT 2003


Changes in directory llvm/lib/Transforms/Instrumentation:

TraceValues.cpp updated: 1.56 -> 1.57

---
Log message:

Use a constant expr GEP instead of an actual instruction


---
Diffs of the changes:

Index: llvm/lib/Transforms/Instrumentation/TraceValues.cpp
diff -u llvm/lib/Transforms/Instrumentation/TraceValues.cpp:1.56 llvm/lib/Transforms/Instrumentation/TraceValues.cpp:1.57
--- llvm/lib/Transforms/Instrumentation/TraceValues.cpp:1.56	Wed Apr 23 11:37:40 2003
+++ llvm/lib/Transforms/Instrumentation/TraceValues.cpp	Wed Jun  4 23:48:18 2003
@@ -231,10 +231,8 @@
   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) {





More information about the llvm-commits mailing list