Add the SourceLocation for the right brace in TagDecl.

llvm-svn: 75590
This commit is contained in:
Argyrios Kyrtzidis
2009-07-14 03:17:17 +00:00
parent d6c256696b
commit 575fa05991
2 changed files with 13 additions and 1 deletions

View File

@@ -1150,7 +1150,9 @@ private:
/// TypedefForAnonDecl - If a TagDecl is anonymous and part of a typedef,
/// this points to the TypedefDecl. Used for mangling.
TypedefDecl *TypedefForAnonDecl;
SourceLocation RBraceLoc;
protected:
TagDecl(Kind DK, TagKind TK, DeclContext *DC, SourceLocation L,
IdentifierInfo *Id)
@@ -1161,6 +1163,11 @@ protected:
}
public:
SourceLocation getRBraceLoc() const { return RBraceLoc; }
void setRBraceLoc(SourceLocation L) { RBraceLoc = L; }
virtual SourceRange getSourceRange() const;
/// isDefinition - Return true if this decl has its body specified.
bool isDefinition() const {
return IsDefinition;

View File

@@ -658,6 +658,11 @@ void FunctionDecl::setExplicitSpecialization(bool ES) {
// TagDecl Implementation
//===----------------------------------------------------------------------===//
SourceRange TagDecl::getSourceRange() const {
SourceLocation E = RBraceLoc.isValid() ? RBraceLoc : getLocation();
return SourceRange(getLocation(), E);
}
void TagDecl::startDefinition() {
TagType *TagT = const_cast<TagType *>(TypeForDecl->getAsTagType());
TagT->decl.setPointer(this);