diff options
Diffstat (limited to 'tools/bugpoint/CodeGeneratorBug.cpp')
-rw-r--r-- | tools/bugpoint/CodeGeneratorBug.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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<Value*> 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); |