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/DeclTemplate.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/DeclTemplate.cpp')
-rw-r--r-- | lib/AST/DeclTemplate.cpp | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/lib/AST/DeclTemplate.cpp b/lib/AST/DeclTemplate.cpp index 78782bc5c7..6fd4d7ec07 100644 --- a/lib/AST/DeclTemplate.cpp +++ b/lib/AST/DeclTemplate.cpp @@ -456,14 +456,16 @@ unsigned TemplateTypeParmDecl::getIndex() const { //===----------------------------------------------------------------------===// NonTypeTemplateParmDecl::NonTypeTemplateParmDecl(DeclContext *DC, - SourceLocation L, unsigned D, - unsigned P, IdentifierInfo *Id, + SourceLocation StartLoc, + SourceLocation IdLoc, + unsigned D, unsigned P, + IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, const QualType *ExpandedTypes, unsigned NumExpandedTypes, TypeSourceInfo **ExpandedTInfos) - : DeclaratorDecl(NonTypeTemplateParm, DC, L, Id, T, TInfo), + : DeclaratorDecl(NonTypeTemplateParm, DC, IdLoc, Id, T, TInfo, StartLoc), TemplateParmPosition(D, P), DefaultArgumentAndInherited(0, false), ParameterPack(true), ExpandedParameterPack(true), NumExpandedTypes(NumExpandedTypes) @@ -479,16 +481,18 @@ NonTypeTemplateParmDecl::NonTypeTemplateParmDecl(DeclContext *DC, NonTypeTemplateParmDecl * NonTypeTemplateParmDecl::Create(const ASTContext &C, DeclContext *DC, - SourceLocation L, unsigned D, unsigned P, - IdentifierInfo *Id, QualType T, - bool ParameterPack, TypeSourceInfo *TInfo) { - return new (C) NonTypeTemplateParmDecl(DC, L, D, P, Id, T, ParameterPack, - TInfo); + SourceLocation StartLoc, SourceLocation IdLoc, + unsigned D, unsigned P, IdentifierInfo *Id, + QualType T, bool ParameterPack, + TypeSourceInfo *TInfo) { + return new (C) NonTypeTemplateParmDecl(DC, StartLoc, IdLoc, D, P, Id, + T, ParameterPack, TInfo); } NonTypeTemplateParmDecl * NonTypeTemplateParmDecl::Create(const ASTContext &C, DeclContext *DC, - SourceLocation L, unsigned D, unsigned P, + SourceLocation StartLoc, SourceLocation IdLoc, + unsigned D, unsigned P, IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, const QualType *ExpandedTypes, @@ -497,18 +501,12 @@ NonTypeTemplateParmDecl::Create(const ASTContext &C, DeclContext *DC, unsigned Size = sizeof(NonTypeTemplateParmDecl) + NumExpandedTypes * 2 * sizeof(void*); void *Mem = C.Allocate(Size); - return new (Mem) NonTypeTemplateParmDecl(DC, L, D, P, Id, T, TInfo, + return new (Mem) NonTypeTemplateParmDecl(DC, StartLoc, IdLoc, + D, P, Id, T, TInfo, ExpandedTypes, NumExpandedTypes, ExpandedTInfos); } -SourceLocation NonTypeTemplateParmDecl::getInnerLocStart() const { - SourceLocation Start = getTypeSpecStartLoc(); - if (Start.isInvalid()) - Start = getLocation(); - return Start; -} - SourceRange NonTypeTemplateParmDecl::getSourceRange() const { SourceLocation End = getLocation(); if (hasDefaultArgument() && !defaultArgumentWasInherited()) |