[cfe-commits] r71042 - /cfe/branches/Apple/Dib/lib/AST/CFG.cpp

Mike Stump mrs at apple.com
Tue May 5 17:03:25 PDT 2009


Author: mrs
Date: Tue May  5 19:03:20 2009
New Revision: 71042

URL: http://llvm.org/viewvc/llvm-project?rev=71042&view=rev
Log:
Merge in 71037:

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/branches/Apple/Dib/lib/AST/CFG.cpp

Modified: cfe/branches/Apple/Dib/lib/AST/CFG.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/Dib/lib/AST/CFG.cpp?rev=71042&r1=71041&r2=71042&view=diff

==============================================================================
--- cfe/branches/Apple/Dib/lib/AST/CFG.cpp (original)
+++ cfe/branches/Apple/Dib/lib/AST/CFG.cpp Tue May  5 19:03:20 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