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

Chris Lattner lattner at cs.uiuc.edu
Sun Apr 4 20:30:19 PDT 2004


Changes in directory llvm/lib/Transforms/Instrumentation:

ProfilingUtils.cpp updated: 1.1 -> 1.2

---
Log message:

Support getelementptr instructions which use uint's to index into structure 
types and can have arbitrary 32- and 64-bit integer types indexing into
sequential types.



---
Diffs of the changes:  (+3 -3)

Index: llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp
diff -u llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp:1.1 llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp:1.2
--- llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp:1.1	Mon Mar  8 11:06:13 2004
+++ llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp	Sun Apr  4 20:29:02 2004
@@ -40,7 +40,7 @@
   while (isa<AllocaInst>(InsertPos)) ++InsertPos;
 
   ConstantPointerRef *ArrayCPR = ConstantPointerRef::get(Array);
-  std::vector<Constant*> GEPIndices(2, Constant::getNullValue(Type::LongTy));
+  std::vector<Constant*> GEPIndices(2, Constant::getNullValue(Type::IntTy));
   Args[2] = ConstantExpr::getGetElementPtr(ArrayCPR, GEPIndices);
   
   unsigned NumElements =
@@ -89,8 +89,8 @@
 
   // Create the getelementptr constant expression
   std::vector<Constant*> Indices(2);
-  Indices[0] = Constant::getNullValue(Type::LongTy);
-  Indices[1] = ConstantSInt::get(Type::LongTy, CounterNum);
+  Indices[0] = Constant::getNullValue(Type::IntTy);
+  Indices[1] = ConstantSInt::get(Type::IntTy, CounterNum);
   Constant *ElementPtr = ConstantExpr::getGetElementPtr(CounterArray, Indices);
 
   // Load, increment and store the value back.





More information about the llvm-commits mailing list