[llvm-commits] [llvm] r78472 - /llvm/trunk/lib/CodeGen/MachineVerifier.cpp

Jakob Stoklund Olesen stoklund at 2pi.dk
Sat Aug 8 08:34:50 PDT 2009


Author: stoklund
Date: Sat Aug  8 10:34:50 2009
New Revision: 78472

URL: http://llvm.org/viewvc/llvm-project?rev=78472&view=rev
Log:
Clean out per-function data after the machine code verifier is done with it.

Also don't dereference old pointers after they have been deleted causing
random crashes when enabling the machine code verifier.

Ahem...

I have not included a test case for the crash. It hapened when enabling the
verifier on CodeGen/X86/2009-08-06-branchfolder-crash.ll.

The crash depends on an MBB being allocated at the same address as a
previously deleted MBB. I don't think that can be reproduced reliably.

Modified:
    llvm/trunk/lib/CodeGen/MachineVerifier.cpp

Modified: llvm/trunk/lib/CodeGen/MachineVerifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineVerifier.cpp?rev=78472&r1=78471&r2=78472&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/MachineVerifier.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineVerifier.cpp Sat Aug  8 10:34:50 2009
@@ -220,6 +220,14 @@
     llvm_report_error(Msg.str());
   }
 
+  // Clean up.
+  regsLive.clear();
+  regsDefined.clear();
+  regsDead.clear();
+  regsKilled.clear();
+  regsLiveInButUnused.clear();
+  MBBInfoMap.clear();
+
   return false;                 // no changes
 }
 





More information about the llvm-commits mailing list