aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/clang/AST/ASTImporter.h9
-rw-r--r--include/clang/AST/Decl.h44
-rw-r--r--include/clang/AST/NestedNameSpecifier.h12
-rw-r--r--include/clang/Sema/DeclSpec.h2
-rw-r--r--include/clang/Sema/Sema.h5
5 files changed, 54 insertions, 18 deletions
diff --git a/include/clang/AST/ASTImporter.h b/include/clang/AST/ASTImporter.h
index b659ce74bb..e1535965b1 100644
--- a/include/clang/AST/ASTImporter.h
+++ b/include/clang/AST/ASTImporter.h
@@ -145,7 +145,14 @@ namespace clang {
/// \returns the equivalent nested-name-specifier in the "to"
/// context, or NULL if an error occurred.
NestedNameSpecifier *Import(NestedNameSpecifier *FromNNS);
-
+
+ /// \brief Import the given nested-name-specifier from the "from"
+ /// context into the "to" context.
+ ///
+ /// \returns the equivalent nested-name-specifier in the "to"
+ /// context.
+ NestedNameSpecifierLoc Import(NestedNameSpecifierLoc FromNNS);
+
/// \brief Import the goven template name from the "from" context into the
/// "to" context.
TemplateName Import(TemplateName From);
diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h
index 1d5d0fe68b..ec379c3707 100644
--- a/include/clang/AST/Decl.h
+++ b/include/clang/AST/Decl.h
@@ -475,10 +475,7 @@ public:
/// QualifierInfo - A struct with extended info about a syntactic
/// name qualifier, to be used for the case of out-of-line declarations.
struct QualifierInfo {
- /// NNS - The syntactic name qualifier.
- NestedNameSpecifier *NNS;
- /// NNSRange - The source range for the qualifier.
- SourceRange NNSRange;
+ NestedNameSpecifierLoc QualifierLoc;
/// NumTemplParamLists - The number of template parameter lists
/// that were matched against the template-ids occurring into the NNS.
unsigned NumTemplParamLists;
@@ -487,8 +484,7 @@ struct QualifierInfo {
TemplateParameterList** TemplParamLists;
/// Default constructor.
- QualifierInfo()
- : NNS(0), NNSRange(), NumTemplParamLists(0), TemplParamLists(0) {}
+ QualifierInfo() : QualifierLoc(), NumTemplParamLists(0), TemplParamLists(0) {}
/// setTemplateParameterListsInfo - Sets info about matched template
/// parameter lists.
void setTemplateParameterListsInfo(ASTContext &Context,
@@ -545,14 +541,22 @@ public:
return SourceRange(getOuterLocStart(), getLocation());
}
+ /// \brief Retrieve the nested-name-specifier that qualifies the name of this
+ /// declaration, if it was present in the source.
NestedNameSpecifier *getQualifier() const {
- return hasExtInfo() ? getExtInfo()->NNS : 0;
+ return hasExtInfo() ? getExtInfo()->QualifierLoc.getNestedNameSpecifier()
+ : 0;
}
- SourceRange getQualifierRange() const {
- return hasExtInfo() ? getExtInfo()->NNSRange : SourceRange();
+
+ /// \brief Retrieve the nested-name-specifier (with source-location
+ /// information) that qualifies the name of this declaration, if it was
+ /// present in the source.
+ NestedNameSpecifierLoc getQualifierLoc() const {
+ return hasExtInfo() ? getExtInfo()->QualifierLoc
+ : NestedNameSpecifierLoc();
}
- void setQualifierInfo(NestedNameSpecifier *Qualifier,
- SourceRange QualifierRange);
+
+ void setQualifierInfo(NestedNameSpecifierLoc QualifierLoc);
unsigned getNumTemplateParameterLists() const {
return hasExtInfo() ? getExtInfo()->NumTemplParamLists : 0;
@@ -2140,14 +2144,22 @@ public:
void setTypedefForAnonDecl(TypedefDecl *TDD);
+ /// \brief Retrieve the nested-name-specifier that qualifies the name of this
+ /// declaration, if it was present in the source.
NestedNameSpecifier *getQualifier() const {
- return hasExtInfo() ? getExtInfo()->NNS : 0;
+ return hasExtInfo() ? getExtInfo()->QualifierLoc.getNestedNameSpecifier()
+ : 0;
}
- SourceRange getQualifierRange() const {
- return hasExtInfo() ? getExtInfo()->NNSRange : SourceRange();
+
+ /// \brief Retrieve the nested-name-specifier (with source-location
+ /// information) that qualifies the name of this declaration, if it was
+ /// present in the source.
+ NestedNameSpecifierLoc getQualifierLoc() const {
+ return hasExtInfo() ? getExtInfo()->QualifierLoc
+ : NestedNameSpecifierLoc();
}
- void setQualifierInfo(NestedNameSpecifier *Qualifier,
- SourceRange QualifierRange);
+
+ void setQualifierInfo(NestedNameSpecifierLoc QualifierLoc);
unsigned getNumTemplateParameterLists() const {
return hasExtInfo() ? getExtInfo()->NumTemplParamLists : 0;
diff --git a/include/clang/AST/NestedNameSpecifier.h b/include/clang/AST/NestedNameSpecifier.h
index 2803f51951..5e9adfccc4 100644
--- a/include/clang/AST/NestedNameSpecifier.h
+++ b/include/clang/AST/NestedNameSpecifier.h
@@ -268,6 +268,18 @@ public:
return getSourceRange().getEnd();
}
+ /// \brief Retrieve the location of the beginning of this
+ /// component of the nested-name-specifier.
+ SourceLocation getLocalBeginLoc() const {
+ return getLocalSourceRange().getBegin();
+ }
+
+ /// \brief Retrieve the location of the end of this component of the
+ /// nested-name-specifier.
+ SourceLocation getLocalEndLoc() const {
+ return getLocalSourceRange().getEnd();
+ }
+
/// \brief Return the prefix of this nested-name-specifier.
///
/// For example, if this instance refers to a nested-name-specifier
diff --git a/include/clang/Sema/DeclSpec.h b/include/clang/Sema/DeclSpec.h
index 9386d35873..64126bd4d8 100644
--- a/include/clang/Sema/DeclSpec.h
+++ b/include/clang/Sema/DeclSpec.h
@@ -168,7 +168,7 @@ public:
///
/// \param Context The context into which this nested-name-specifier will be
/// copied.
- NestedNameSpecifierLoc getWithLocInContext(ASTContext &Context);
+ NestedNameSpecifierLoc getWithLocInContext(ASTContext &Context) const;
/// No scope specifier.
bool isEmpty() const { return !Range.isValid(); }
diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h
index 8573f1dbfc..a93739892c 100644
--- a/include/clang/Sema/Sema.h
+++ b/include/clang/Sema/Sema.h
@@ -4293,6 +4293,11 @@ public:
SubstNestedNameSpecifier(NestedNameSpecifier *NNS,
SourceRange Range,
const MultiLevelTemplateArgumentList &TemplateArgs);
+
+ NestedNameSpecifierLoc
+ SubstNestedNameSpecifierLoc(NestedNameSpecifierLoc NNS,
+ const MultiLevelTemplateArgumentList &TemplateArgs);
+
DeclarationNameInfo
SubstDeclarationNameInfo(const DeclarationNameInfo &NameInfo,
const MultiLevelTemplateArgumentList &TemplateArgs);