diff options
Diffstat (limited to 'lib/AST/CFG.cpp')
-rw-r--r-- | lib/AST/CFG.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/AST/CFG.cpp b/lib/AST/CFG.cpp index f5b604554d..af2a8910d8 100644 --- a/lib/AST/CFG.cpp +++ b/lib/AST/CFG.cpp @@ -937,7 +937,18 @@ CFGBlock* CFGBuilder::VisitObjCAtSynchronizedStmt(ObjCAtSynchronizedStmt* S) { // 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()); |