Make sure that "newmain" gets names for its arguments
authorChris Lattner <sabre@nondot.org>
Sun, 17 Aug 2003 22:14:20 +0000 (22:14 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 17 Aug 2003 22:14:20 +0000 (22:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7927 91177308-0d34-0410-b5e6-96231b3b80d8

tools/bugpoint/CodeGeneratorBug.cpp

index dec9caea411f52ac203f049719f680cce5a4de7a..72ea91a4e274ac5939ea1d7b613138b771fdaa6b 100644 (file)
@@ -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);