summaryrefslogtreecommitdiffstats
path: root/llvm/tools/bugpoint/ExtractFunction.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-02-23 06:12:11 +0000
committerChris Lattner <sabre@nondot.org>2005-02-23 06:12:11 +0000
commit5e166a5f3efdbf06fad4834b27faf4156b61ee71 (patch)
treea8ef52b071ac5f2496706455689bb8b484c082cd /llvm/tools/bugpoint/ExtractFunction.cpp
parent80c5b970461f1c8b369402ebbbc1aea489dba690 (diff)
downloadbcm5719-llvm-5e166a5f3efdbf06fad4834b27faf4156b61ee71.tar.gz
bcm5719-llvm-5e166a5f3efdbf06fad4834b27faf4156b61ee71.zip
Fix a bugpoint crash that JeffC noticed, looking like this:
*** Attempting to perform final cleanups: Final cleanups failed. Sorry. :( Ple ase report a bug! <llc>llc.exe: bytecode didn't read correctly. llc.exe: bytecode didn't read correctly. <crash> Assertion failed: M && "You can't write a null module!!", file c:\llvm\lib\bytec ode\writer\writer.cpp, line 1094 The fact that llc bombed (in this case) is ok, but bugpoint shouldn't crash after this. llvm-svn: 20285
Diffstat (limited to 'llvm/tools/bugpoint/ExtractFunction.cpp')
-rw-r--r--llvm/tools/bugpoint/ExtractFunction.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/tools/bugpoint/ExtractFunction.cpp b/llvm/tools/bugpoint/ExtractFunction.cpp
index 078c7baf4e9..0eecc49efd6 100644
--- a/llvm/tools/bugpoint/ExtractFunction.cpp
+++ b/llvm/tools/bugpoint/ExtractFunction.cpp
@@ -98,7 +98,7 @@ static const PassInfo *getPI(Pass *P) {
/// performFinalCleanups - This method clones the current Program and performs
/// a series of cleanups intended to get rid of extra cruft on the module
-/// before handing it to the user...
+/// before handing it to the user.
///
Module *BugDriver::performFinalCleanups(Module *M, bool MayModifySemantics) {
// Make all functions external, so GlobalDCE doesn't delete them...
@@ -118,6 +118,7 @@ Module *BugDriver::performFinalCleanups(Module *M, bool MayModifySemantics) {
Module *New = runPassesOn(M, CleanupPasses);
if (New == 0) {
std::cerr << "Final cleanups failed. Sorry. :( Please report a bug!\n";
+ return M;
}
delete M;
return New;
OpenPOWER on IntegriCloud