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

Chris Lattner sabre at nondot.org
Sun Feb 18 23:35:04 PST 2007



Changes in directory llvm/lib/Transforms/Instrumentation:

ProfilingUtils.cpp updated: 1.15 -> 1.16
RSProfiling.cpp updated: 1.19 -> 1.20
---
Log message:

eliminate use of deprecated apis


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

 ProfilingUtils.cpp |    6 ++++--
 RSProfiling.cpp    |    3 ++-
 2 files changed, 6 insertions(+), 3 deletions(-)


Index: llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp
diff -u llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp:1.15 llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp:1.16
--- llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp:1.15	Mon Feb 12 20:10:56 2007
+++ llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp	Mon Feb 19 01:34:47 2007
@@ -43,7 +43,8 @@
   std::vector<Constant*> GEPIndices(2, Constant::getNullValue(Type::Int32Ty));
   unsigned NumElements = 0;
   if (Array) {
-    Args[2] = ConstantExpr::getGetElementPtr(Array, GEPIndices);
+    Args[2] = ConstantExpr::getGetElementPtr(Array, &GEPIndices[0],
+                                             GEPIndices.size());
     NumElements =
       cast<ArrayType>(Array->getType()->getElementType())->getNumElements();
   } else {
@@ -106,7 +107,8 @@
   std::vector<Constant*> Indices(2);
   Indices[0] = Constant::getNullValue(Type::Int32Ty);
   Indices[1] = ConstantInt::get(Type::Int32Ty, CounterNum);
-  Constant *ElementPtr = ConstantExpr::getGetElementPtr(CounterArray, Indices);
+  Constant *ElementPtr = 
+    ConstantExpr::getGetElementPtr(CounterArray, &Indices[0], Indices.size());
 
   // Load, increment and store the value back.
   Value *OldVal = new LoadInst(ElementPtr, "OldFuncCounter", InsertPos);


Index: llvm/lib/Transforms/Instrumentation/RSProfiling.cpp
diff -u llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.19 llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.20
--- llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.19	Mon Feb  5 17:32:05 2007
+++ llvm/lib/Transforms/Instrumentation/RSProfiling.cpp	Mon Feb 19 01:34:47 2007
@@ -335,7 +335,8 @@
   std::vector<Constant*> Indices(2);
   Indices[0] = Constant::getNullValue(Type::Int32Ty);
   Indices[1] = ConstantInt::get(Type::Int32Ty, CounterNum);
-  Constant *ElementPtr = ConstantExpr::getGetElementPtr(CounterArray, Indices);
+  Constant *ElementPtr = ConstantExpr::getGetElementPtr(CounterArray,
+                                                        &Indices[0], 2);
   
   // Load, increment and store the value back.
   Value *OldVal = new LoadInst(ElementPtr, "OldCounter", InsertPos);






More information about the llvm-commits mailing list