]> granicus.if.org Git - clang/commitdiff
Add an easy accessor for the end of the try/catch statement.
authorMike Stump <mrs@apple.com>
Fri, 4 Dec 2009 22:22:32 +0000 (22:22 +0000)
committerMike Stump <mrs@apple.com>
Fri, 4 Dec 2009 22:22:32 +0000 (22:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90604 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/StmtCXX.h

index 64eea2429c5d087fbbccac246226fdd6441da8e9..09ea4ca2101be434e10f7a0bda4131c16e1a332c 100644 (file)
@@ -68,10 +68,11 @@ public:
              Stmt **handlers, unsigned numHandlers);
 
   virtual SourceRange getSourceRange() const {
-    return SourceRange(TryLoc, Stmts.back()->getLocEnd());
+    return SourceRange(getTryLoc(), getEndLoc());
   }
 
   SourceLocation getTryLoc() const { return TryLoc; }
+  SourceLocation getEndLoc() const { return Stmts.back()->getLocEnd(); }
 
   CompoundStmt *getTryBlock() { return llvm::cast<CompoundStmt>(Stmts[0]); }
   const CompoundStmt *getTryBlock() const {