15 #ifndef LLVM_CLANG_AST_NESTEDNAMESPECIFIER_H 16 #define LLVM_CLANG_AST_NESTEDNAMESPECIFIER_H 20 #include "llvm/ADT/FoldingSet.h" 21 #include "llvm/ADT/PointerIntPair.h" 22 #include "llvm/Support/Compiler.h" 33 class NamespaceAliasDecl;
35 struct PrintingPolicy;
51 enum StoredSpecifierKind {
55 StoredTypeSpecWithTemplate = 3
64 llvm::PointerIntPair<NestedNameSpecifier *, 2, StoredSpecifierKind> Prefix;
73 void* Specifier =
nullptr;
141 bool Template,
const Type *
T);
176 if (Prefix.getInt() == StoredIdentifier)
196 if (Prefix.getInt() == StoredTypeSpec ||
197 Prefix.getInt() == StoredTypeSpecWithTemplate)
198 return (
const Type *)Specifier;
220 ID.AddPointer(Prefix.getOpaqueValue());
221 ID.AddPointer(Specifier);
234 void *Data =
nullptr;
251 : Qualifier(Qualifier), Data(Data) {}
255 explicit operator bool()
const {
return Qualifier; }
301 return getLocalSourceRange().
getBegin();
307 return getLocalSourceRange().
getEnd();
333 return X.Qualifier == Y.Qualifier && X.Data == Y.Data;
356 char *Buffer =
nullptr;
360 unsigned BufferSize = 0;
364 unsigned BufferCapacity = 0;
495 Representation =
nullptr;
505 return std::make_pair(Buffer, BufferSize);
520 #endif // LLVM_CLANG_AST_NESTEDNAMESPECIFIER_H
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range covering the entirety of this nested-name-specifier.
Microsoft's '__super' specifier, stored as a CXXRecordDecl* of the class it appeared in...
friend bool operator!=(NestedNameSpecifierLoc X, NestedNameSpecifierLoc Y)
NestedNameSpecifier * getPrefix() const
Return the prefix of this nested name specifier.
const DiagnosticBuilder & operator<<(const DiagnosticBuilder &DB, const Attr *At)
The base class of the type hierarchy.
NestedNameSpecifierLoc getTemporary() const
Retrieve a nested-name-specifier with location information based on the information in this builder...
NamespaceDecl - Represent a C++ namespace.
void Profile(llvm::FoldingSetNodeID &ID) const
SourceLocation getLocalBeginLoc() const
Retrieve the location of the beginning of this component of the nested-name-specifier.
NestedNameSpecifier & operator=(const NestedNameSpecifier &)=delete
An identifier, stored as an IdentifierInfo*.
std::pair< char *, unsigned > getBuffer() const
Retrieve the underlying buffer.
static NestedNameSpecifier * Create(const ASTContext &Context, NestedNameSpecifier *Prefix, IdentifierInfo *II)
Builds a specifier combining a prefix and an identifier.
A namespace, stored as a NamespaceDecl*.
Describes how types, statements, expressions, and declarations should be printed. ...
SpecifierKind getKind() const
Determine what kind of nested name specifier is stored.
bool hasQualifier() const
Evalutes true when this nested-name-specifier location is empty.
Base wrapper for a particular "section" of type source info.
void AddTaggedVal(intptr_t V, DiagnosticsEngine::ArgumentKind Kind) const
One of these records is kept for each identifier that is lexed.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
A C++ nested-name-specifier augmented with source location information.
const Type * getAsType() const
Retrieve the type stored in this nested name specifier.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
friend bool operator==(NestedNameSpecifierLoc X, NestedNameSpecifierLoc Y)
CXXRecordDecl * getAsRecordDecl() const
Retrieve the record declaration stored in this nested name specifier.
IdentifierInfo * getAsIdentifier() const
Retrieve the identifier stored in this nested name specifier.
NamespaceAliasDecl * getAsNamespaceAlias() const
Retrieve the namespace alias stored in this nested name specifier.
Defines the Diagnostic-related interfaces.
SourceLocation getLocalEndLoc() const
Retrieve the location of the end of this component of the nested-name-specifier.
Class that aids in the construction of nested-name-specifiers along with source-location information ...
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range covered by this nested-name-specifier.
bool isInstantiationDependent() const
Whether this nested name specifier involves a template parameter.
A little helper class used to produce diagnostics.
void print(raw_ostream &OS, const PrintingPolicy &Policy) const
Print this nested name specifier to the given output stream.
static NestedNameSpecifier * SuperSpecifier(const ASTContext &Context, CXXRecordDecl *RD)
Returns the nested name specifier representing the __super scope for the given CXXRecordDecl.
NamespaceDecl * getAsNamespace() const
Retrieve the namespace stored in this nested name specifier.
const FunctionProtoType * T
SourceLocation getBeginLoc() const
Retrieve the location of the beginning of this nested-name-specifier.
NestedNameSpecifierLoc getPrefix() const
Return the prefix of this nested-name-specifier.
~NestedNameSpecifierLocBuilder()
A namespace alias, stored as a NamespaceAliasDecl*.
SourceLocation getEnd() const
Wraps an identifier and optional source location for the identifier.
A type, stored as a Type*.
The l-value was considered opaque, so the alignment was determined from a type.
SpecifierKind
The kind of specifier that completes this nested name specifier.
bool containsUnexpandedParameterPack() const
Whether this nested-name-specifier contains an unexpanded parameter pack (for C++11 variadic template...
Encodes a location in the source.
NestedNameSpecifier * getRepresentation() const
Retrieve the representation of the nested-name-specifier.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
NestedNameSpecifierLoc(NestedNameSpecifier *Qualifier, void *Data)
Construct a nested-name-specifier with source location information from.
Dataflow Directional Tag Classes.
NestedNameSpecifier * getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
unsigned getDataLength() const
Determines the data length for the entire nested-name-specifier.
bool isDependent() const
Whether this nested name specifier refers to a dependent type or not.
A type that was preceded by the 'template' keyword, stored as a Type*.
SourceLocation getEndLoc() const
Retrieve the location of the end of this nested-name-specifier.
X
Add a minimal nested name specifier fixit hint to allow lookup of a tag name from an outer enclosing ...
void * getOpaqueData() const
Retrieve the opaque pointer that refers to source-location data.
Defines the clang::SourceLocation class and associated facilities.
Represents a C++ struct/union/class.
A trivial tuple used to represent a source range.
Represents a C++ namespace alias.
The global specifier '::'. There is no stored value.
SourceLocation getBegin() const
void Clear()
Clear out this builder, and prepare it to build another nested-name-specifier with source-location in...
static NestedNameSpecifier * GlobalSpecifier(const ASTContext &Context)
Returns the nested name specifier representing the global scope.