]> granicus.if.org Git - clang/commitdiff
Print current function on verification failures.
authorDaniel Dunbar <daniel@zuster.org>
Wed, 17 Sep 2008 21:13:22 +0000 (21:13 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Wed, 17 Sep 2008 21:13:22 +0000 (21:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56291 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CodeGenFunction.cpp

index c9ee212d01f533f7289ecaab3c2894e8cbbe4820..e3674281e03ade19113a2079992d65c5c913fc39 100644 (file)
@@ -100,7 +100,10 @@ void CodeGenFunction::FinishFunction(SourceLocation EndLoc) {
   AllocaInsertPt = 0;
   
   // Verify that the function is well formed.
-  assert(!verifyFunction(*CurFn) && "Generated function is not well formed.");
+  if (verifyFunction(*CurFn, llvm::PrintMessageAction)) {
+    CurFn->dump();
+    assert(0 && "Function failed verification!");
+  }
 }
 
 void CodeGenFunction::StartFunction(const Decl *D, QualType RetTy,