summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/StmtPrinter.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-04-23 22:50:49 +0000
committerDouglas Gregor <dgregor@apple.com>2010-04-23 22:50:49 +0000
commit96c79498fbcc1e7d03cba88725dffafb2b568c53 (patch)
tree8c74d92c11e42f011bf0ced629759b8ebdb5b626 /clang/lib/AST/StmtPrinter.cpp
parent11d1df442dfd0f526f659a5447df6dfe7695f41d (diff)
downloadbcm5719-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/StmtPrinter.cpp')
-rw-r--r--clang/lib/AST/StmtPrinter.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/clang/lib/AST/StmtPrinter.cpp b/clang/lib/AST/StmtPrinter.cpp
index a895b63a79c..3996528287d 100644
--- a/clang/lib/AST/StmtPrinter.cpp
+++ b/clang/lib/AST/StmtPrinter.cpp
@@ -388,11 +388,8 @@ void StmtPrinter::VisitObjCAtTryStmt(ObjCAtTryStmt *Node) {
OS << "\n";
}
- for (ObjCAtCatchStmt *catchStmt =
- static_cast<ObjCAtCatchStmt *>(Node->getCatchStmts());
- catchStmt;
- catchStmt =
- static_cast<ObjCAtCatchStmt *>(catchStmt->getNextCatchStmt())) {
+ for (unsigned I = 0, N = Node->getNumCatchStmts(); I != N; ++I) {
+ ObjCAtCatchStmt *catchStmt = Node->getCatchStmt(I);
Indent() << "@catch(";
if (catchStmt->getCatchParamDecl()) {
if (Decl *DS = catchStmt->getCatchParamDecl())
OpenPOWER on IntegriCloud