aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Decl.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-08-21 00:31:54 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-08-21 00:31:54 +0000
commita5d82000f7b173a0a5ce34dc8c09a03f98d9e439 (patch)
tree9fb6219cbbff742d0b9e3fd84532dacf96091d50 /lib/AST/Decl.cpp
parentd1571acc700b652a52c766e36a6c688d9bf6f3a1 (diff)
Remove TypeSpecStartLocation from VarDecl/FunctionDecl/FieldDecl, and use DeclaratorInfo to get this information.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79584 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r--lib/AST/Decl.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp
index b41fae86b9..fc19e61a09 100644
--- a/lib/AST/Decl.cpp
+++ b/lib/AST/Decl.cpp
@@ -140,11 +140,9 @@ FunctionDecl *FunctionDecl::Create(ASTContext &C, DeclContext *DC,
DeclarationName N, QualType T,
DeclaratorInfo *DInfo,
StorageClass S, bool isInline,
- bool hasWrittenPrototype,
- SourceLocation TypeSpecStartLoc) {
+ bool hasWrittenPrototype) {
FunctionDecl *New
- = new (C) FunctionDecl(Function, DC, L, N, T, DInfo, S, isInline,
- TypeSpecStartLoc);
+ = new (C) FunctionDecl(Function, DC, L, N, T, DInfo, S, isInline);
New->HasWrittenPrototype = hasWrittenPrototype;
return New;
}
@@ -155,9 +153,8 @@ BlockDecl *BlockDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L) {
FieldDecl *FieldDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L,
IdentifierInfo *Id, QualType T,
- DeclaratorInfo *DInfo, Expr *BW,
- bool Mutable, SourceLocation TSSL) {
- return new (C) FieldDecl(Decl::Field, DC, L, Id, T, DInfo, BW, Mutable, TSSL);
+ DeclaratorInfo *DInfo, Expr *BW, bool Mutable) {
+ return new (C) FieldDecl(Decl::Field, DC, L, Id, T, DInfo, BW, Mutable);
}
bool FieldDecl::isAnonymousStructOrUnion() const {
@@ -317,13 +314,23 @@ NamedDecl *NamedDecl::getUnderlyingDecl() {
}
//===----------------------------------------------------------------------===//
+// DeclaratorDecl Implementation
+//===----------------------------------------------------------------------===//
+
+SourceLocation DeclaratorDecl::getTypeSpecStartLoc() const {
+ if (DeclInfo)
+ return DeclInfo->getTypeLoc().getTypeSpecRange().getBegin();
+ return SourceLocation();
+}
+
+//===----------------------------------------------------------------------===//
// VarDecl Implementation
//===----------------------------------------------------------------------===//
VarDecl *VarDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L,
IdentifierInfo *Id, QualType T, DeclaratorInfo *DInfo,
- StorageClass S, SourceLocation TypeSpecStartLoc) {
- return new (C) VarDecl(Var, DC, L, Id, T, DInfo, S, TypeSpecStartLoc);
+ StorageClass S) {
+ return new (C) VarDecl(Var, DC, L, Id, T, DInfo, S);
}
void VarDecl::Destroy(ASTContext& C) {