mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-26 05:27:43 +00:00
eliminate use of deprecated apis
llvm-svn: 34417
This commit is contained in:
parent
9fcc5048b8
commit
b83d08ddc2
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -166,7 +166,7 @@ void LowerInvoke::createAbortMessage(Module *M) {
|
||||
GlobalValue::InternalLinkage,
|
||||
Msg, "abortmsg", M);
|
||||
std::vector<Constant*> 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<Constant*> GEPIdx(2, Constant::getNullValue(Type::Int32Ty));
|
||||
AbortMessage = ConstantExpr::getGetElementPtr(MsgGV, GEPIdx);
|
||||
AbortMessage = ConstantExpr::getGetElementPtr(MsgGV, &GEPIdx[0], 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user