aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/CFG.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-05-05 23:11:51 +0000
committerTed Kremenek <kremenek@apple.com>2009-05-05 23:11:51 +0000
commitda5348eda7bb45d715561249dec9833d51dfda67 (patch)
tree7d15be5c6301e581b6656f9dbdd8841d95b0b49a /lib/AST/CFG.cpp
parentc42e07ef9a2978b9b4a1fde45905b2443ab6742c (diff)
source-level CFG: have the body for the @synchronized start with its own basic
block. This makes it a little easier for diagnostics generation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71037 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/CFG.cpp')
-rw-r--r--lib/AST/CFG.cpp13
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());