Add partial CFG support for Objective-C exception-handling blocks. We basically

assume that @catch blocks are never executed.

llvm-svn: 68072
This commit is contained in:
Ted Kremenek 2009-03-30 22:29:21 +00:00
parent 6e68bd007a
commit 89cc8ea794
1 changed files with 18 additions and 5 deletions

View File

@ -129,9 +129,12 @@ public:
return Block;
}
CFGBlock* VisitObjCAtTryStmt(ObjCAtTryStmt* S) { return NYS(); }
CFGBlock* VisitObjCAtCatchStmt(ObjCAtCatchStmt* S) { return NYS(); }
CFGBlock* VisitObjCAtFinallyStmt(ObjCAtFinallyStmt* S) { return NYS(); }
CFGBlock* VisitObjCAtTryStmt(ObjCAtTryStmt* S);
CFGBlock* VisitObjCAtCatchStmt(ObjCAtCatchStmt* S) {
// FIXME: For now we pretend that @catch and the code it contains
// does not exit.
return Block;
}
// FIXME: This is not completely supported. We basically @throw like
// a 'return'.
@ -889,6 +892,16 @@ CFGBlock* CFGBuilder::VisitObjCForCollectionStmt(ObjCForCollectionStmt* S) {
return addStmt(S->getCollection());
}
CFGBlock* CFGBuilder::VisitObjCAtTryStmt(ObjCAtTryStmt* S) {
// Process the statements of the @finally block.
if (ObjCAtFinallyStmt *FS = S->getFinallyStmt())
Visit(FS->getFinallyBody());
// FIXME: Handle the @catch statements.
// Process the try body
return Visit(S->getTryBody());
}
CFGBlock* CFGBuilder::VisitWhileStmt(WhileStmt* W) {
// "while" is a control-flow statement. Thus we stop processing the