[cfe-commits] r107770 - /cfe/trunk/lib/AST/DeclBase.cpp
Argyrios Kyrtzidis
akyrtzi at gmail.com
Wed Jul 7 04:31:27 PDT 2010
Author: akirtzidis
Date: Wed Jul 7 06:31:27 2010
New Revision: 107770
URL: http://llvm.org/viewvc/llvm-project?rev=107770&view=rev
Log:
Simplify code. CompoundStmt's RBraceLoc can be found using its SourceRange too.
Modified:
cfe/trunk/lib/AST/DeclBase.cpp
Modified: cfe/trunk/lib/AST/DeclBase.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclBase.cpp?rev=107770&r1=107769&r2=107770&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclBase.cpp (original)
+++ cfe/trunk/lib/AST/DeclBase.cpp Wed Jul 7 06:31:27 2010
@@ -461,14 +461,10 @@
return SourceLocation();
}
- Stmt *Body = getBody();
- if (!Body)
- return SourceLocation();
- if (CompoundStmt *CS = dyn_cast<CompoundStmt>(Body))
- return CS->getRBracLoc();
- assert(isa<CXXTryStmt>(Body) &&
- "Body can only be CompoundStmt or CXXTryStmt");
- return cast<CXXTryStmt>(Body)->getSourceRange().getEnd();
+ if (Stmt *Body = getBody())
+ return Body->getSourceRange().getEnd();
+
+ return SourceLocation();
}
#ifndef NDEBUG
More information about the cfe-commits
mailing list