summaryrefslogtreecommitdiff
path: root/tools/bugpoint/Miscompilation.cpp
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/bugpoint/Miscompilation.cpp
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/bugpoint/Miscompilation.cpp')
-rw-r--r--tools/bugpoint/Miscompilation.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/bugpoint/Miscompilation.cpp b/tools/bugpoint/Miscompilation.cpp
index 925a7a85ee..be820c8b28 100644
--- a/tools/bugpoint/Miscompilation.cpp
+++ b/tools/bugpoint/Miscompilation.cpp
@@ -663,7 +663,7 @@ static void CleanupAndPrepareModules(BugDriver &BD, Module *&Test,
// Call the old main function and return its result
BasicBlock *BB = new BasicBlock("entry", newMain);
- CallInst *call = new CallInst(oldMainProto, &args[0], args.size(),
+ CallInst *call = new CallInst(oldMainProto, args.begin(), args.end(),
"", BB);
// If the type of old function wasn't void, return value of call
@@ -734,8 +734,8 @@ static void CleanupAndPrepareModules(BugDriver &BD, Module *&Test,
// Resolve the call to function F via the JIT API:
//
// call resolver(GetElementPtr...)
- CallInst *Resolver = new CallInst(resolverFunc, &ResolverArgs[0],
- ResolverArgs.size(),
+ CallInst *Resolver = new CallInst(resolverFunc, ResolverArgs.begin(),
+ ResolverArgs.end(),
"resolver", LookupBB);
// cast the result from the resolver to correctly-typed function
CastInst *CastedResolver = new BitCastInst(Resolver,
@@ -757,10 +757,10 @@ static void CleanupAndPrepareModules(BugDriver &BD, Module *&Test,
// Pass on the arguments to the real function, return its result
if (F->getReturnType() == Type::VoidTy) {
- new CallInst(FuncPtr, &Args[0], Args.size(), "", DoCallBB);
+ new CallInst(FuncPtr, Args.begin(), Args.end(), "", DoCallBB);
new ReturnInst(DoCallBB);
} else {
- CallInst *Call = new CallInst(FuncPtr, &Args[0], Args.size(),
+ CallInst *Call = new CallInst(FuncPtr, Args.begin(), Args.end(),
"retval", DoCallBB);
new ReturnInst(Call, DoCallBB);
}