diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-02-25 02:25:35 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-02-25 02:25:35 +0000 |
commit | c22b5fff39a7520207f165fb16a27a34b944bd9c (patch) | |
tree | c79ab64b51bd9c1b5fe807aa689003dc23d2f128 /lib/AST/Decl.cpp | |
parent | 7decebfc7b9dc841f228c93cc2e41e3e62911ff8 (diff) |
Use NestedNameSpecifierLoc within out-of-line variables, function, and
tag definitions. Also, add support for template instantiation of
NestedNameSpecifierLocs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126470 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r-- | lib/AST/Decl.cpp | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index ccc883e944..d7e389e616 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -935,9 +935,8 @@ SourceLocation DeclaratorDecl::getTypeSpecStartLoc() const { return SourceLocation(); } -void DeclaratorDecl::setQualifierInfo(NestedNameSpecifier *Qualifier, - SourceRange QualifierRange) { - if (Qualifier) { +void DeclaratorDecl::setQualifierInfo(NestedNameSpecifierLoc QualifierLoc) { + if (QualifierLoc) { // Make sure the extended decl info is allocated. if (!hasExtInfo()) { // Save (non-extended) type source info pointer. @@ -948,12 +947,10 @@ void DeclaratorDecl::setQualifierInfo(NestedNameSpecifier *Qualifier, getExtInfo()->TInfo = savedTInfo; } // Set qualifier info. - getExtInfo()->NNS = Qualifier; - getExtInfo()->NNSRange = QualifierRange; + getExtInfo()->QualifierLoc = QualifierLoc; } else { // Here Qualifier == 0, i.e., we are removing the qualifier (if any). - assert(QualifierRange.isInvalid()); if (hasExtInfo()) { // Save type source info pointer. TypeSourceInfo *savedTInfo = getExtInfo()->TInfo; @@ -975,7 +972,7 @@ QualifierInfo::setTemplateParameterListsInfo(ASTContext &Context, TemplateParameterList **TPLists) { assert((NumTPLists == 0 || TPLists != 0) && "Empty array of template parameters with positive size!"); - assert((NumTPLists == 0 || NNS) && + assert((NumTPLists == 0 || QualifierLoc) && "Nonempty array of template parameters with no qualifier!"); // Free previous template parameters (if any). @@ -2027,19 +2024,16 @@ TagDecl* TagDecl::getDefinition() const { return 0; } -void TagDecl::setQualifierInfo(NestedNameSpecifier *Qualifier, - SourceRange QualifierRange) { - if (Qualifier) { +void TagDecl::setQualifierInfo(NestedNameSpecifierLoc QualifierLoc) { + if (QualifierLoc) { // Make sure the extended qualifier info is allocated. if (!hasExtInfo()) TypedefDeclOrQualifier = new (getASTContext()) ExtInfo; // Set qualifier info. - getExtInfo()->NNS = Qualifier; - getExtInfo()->NNSRange = QualifierRange; + getExtInfo()->QualifierLoc = QualifierLoc; } else { // Here Qualifier == 0, i.e., we are removing the qualifier (if any). - assert(QualifierRange.isInvalid()); if (hasExtInfo()) { getASTContext().Deallocate(getExtInfo()); TypedefDeclOrQualifier = (TypedefDecl*) 0; |