aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Instrumentation
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-02-19 07:34:47 +0000
committerChris Lattner <sabre@nondot.org>2007-02-19 07:34:47 +0000
commitec1f752ae49b053231288a8c429d076b5855fc7c (patch)
tree0178c5962365b4fc1e567aec04f8801cc35257cd /lib/Transforms/Instrumentation
parent4227bdbf55d8735d343e5a237ffd432e572292c9 (diff)
downloadexternal_llvm-ec1f752ae49b053231288a8c429d076b5855fc7c.zip
external_llvm-ec1f752ae49b053231288a8c429d076b5855fc7c.tar.gz
external_llvm-ec1f752ae49b053231288a8c429d076b5855fc7c.tar.bz2
eliminate use of deprecated apis
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34417 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Instrumentation')
-rw-r--r--lib/Transforms/Instrumentation/ProfilingUtils.cpp6
-rw-r--r--lib/Transforms/Instrumentation/RSProfiling.cpp3
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/Transforms/Instrumentation/ProfilingUtils.cpp b/lib/Transforms/Instrumentation/ProfilingUtils.cpp
index 071ca0d..54ea803 100644
--- a/lib/Transforms/Instrumentation/ProfilingUtils.cpp
+++ b/lib/Transforms/Instrumentation/ProfilingUtils.cpp
@@ -43,7 +43,8 @@ void llvm::InsertProfilingInitCall(Function *MainFn, const char *FnName,
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 @@ void llvm::IncrementCounterInBlock(BasicBlock *BB, unsigned CounterNum,
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);
diff --git a/lib/Transforms/Instrumentation/RSProfiling.cpp b/lib/Transforms/Instrumentation/RSProfiling.cpp
index fc464c0..2b3adb2 100644
--- a/lib/Transforms/Instrumentation/RSProfiling.cpp
+++ b/lib/Transforms/Instrumentation/RSProfiling.cpp
@@ -335,7 +335,8 @@ void RSProfilers_std::IncrementCounterInBlock(BasicBlock *BB, unsigned CounterNu
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);