source-level CFG: have the body for the @synchronized start with its own basic

block. This makes it a little easier for diagnostics generation.

llvm-svn: 71037
This commit is contained in:
Ted Kremenek 2009-05-05 23:11:51 +00:00
parent e58fc20f8d
commit b3c657bbd4
1 changed files with 12 additions and 1 deletions

View File

@ -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());