summaryrefslogtreecommitdiff
path: root/tools/bugpoint
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-08-17 22:14:20 +0000
committerChris Lattner <sabre@nondot.org>2003-08-17 22:14:20 +0000
commit57e5a702d0e3c49c67208bf07212c878d34e73ca (patch)
tree7f1193edb1e2722319262e6f62b62fc3d66c161d /tools/bugpoint
parente533cefbc091ee21199fd8c884bce8586d8a4f2e (diff)
downloadllvm-57e5a702d0e3c49c67208bf07212c878d34e73ca.tar.gz
llvm-57e5a702d0e3c49c67208bf07212c878d34e73ca.tar.bz2
llvm-57e5a702d0e3c49c67208bf07212c878d34e73ca.tar.xz
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
Diffstat (limited to 'tools/bugpoint')
-rw-r--r--tools/bugpoint/CodeGeneratorBug.cpp5
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);