Addressing Doug's suggestions:

-Added comment for FunctionDecl::EndRangeLoc
-Removed a redundant check from FunctionDecl::setBody

llvm-svn: 73886
This commit is contained in:
Argyrios Kyrtzidis 2009-06-22 17:13:31 +00:00
parent 246219bc9f
commit 49abd4d95b
2 changed files with 8 additions and 1 deletions

View File

@ -647,6 +647,13 @@ private:
// Move to DeclGroup when it is implemented.
SourceLocation TypeSpecStartLoc;
/// \brief End part of this FunctionDecl's source range.
///
/// We could compute the full range in getSourceRange(). However, when we're
/// dealing with a function definition deserialized from a PCH/AST file,
/// we can only compute the full range once the function body has been
/// de-serialized, so it's far better to have the (sometimes-redundant)
/// EndRangeLoc.
SourceLocation EndRangeLoc;
/// \brief The template or declaration that this declaration

View File

@ -379,7 +379,7 @@ Stmt *FunctionDecl::getBodyIfAvailable() const {
void FunctionDecl::setBody(Stmt *B) {
Body = B;
if (B && EndRangeLoc < B->getLocEnd())
if (B)
EndRangeLoc = B->getLocEnd();
}