From 17a5dfe6f7c93bcfe69cf8b6cfe4ae5fce39cd95 Mon Sep 17 00:00:00 2001 From: David Greene Date: Wed, 1 Aug 2007 03:43:44 +0000 Subject: New CallInst interface to address GLIBCXX_DEBUG errors caused by indexing an empty std::vector. Updates to all clients. llvm-svn: 40660 --- llvm/tools/bugpoint/Miscompilation.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'llvm/tools/bugpoint/Miscompilation.cpp') diff --git a/llvm/tools/bugpoint/Miscompilation.cpp b/llvm/tools/bugpoint/Miscompilation.cpp index 925a7a85ee9..be820c8b284 100644 --- a/llvm/tools/bugpoint/Miscompilation.cpp +++ b/llvm/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); } -- cgit v1.2.3