diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-03-30 22:29:21 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-03-30 22:29:21 +0000 |
commit | 89cc8ea794b79d6dfd1aa50c665e352791ffa15c (patch) | |
tree | 3a39553b8f475cace5cb5c66bd5b5283f5207821 /clang/lib/AST | |
parent | 6e68bd007a574375790a7d98f5859bd0ffee0d83 (diff) | |
download | bcm5719-llvm-89cc8ea794b79d6dfd1aa50c665e352791ffa15c.tar.gz bcm5719-llvm-89cc8ea794b79d6dfd1aa50c665e352791ffa15c.zip |
Add partial CFG support for Objective-C exception-handling blocks. We basically
assume that @catch blocks are never executed.
llvm-svn: 68072
Diffstat (limited to 'clang/lib/AST')
-rw-r--r-- | clang/lib/AST/CFG.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/clang/lib/AST/CFG.cpp b/clang/lib/AST/CFG.cpp index 804c2d2bd5e..fc893d5b649 100644 --- a/clang/lib/AST/CFG.cpp +++ b/clang/lib/AST/CFG.cpp @@ -129,10 +129,13 @@ 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'. CFGBlock* VisitObjCAtThrowStmt(ObjCAtThrowStmt* S); @@ -888,7 +891,17 @@ CFGBlock* CFGBuilder::VisitObjCForCollectionStmt(ObjCForCollectionStmt* S) { Block = createBlock(); 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 |