From 57e5a702d0e3c49c67208bf07212c878d34e73ca Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 17 Aug 2003 22:14:20 +0000 Subject: Make sure that "newmain" gets names for its arguments git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7927 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/bugpoint/CodeGeneratorBug.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tools/bugpoint') diff --git a/tools/bugpoint/CodeGeneratorBug.cpp b/tools/bugpoint/CodeGeneratorBug.cpp index dec9caea41..72ea91a4e2 100644 --- a/tools/bugpoint/CodeGeneratorBug.cpp +++ b/tools/bugpoint/CodeGeneratorBug.cpp @@ -357,8 +357,11 @@ bool BugDriver::debugCodeGenerator() { // Call the old main function and return its result BasicBlock *BB = new BasicBlock("entry", newMain); std::vector args; - for (Function::aiterator I=newMain->abegin(), E=newMain->aend(); I!=E; ++I) + for (Function::aiterator I = newMain->abegin(), E = newMain->aend(), + OI = oldMain->abegin(); I != E; ++I, ++OI) { + I->setName(OI->getName()); // Copy argument names from oldMain args.push_back(I); + } CallInst *call = new CallInst(oldMain, args); BB->getInstList().push_back(call); -- cgit v1.2.3