diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-07-21 14:46:17 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-07-21 14:46:17 +0000 |
commit | 741dd9a7e1d63e4e385b657e4ce11c5d96d44f72 (patch) | |
tree | 7e76dc2575d0e1c72a1dc6f311009aeeaae191ba /lib/AST/Decl.cpp | |
parent | 98f2cca4b2731b5d43da7c1582dd443ecead658d (diff) |
Add the location of the tag keyword into TagDecl. From Enea
Zaffanella, with tweaks from Abramo Bagnara.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76576 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r-- | lib/AST/Decl.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 6b1f830c40..b4710c2c53 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -182,9 +182,9 @@ TypedefDecl *TypedefDecl::Create(ASTContext &C, DeclContext *DC, } EnumDecl *EnumDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L, - IdentifierInfo *Id, + IdentifierInfo *Id, SourceLocation TKL, EnumDecl *PrevDecl) { - EnumDecl *Enum = new (C) EnumDecl(DC, L, Id); + EnumDecl *Enum = new (C) EnumDecl(DC, L, Id, TKL); C.getTypeDeclType(Enum, PrevDecl); return Enum; } @@ -654,7 +654,7 @@ void FunctionDecl::setExplicitSpecialization(bool ES) { SourceRange TagDecl::getSourceRange() const { SourceLocation E = RBraceLoc.isValid() ? RBraceLoc : getLocation(); - return SourceRange(getLocation(), E); + return SourceRange(TagKeywordLoc, E); } TagDecl* TagDecl::getCanonicalDecl() { @@ -692,8 +692,8 @@ TagDecl* TagDecl::getDefinition(ASTContext& C) const { //===----------------------------------------------------------------------===// RecordDecl::RecordDecl(Kind DK, TagKind TK, DeclContext *DC, SourceLocation L, - IdentifierInfo *Id) - : TagDecl(DK, TK, DC, L, Id) { + IdentifierInfo *Id, SourceLocation TKL) + : TagDecl(DK, TK, DC, L, Id, TKL) { HasFlexibleArrayMember = false; AnonymousStructOrUnion = false; HasObjectMember = false; @@ -702,9 +702,9 @@ RecordDecl::RecordDecl(Kind DK, TagKind TK, DeclContext *DC, SourceLocation L, RecordDecl *RecordDecl::Create(ASTContext &C, TagKind TK, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, - RecordDecl* PrevDecl) { + SourceLocation TKL, RecordDecl* PrevDecl) { - RecordDecl* R = new (C) RecordDecl(Record, TK, DC, L, Id); + RecordDecl* R = new (C) RecordDecl(Record, TK, DC, L, Id, TKL); C.getTypeDeclType(R, PrevDecl); return R; } |