From ec1f752ae49b053231288a8c429d076b5855fc7c Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 19 Feb 2007 07:34:47 +0000 Subject: eliminate use of deprecated apis git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34417 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Instrumentation/ProfilingUtils.cpp | 6 ++++-- lib/Transforms/Instrumentation/RSProfiling.cpp | 3 ++- lib/Transforms/Utils/LowerInvoke.cpp | 4 ++-- 3 files changed, 8 insertions(+), 5 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 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(Array->getType()->getElementType())->getNumElements(); } else { @@ -106,7 +107,8 @@ void llvm::IncrementCounterInBlock(BasicBlock *BB, unsigned CounterNum, std::vector 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 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); diff --git a/lib/Transforms/Utils/LowerInvoke.cpp b/lib/Transforms/Utils/LowerInvoke.cpp index d89cc95..e1712bc 100644 --- a/lib/Transforms/Utils/LowerInvoke.cpp +++ b/lib/Transforms/Utils/LowerInvoke.cpp @@ -166,7 +166,7 @@ void LowerInvoke::createAbortMessage(Module *M) { GlobalValue::InternalLinkage, Msg, "abortmsg", M); std::vector GEPIdx(2, Constant::getNullValue(Type::Int32Ty)); - AbortMessage = ConstantExpr::getGetElementPtr(MsgGV, GEPIdx); + AbortMessage = ConstantExpr::getGetElementPtr(MsgGV, &GEPIdx[0], 2); } else { // The abort message for cheap EH support tells the user that EH is not // enabled. @@ -179,7 +179,7 @@ void LowerInvoke::createAbortMessage(Module *M) { GlobalValue::InternalLinkage, Msg, "abortmsg", M); std::vector GEPIdx(2, Constant::getNullValue(Type::Int32Ty)); - AbortMessage = ConstantExpr::getGetElementPtr(MsgGV, GEPIdx); + AbortMessage = ConstantExpr::getGetElementPtr(MsgGV, &GEPIdx[0], 2); } } -- cgit v1.1