[llvm-commits] CVS: llvm/tools/bugpoint/Miscompilation.cpp
Chris Lattner
lattner at cs.uiuc.edu
Wed Mar 17 11:43:01 PST 2004
Changes in directory llvm/tools/bugpoint:
Miscompilation.cpp updated: 1.32 -> 1.33
---
Log message:
When loop extraction succeeds, make sure to map the function pointers over
to avoid dangling references.
---
Diffs of the changes: (+11 -0)
Index: llvm/tools/bugpoint/Miscompilation.cpp
diff -u llvm/tools/bugpoint/Miscompilation.cpp:1.32 llvm/tools/bugpoint/Miscompilation.cpp:1.33
--- llvm/tools/bugpoint/Miscompilation.cpp:1.32 Mon Mar 15 19:51:54 2004
+++ llvm/tools/bugpoint/Miscompilation.cpp Wed Mar 17 11:42:09 2004
@@ -268,6 +268,17 @@
exit(1);
}
delete ToOptimizeLoopExtracted;
+
+ // All of the Function*'s in the MiscompiledFunctions list are in the old
+ // module. Make sure to update them to point to the corresponding functions
+ // in the new module.
+ for (unsigned i = 0, e = MiscompiledFunctions.size(); i != e; ++i) {
+ Function *OldF = MiscompiledFunctions[i];
+ Function *NewF =
+ ToNotOptimize->getFunction(OldF->getName(), OldF->getFunctionType());
+ MiscompiledFunctions[i] = NewF;
+ }
+
BD.setNewProgram(ToNotOptimize);
MadeChange = true;
}
More information about the llvm-commits
mailing list