[cfe-commits] r43654 - /cfe/trunk/include/clang/AST/Stmt.h

Fariborz Jahanian fjahanian at apple.com
Fri Nov 2 17:38:44 PDT 2007


Author: fjahanian
Date: Fri Nov  2 19:38:38 2007
New Revision: 43654

URL: http://llvm.org/viewvc/llvm-project?rev=43654&view=rev
Log:
Provide both const and non-const accessor methods for @try and @finally ASTs.
My previous patch did the same for @catch AST.

Modified:
    cfe/trunk/include/clang/AST/Stmt.h

Modified: cfe/trunk/include/clang/AST/Stmt.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Stmt.h?rev=43654&r1=43653&r2=43654&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/Stmt.h (original)
+++ cfe/trunk/include/clang/AST/Stmt.h Fri Nov  2 19:38:38 2007
@@ -718,7 +718,8 @@
     : Stmt(ObjcAtFinallyStmtClass), 
       AtFinallyStmt(atFinallyStmt), AtFinallyLoc(atFinallyLoc) {}
     
-    Stmt *getFinallyBody () const { return AtFinallyStmt; }
+    const Stmt *getFinallyBody () const { return AtFinallyStmt; }
+    Stmt *getFinallyBody () { return AtFinallyStmt; }
   
     virtual SourceRange getSourceRange() const { 
       return SourceRange(AtFinallyLoc, AtFinallyStmt->getLocEnd()); 
@@ -754,9 +755,12 @@
       SubStmts[END_TRY] = NULL;
     }
     
-  Stmt *getTryBody() const { return SubStmts[TRY]; }
-  Stmt *getCatchStmts() const { return SubStmts[CATCH]; }
-  Stmt *getFinallyStmt() const { return SubStmts[FINALLY]; }
+  const Stmt *getTryBody() const { return SubStmts[TRY]; }
+  Stmt *getTryBody() { return SubStmts[TRY]; }
+  const Stmt *getCatchStmts() const { return SubStmts[CATCH]; }
+  Stmt *getCatchStmts() { return SubStmts[CATCH]; }
+  const Stmt *getFinallyStmt() const { return SubStmts[FINALLY]; }
+  Stmt *getFinallyStmt() { return SubStmts[FINALLY]; }
   
   virtual SourceRange getSourceRange() const { 
     return SourceRange(AtTryLoc, SubStmts[TRY]->getLocEnd()); 





More information about the cfe-commits mailing list