diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-04-23 22:50:49 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-04-23 22:50:49 +0000 |
commit | 96c79498fbcc1e7d03cba88725dffafb2b568c53 (patch) | |
tree | 8c74d92c11e42f011bf0ced629759b8ebdb5b626 /clang/lib/AST/StmtDumper.cpp | |
parent | 11d1df442dfd0f526f659a5447df6dfe7695f41d (diff) | |
download | bcm5719-llvm-96c79498fbcc1e7d03cba88725dffafb2b568c53.tar.gz bcm5719-llvm-96c79498fbcc1e7d03cba88725dffafb2b568c53.zip |
Improve the AST representation of Objective-C @try/@catch/@finally
statements. Instead of the @try having a single @catch, where all of
the @catch's were chained (using an O(n^2) algorithm nonetheless),
@try just holds an array of its @catch blocks. The resulting AST is
slightly more compact (not important) and better represents the actual
language semantics (good).
llvm-svn: 102221
Diffstat (limited to 'clang/lib/AST/StmtDumper.cpp')
-rw-r--r-- | clang/lib/AST/StmtDumper.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/AST/StmtDumper.cpp b/clang/lib/AST/StmtDumper.cpp index 05adc0292e3..8481055b9d0 100644 --- a/clang/lib/AST/StmtDumper.cpp +++ b/clang/lib/AST/StmtDumper.cpp @@ -143,6 +143,7 @@ namespace { void DumpCXXTemporary(CXXTemporary *Temporary); // ObjC + void VisitObjCAtCatchStmt(ObjCAtCatchStmt *Node); void VisitObjCEncodeExpr(ObjCEncodeExpr *Node); void VisitObjCMessageExpr(ObjCMessageExpr* Node); void VisitObjCSelectorExpr(ObjCSelectorExpr *Node); @@ -524,6 +525,16 @@ void StmtDumper::VisitObjCMessageExpr(ObjCMessageExpr* Node) { } } +void StmtDumper::VisitObjCAtCatchStmt(ObjCAtCatchStmt *Node) { + DumpStmt(Node); + if (ParmVarDecl *CatchParam = Node->getCatchParamDecl()) { + OS << " catch parm = "; + DumpDeclarator(CatchParam); + } else { + OS << " catch all"; + } +} + void StmtDumper::VisitObjCEncodeExpr(ObjCEncodeExpr *Node) { DumpExpr(Node); OS << " "; |