[cfe-commits] r71037 - /cfe/trunk/lib/AST/CFG.cpp

Ted Kremenek kremenek at apple.com
Tue May 5 16:11:51 PDT 2009


Author: kremenek
Date: Tue May  5 18:11:51 2009
New Revision: 71037

URL: http://llvm.org/viewvc/llvm-project?rev=71037&view=rev
Log:
source-level CFG: have the body for the @synchronized start with its own basic
block. This makes it a little easier for diagnostics generation.

Modified:
    cfe/trunk/lib/AST/CFG.cpp

Modified: cfe/trunk/lib/AST/CFG.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/CFG.cpp?rev=71037&r1=71036&r2=71037&view=diff

==============================================================================
--- cfe/trunk/lib/AST/CFG.cpp (original)
+++ cfe/trunk/lib/AST/CFG.cpp Tue May  5 18:11:51 2009
@@ -937,7 +937,18 @@
   // FIXME: Add locking 'primitives' to CFG for @synchronized.
   
   // Inline the body.
-  Visit(S->getSynchBody());
+  CFGBlock *SyncBlock = Visit(S->getSynchBody());
+  
+  // The sync body starts its own basic block.  This makes it a little easier
+  // for diagnostic clients.
+  if (SyncBlock) {
+    if (!FinishBlock(SyncBlock))
+      return 0;
+    
+    Block = 0;
+  }
+    
+  Succ = SyncBlock;
   
   // Inline the sync expression.
   return Visit(S->getSynchExpr());





More information about the cfe-commits mailing list