summaryrefslogtreecommitdiff
path: root/tools/llvm-upgrade
diff options
context:
space:
mode:
authorDavid Greene <greened@obbligato.org>2007-08-01 03:43:44 +0000
committerDavid Greene <greened@obbligato.org>2007-08-01 03:43:44 +0000
commit52eec548206d0b135b55ba52dd0e82e978f15ae5 (patch)
tree1c9794c86069c19f235104ec8c2a6f91405552d2 /tools/llvm-upgrade
parent7fc77611eff7c47e8c37fad58af637138e2a9d7a (diff)
downloadllvm-52eec548206d0b135b55ba52dd0e82e978f15ae5.tar.gz
llvm-52eec548206d0b135b55ba52dd0e82e978f15ae5.tar.bz2
llvm-52eec548206d0b135b55ba52dd0e82e978f15ae5.tar.xz
New CallInst interface to address GLIBCXX_DEBUG errors caused by
indexing an empty std::vector. Updates to all clients. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40660 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-upgrade')
-rw-r--r--tools/llvm-upgrade/UpgradeParser.y17
1 files changed, 9 insertions, 8 deletions
diff --git a/tools/llvm-upgrade/UpgradeParser.y b/tools/llvm-upgrade/UpgradeParser.y
index ed84267d08..c9b3e6a7dc 100644
--- a/tools/llvm-upgrade/UpgradeParser.y
+++ b/tools/llvm-upgrade/UpgradeParser.y
@@ -1513,7 +1513,7 @@ upgradeIntrinsicCall(const Type* RetTy, const ValID &ID,
const PointerType *PFTy = PointerType::get(FTy);
Value* Func = getVal(PFTy, ID);
Args[0] = new BitCastInst(Args[0], PtrTy, makeNameUnique("va"), CurBB);
- return new CallInst(Func, &Args[0], Args.size());
+ return new CallInst(Func, Args.begin(), Args.end());
} else if (Name == "llvm.va_copy") {
if (Args.size() != 2)
error("Invalid prototype for " + Name + " prototype");
@@ -1527,7 +1527,7 @@ upgradeIntrinsicCall(const Type* RetTy, const ValID &ID,
std::string InstName1(makeNameUnique("va1"));
Args[0] = new BitCastInst(Args[0], PtrTy, InstName0, CurBB);
Args[1] = new BitCastInst(Args[1], PtrTy, InstName1, CurBB);
- return new CallInst(Func, &Args[0], Args.size());
+ return new CallInst(Func, Args.begin(), Args.end());
}
}
}
@@ -1751,11 +1751,12 @@ Module* UpgradeAssembly(const std::string &infile, std::istream& in,
while (!F->use_empty()) {
CallInst* CI = cast<CallInst>(F->use_back());
- AllocaInst* a = new AllocaInst(ArgTy, 0, "vacopy.fix.1", CI);
- AllocaInst* b = new AllocaInst(ArgTy, 0, "vacopy.fix.2", CI);
- new StoreInst(CI->getOperand(1), b, CI);
- new CallInst(NF, a, b, "", CI);
- Value* foo = new LoadInst(a, "vacopy.fix.3", CI);
+ SmallVector<Value *, 2> Args;
+ Args.push_back(new AllocaInst(ArgTy, 0, "vacopy.fix.1", CI));
+ Args.push_back(new AllocaInst(ArgTy, 0, "vacopy.fix.2", CI));
+ new StoreInst(CI->getOperand(1), Args[1], CI);
+ new CallInst(NF, Args.begin(), Args.end(), "", CI);
+ Value* foo = new LoadInst(Args[0], "vacopy.fix.3", CI);
CI->replaceAllUsesWith(foo);
CI->getParent()->getInstList().erase(CI);
}
@@ -3806,7 +3807,7 @@ InstVal
}
// Create the call instruction
- CallInst *CI = new CallInst(V, &Args[0], Args.size());
+ CallInst *CI = new CallInst(V, Args.begin(), Args.end());
CI->setTailCall($1);
CI->setCallingConv(upgradeCallingConv($2));
$$.I = CI;