diff options
author | Abramo Bagnara <abramo.bagnara@gmail.com> | 2011-03-08 08:55:46 +0000 |
---|---|---|
committer | Abramo Bagnara <abramo.bagnara@gmail.com> | 2011-03-08 08:55:46 +0000 |
commit | ff676cb48fe8bf7be2feaa251dc7c5fb15af4730 (patch) | |
tree | 980c79f4bb390f3c84823e06a04ef25f6a3ff27f /lib/AST/Decl.cpp | |
parent | 36784e78bcce1dbaf35f94a655394e348b4d9ac7 (diff) |
Fixed source range for all DeclaratorDecl's.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127225 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r-- | lib/AST/Decl.cpp | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 0fd2c26db3..95f5756402 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -1017,10 +1017,11 @@ const char *VarDecl::getStorageClassSpecifierString(StorageClass SC) { return 0; } -VarDecl *VarDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L, +VarDecl *VarDecl::Create(ASTContext &C, DeclContext *DC, + SourceLocation StartL, SourceLocation IdL, IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, StorageClass S, StorageClass SCAsWritten) { - return new (C) VarDecl(Var, DC, L, Id, T, TInfo, S, SCAsWritten); + return new (C) VarDecl(Var, DC, StartL, IdL, Id, T, TInfo, S, SCAsWritten); } void VarDecl::setStorageClass(StorageClass SC) { @@ -1031,13 +1032,6 @@ void VarDecl::setStorageClass(StorageClass SC) { SClass = SC; } -SourceLocation VarDecl::getInnerLocStart() const { - SourceLocation Start = getTypeSpecStartLoc(); - if (Start.isInvalid()) - Start = getLocation(); - return Start; -} - SourceRange VarDecl::getSourceRange() const { if (getInit()) return SourceRange(getOuterLocStart(), getInit()->getLocEnd()); @@ -1257,11 +1251,12 @@ void VarDecl::setTemplateSpecializationKind(TemplateSpecializationKind TSK, //===----------------------------------------------------------------------===// ParmVarDecl *ParmVarDecl::Create(ASTContext &C, DeclContext *DC, - SourceLocation L, IdentifierInfo *Id, + SourceLocation StartLoc, + SourceLocation IdLoc, IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, StorageClass S, StorageClass SCAsWritten, Expr *DefArg) { - return new (C) ParmVarDecl(ParmVar, DC, L, Id, T, TInfo, + return new (C) ParmVarDecl(ParmVar, DC, StartLoc, IdLoc, Id, T, TInfo, S, SCAsWritten, DefArg); } @@ -1937,9 +1932,11 @@ bool FunctionDecl::isOutOfLine() const { //===----------------------------------------------------------------------===// FieldDecl *FieldDecl::Create(const ASTContext &C, DeclContext *DC, - SourceLocation L, IdentifierInfo *Id, QualType T, + SourceLocation StartLoc, SourceLocation IdLoc, + IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, Expr *BW, bool Mutable) { - return new (C) FieldDecl(Decl::Field, DC, L, Id, T, TInfo, BW, Mutable); + return new (C) FieldDecl(Decl::Field, DC, StartLoc, IdLoc, Id, T, TInfo, + BW, Mutable); } bool FieldDecl::isAnonymousStructOrUnion() const { @@ -2230,20 +2227,22 @@ NamespaceDecl *NamespaceDecl::getNextNamespace() { } ImplicitParamDecl *ImplicitParamDecl::Create(ASTContext &C, DeclContext *DC, - SourceLocation loc, - IdentifierInfo *name, - QualType type) { - return new (C) ImplicitParamDecl(DC, loc, name, type); + SourceLocation IdLoc, + IdentifierInfo *Id, + QualType Type) { + return new (C) ImplicitParamDecl(DC, IdLoc, Id, Type); } FunctionDecl *FunctionDecl::Create(ASTContext &C, DeclContext *DC, + SourceLocation StartLoc, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, - StorageClass S, StorageClass SCAsWritten, + StorageClass SC, StorageClass SCAsWritten, bool isInlineSpecified, bool hasWrittenPrototype) { - FunctionDecl *New = new (C) FunctionDecl(Function, DC, NameInfo, T, TInfo, - S, SCAsWritten, isInlineSpecified); + FunctionDecl *New = new (C) FunctionDecl(Function, DC, StartLoc, NameInfo, + T, TInfo, SC, SCAsWritten, + isInlineSpecified); New->HasWrittenPrototype = hasWrittenPrototype; return New; } |