forked from OSchip/llvm-project
Simplify code. CompoundStmt's RBraceLoc can be found using its SourceRange too.
llvm-svn: 107770
This commit is contained in:
parent
46f556d4e5
commit
6fbc8fa53e
|
@ -461,14 +461,10 @@ SourceLocation Decl::getBodyRBrace() const {
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue