22#ifndef LLVM_CLANG_SEMA_DECLSPEC_H
23#define LLVM_CLANG_SEMA_DECLSPEC_H
35#include "llvm/ADT/STLExtras.h"
36#include "llvm/ADT/SmallVector.h"
37#include "llvm/Support/Compiler.h"
38#include "llvm/Support/ErrorHandling.h"
47 class NamespaceAliasDecl;
52 struct TemplateIdAnnotation;
88 TemplateParamLists = L;
91 return TemplateParamLists;
96 return Builder.getRepresentation();
219 assert(R.
isValid() &&
"Must have a valid source range");
220 if (
Range.getBegin().isInvalid())
315#define TRANSFORM_TYPE_TRAIT_DEF(_, Trait) \
316 static const TST TST_##Trait = clang::TST_##Trait;
317#include "clang/Basic/TransformTypeTraits.def"
322#define GENERIC_IMAGE_TYPE(ImgType, Id) \
323 static const TST TST_##ImgType##_t = clang::TST_##ImgType##_t;
324#include "clang/Basic/OpenCLImageTypes.def"
325#define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId) \
326 static const TST TST_##Name = clang::TST_##Name;
327#include "clang/Basic/HLSLIntangibleTypes.def"
357 LLVM_PREFERRED_TYPE(
SCS)
358 unsigned StorageClassSpec : 3;
359 LLVM_PREFERRED_TYPE(
TSCS)
360 unsigned ThreadStorageClassSpec : 2;
361 LLVM_PREFERRED_TYPE(
bool)
362 unsigned SCS_extern_in_linkage_spec : 1;
366 unsigned TypeSpecWidth : 2;
367 LLVM_PREFERRED_TYPE(
TSC)
368 unsigned TypeSpecComplex : 2;
370 unsigned TypeSpecSign : 2;
371 LLVM_PREFERRED_TYPE(
TST)
372 unsigned TypeSpecType : 7;
373 LLVM_PREFERRED_TYPE(
bool)
374 unsigned TypeAltiVecVector : 1;
375 LLVM_PREFERRED_TYPE(
bool)
376 unsigned TypeAltiVecPixel : 1;
377 LLVM_PREFERRED_TYPE(
bool)
378 unsigned TypeAltiVecBool : 1;
379 LLVM_PREFERRED_TYPE(
bool)
380 unsigned TypeSpecOwned : 1;
381 LLVM_PREFERRED_TYPE(
bool)
382 unsigned TypeSpecPipe : 1;
383 LLVM_PREFERRED_TYPE(
bool)
384 unsigned TypeSpecSat : 1;
385 LLVM_PREFERRED_TYPE(
bool)
386 unsigned ConstrainedAuto : 1;
389 LLVM_PREFERRED_TYPE(
TQ)
390 unsigned TypeQualifiers : 5;
393 LLVM_PREFERRED_TYPE(
bool)
394 unsigned FS_inline_specified : 1;
395 LLVM_PREFERRED_TYPE(
bool)
396 unsigned FS_forceinline_specified: 1;
397 LLVM_PREFERRED_TYPE(
bool)
398 unsigned FS_virtual_specified : 1;
399 LLVM_PREFERRED_TYPE(
bool)
400 unsigned FS_noreturn_specified : 1;
403 LLVM_PREFERRED_TYPE(
bool)
404 unsigned FriendSpecifiedFirst : 1;
408 unsigned ConstexprSpecifier : 2;
433 SourceLocation TSCLoc, TSSLoc, TSTLoc, AltiVecLoc, TSSatLoc, EllipsisLoc;
440 SourceLocation TQ_constLoc, TQ_restrictLoc, TQ_volatileLoc, TQ_atomicLoc,
442 SourceLocation FS_inlineLoc, FS_virtualLoc, FS_explicitLoc, FS_noreturnLoc;
449 void SaveWrittenBuiltinSpecs();
458 static bool isExprRep(
TST T) {
462 static bool isTemplateIdRep(
TST T) {
466 DeclSpec(
const DeclSpec &) =
delete;
467 void operator=(
const DeclSpec &) =
delete;
475 constexpr std::array<TST, 16> Traits = {
476#define TRANSFORM_TYPE_TRAIT_DEF(_, Trait) TST_##Trait,
477#include "clang/Basic/TransformTypeTraits.def"
480 return T >= Traits.front() &&
T <= Traits.back();
486 SCS_extern_in_linkage_spec(
false),
494 FS_forceinline_specified(
false), FS_virtual_specified(
false),
495 FS_noreturn_specified(
false), FriendSpecifiedFirst(
false),
498 Attrs(attrFactory), writtenBS(), ObjCQualifiers(nullptr) {}
503 return (
TSCS)ThreadStorageClassSpec;
507 SCS_extern_in_linkage_spec =
Value;
512 return ThreadStorageClassSpecLoc;
518 SCS_extern_in_linkage_spec =
false;
525 TypeSpecOwned =
false;
548 assert(
isTypeRep((
TST) TypeSpecType) &&
"DeclSpec does not store a type");
552 assert(
isDeclRep((
TST) TypeSpecType) &&
"DeclSpec does not store a decl");
556 assert(isExprRep((
TST) TypeSpecType) &&
"DeclSpec does not store an expr");
562 "DeclSpec is not a pack indexing expr");
567 assert(isTemplateIdRep((
TST) TypeSpecType) &&
568 "DeclSpec does not store a template id");
588 isExprRep((
TST)TypeSpecType));
638 return FS_inline_specified | FS_forceinline_specified;
641 return FS_inline_specified ? FS_inlineLoc : FS_forceinlineLoc;
645 return FS_explicit_specifier;
656 return FS_explicit_specifier.
getExpr()
657 ?
SourceRange(FS_explicitLoc, FS_explicitCloseParenLoc)
665 FS_inline_specified =
false;
667 FS_forceinline_specified =
false;
669 FS_virtual_specified =
false;
674 FS_noreturn_specified =
false;
722 const char *&PrevSpec,
unsigned &DiagID,
725 const char *&PrevSpec,
unsigned &DiagID);
727 const char *&PrevSpec,
unsigned &DiagID,
732 const char *&PrevSpec,
unsigned &DiagID);
746 unsigned &DiagID,
Decl *Rep,
bool Owned,
754 unsigned &DiagID,
Decl *Rep,
bool Owned,
761 unsigned &DiagID,
Expr *Rep,
764 const char *&PrevSpec,
unsigned &DiagID,
767 const char *&PrevSpec,
unsigned &DiagID,
770 const char *&PrevSpec,
unsigned &DiagID,
773 const char *&PrevSpec,
unsigned &DiagID,
776 const char *&PrevSpec,
unsigned &DiagID,
793 assert(isExprRep((
TST) TypeSpecType));
819 const char *&PrevSpec,
unsigned &DiagID);
921 PropertyAttributes(ObjCPropertyAttribute::kind_noattr), Nullability(0),
922 GetterName(nullptr), SetterName(nullptr) {}
946 "Objective-C declspec doesn't have nullability");
954 "Objective-C declspec doesn't have nullability");
955 return NullabilityLoc;
962 "Set the nullability declspec or property attribute first");
963 Nullability =
static_cast<unsigned>(kind);
964 NullabilityLoc = loc;
987 unsigned objcDeclQualifier : 7;
992 unsigned Nullability : 2;
1311 LLVM_PREFERRED_TYPE(
bool)
1315 LLVM_PREFERRED_TYPE(
bool)
1347 std::unique_ptr<CachedTokens> DefArgTokens =
nullptr)
1361 LLVM_PREFERRED_TYPE(
bool)
1367 LLVM_PREFERRED_TYPE(
bool)
1371 LLVM_PREFERRED_TYPE(
bool)
1376 LLVM_PREFERRED_TYPE(
bool)
1384 LLVM_PREFERRED_TYPE(
bool)
1389 LLVM_PREFERRED_TYPE(
bool)
1468 for (
unsigned I = 0; I <
NumParams; ++I)
1469 Params[I].DefaultArgTokens.reset();
1627 Scope().~CXXScopeSpec();
1699 bool isStatic,
bool isStar,
Expr *NumElts,
1717 ParamInfo *Params,
unsigned NumParams,
1720 bool RefQualifierIsLvalueRef,
1727 unsigned NumExceptions,
1738 DeclSpec *MethodQualifiers =
nullptr);
1806 unsigned NumBindings : 31;
1807 LLVM_PREFERRED_TYPE(
bool)
1808 unsigned DeleteBindings : 1;
1814 :
Bindings(nullptr), NumBindings(0), DeleteBindings(
false) {}
1828 DeleteBindings =
false;
1924 LLVM_PREFERRED_TYPE(
bool)
1925 unsigned InvalidType : 1;
1928 LLVM_PREFERRED_TYPE(
bool)
1929 unsigned GroupingParens : 1;
1936 unsigned FunctionDefinition : 2;
1939 LLVM_PREFERRED_TYPE(
bool)
1940 unsigned Redeclaration : 1;
1943 LLVM_PREFERRED_TYPE(
bool)
1944 unsigned Extension : 1;
1947 LLVM_PREFERRED_TYPE(
bool)
1948 unsigned ObjCIvar : 1;
1951 LLVM_PREFERRED_TYPE(
bool)
1952 unsigned ObjCWeakProperty : 1;
1955 LLVM_PREFERRED_TYPE(
bool)
1956 unsigned InlineStorageUsed : 1;
1959 LLVM_PREFERRED_TYPE(
bool)
1960 unsigned HasInitializer : 1;
1974 Expr *TrailingRequiresClause;
2029 GroupingParens(
false), FunctionDefinition(static_cast<
unsigned>(
2032 ObjCWeakProperty(
false), InlineStorageUsed(
false),
2034 DeclarationAttrs(DeclarationAttrs), AsmLabel(nullptr),
2035 TrailingRequiresClause(nullptr),
2036 InventedTemplateParameterList(nullptr) {
2037 assert(llvm::all_of(DeclarationAttrs,
2042 "DeclarationAttrs may only contain [[]] and keyword attributes");
2072 return BindingGroup;
2093 if (!
Loc.isInvalid())
2098 if (!
Loc.isInvalid())
2106 if (
Range.getBegin().isInvalid())
2117 BindingGroup.
clear();
2119 for (
unsigned i = 0, e = DeclTypeInfo.size(); i != e; ++i)
2120 DeclTypeInfo[i].destroy();
2121 DeclTypeInfo.clear();
2124 InlineStorageUsed =
false;
2125 HasInitializer =
false;
2127 ObjCWeakProperty =
false;
2170 llvm_unreachable(
"unknown context kind!");
2210 llvm_unreachable(
"unknown context kind!");
2254 llvm_unreachable(
"unknown context kind!");
2311 llvm_unreachable(
"unknown context kind!");
2330 return BindingGroup.
isSet();
2335 return Name.Identifier;
2343 Name.setIdentifier(
Id, IdLoc);
2358 DeclTypeInfo.push_back(TI);
2359 DeclTypeInfo.back().getAttrs().addAll(attrs.begin(), attrs.end());
2372 DeclTypeInfo.push_back(TI);
2382 DeclTypeInfo.push_back(TI);
2385 "Cannot add a declarator chunk with attributes with this overload");
2393 DeclTypeInfo.insert(DeclTypeInfo.begin(), TI);
2402 assert(i < DeclTypeInfo.size() &&
"Invalid type chunk");
2403 return DeclTypeInfo[i];
2406 assert(i < DeclTypeInfo.size() &&
"Invalid type chunk");
2407 return DeclTypeInfo[i];
2419 assert(!DeclTypeInfo.empty() &&
"No type chunks to drop.");
2420 DeclTypeInfo.front().destroy();
2421 DeclTypeInfo.erase(DeclTypeInfo.begin());
2428 for (
unsigned i = 0, i_end = DeclTypeInfo.size(); i < i_end; ++i) {
2429 if (!DeclTypeInfo[i].isParen())
2430 return &DeclTypeInfo[i];
2439 for (
unsigned i = DeclTypeInfo.size(), i_end = 0; i != i_end; --i) {
2440 if (!DeclTypeInfo[i-1].isParen())
2441 return &DeclTypeInfo[i-1];
2460 for (
unsigned i = 0, i_end = DeclTypeInfo.size(); i < i_end; ++i) {
2461 switch (DeclTypeInfo[i].
Kind) {
2475 llvm_unreachable(
"Invalid type chunk");
2494 return DeclTypeInfo[index].Fun;
2550 llvm_unreachable(
"unknown context kind!");
2593 llvm_unreachable(
"unknown context kind!");
2614 Chunk.Fun.hasTrailingReturnType())
2623 Chunk.Fun.hasTrailingReturnType())
2624 return Chunk.Fun.getTrailingReturnType();
2630 TrailingRequiresClause = TRC;
2637 return TrailingRequiresClause;
2643 return TrailingRequiresClause !=
nullptr;
2648 TemplateParameterLists = TPLs;
2653 return TemplateParameterLists;
2660 InventedTemplateParameterList = Invented;
2667 return InventedTemplateParameterList;
2690 return DeclarationAttrs;
2737 FunctionDefinition =
static_cast<unsigned>(Val);
2798 const char *&PrevSpec);
2819 unsigned Specifiers = 0;
2878 InitCaptureType, ExplicitRange));
enum clang::sema::@1658::IndirectLocalPathEntry::EntryKind Kind
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
Defines the ExceptionSpecificationType enumeration and various utility functions.
Defines several types used to describe C++ lambda expressions that are shared between the parser and ...
Defines an enumeration for C++ overloaded operators.
llvm::SmallVector< std::pair< const MemRegion *, SVal >, 4 > Bindings
Defines various enumerations that describe declaration and type specifiers.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
The result of parsing/analyzing an expression, statement etc.
bool isRegularKeywordAttribute() const
bool isStandardAttributeSyntax() const
The attribute is spelled [[]] in either C or C++ mode, including standard attributes spelled with a k...
A factory, from which one makes pools, from which one creates individual attributes which are dealloc...
void takeFrom(ParsedAttributesView &List, AttributePool &Pool)
Removes the attributes from List, which are owned by Pool, and adds them at the end of this Attribute...
void takeAllFrom(AttributePool &pool)
Take the given pool's allocations and add them to this pool.
Represents a C++ struct/union/class.
Represents a C++ nested-name-specifier or a global scope specifier.
bool isNotEmpty() const
A scope specifier is present, but may be valid or invalid.
char * location_data() const
Retrieve the data associated with the source-location information.
bool isValid() const
A scope specifier is present, and it refers to a real scope.
void MakeTrivial(ASTContext &Context, NestedNameSpecifier *Qualifier, SourceRange R)
Make a new nested-name-specifier from incomplete source-location information.
SourceLocation getLastQualifierNameLoc() const
Retrieve the location of the name in the last qualifier in this nested name specifier.
SourceLocation getEndLoc() const
void setRange(SourceRange R)
void setBeginLoc(SourceLocation Loc)
SourceRange getRange() const
void MakeGlobal(ASTContext &Context, SourceLocation ColonColonLoc)
Turn this (empty) nested-name-specifier into the global nested-name-specifier '::'.
SourceLocation getBeginLoc() const
bool isSet() const
Deprecated.
ArrayRef< TemplateParameterList * > getTemplateParamLists() const
void setEndLoc(SourceLocation Loc)
NestedNameSpecifierLoc getWithLocInContext(ASTContext &Context) const
Retrieve a nested-name-specifier with location information, copied into the given AST context.
NestedNameSpecifier * getScopeRep() const
Retrieve the representation of the nested-name-specifier.
void SetInvalid(SourceRange R)
Indicate that this nested-name-specifier is invalid.
unsigned location_size() const
Retrieve the size of the data associated with source-location information.
void MakeSuper(ASTContext &Context, CXXRecordDecl *RD, SourceLocation SuperLoc, SourceLocation ColonColonLoc)
Turns this (empty) nested-name-specifier into '__super' nested-name-specifier.
bool isInvalid() const
An error occurred during parsing of the scope specifier.
void setTemplateParamLists(ArrayRef< TemplateParameterList * > L)
bool isEmpty() const
No scope specifier.
void Adopt(NestedNameSpecifierLoc Other)
Adopt an existing nested-name-specifier (with source-range information).
Captures information about "declaration specifiers".
bool isVirtualSpecified() const
bool setFunctionSpecExplicit(SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID, ExplicitSpecifier ExplicitSpec, SourceLocation CloseParenLoc)
const WrittenBuiltinSpecs & getWrittenBuiltinSpecs() const
bool isTypeSpecPipe() const
bool isModulePrivateSpecified() const
static const TSCS TSCS___thread
void UpdateDeclRep(Decl *Rep)
static const TST TST_typeof_unqualType
SourceLocation getTypeSpecSignLoc() const
void setTypeArgumentRange(SourceRange range)
bool SetTypePipe(bool isPipe, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID, const PrintingPolicy &Policy)
SourceLocation getPipeLoc() const
bool hasAutoTypeSpec() const
static const TST TST_typename
SourceLocation getEndLoc() const LLVM_READONLY
bool hasTypeSpecifier() const
Return true if any type-specifier has been found.
bool SetStorageClassSpec(Sema &S, SCS SC, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID, const PrintingPolicy &Policy)
These methods set the specified attribute of the DeclSpec and return false if there was no error.
const ParsedAttributes & getAttributes() const
ThreadStorageClassSpecifier TSCS
void setObjCQualifiers(ObjCDeclSpec *quals)
static const TST TST_char8
static const TST TST_BFloat16
Expr * getPackIndexingExpr() const
void ClearStorageClassSpecs()
bool SetConstexprSpec(ConstexprSpecKind ConstexprKind, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
static const TSCS TSCS__Thread_local
bool SetTypeSpecWidth(TypeSpecifierWidth W, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID, const PrintingPolicy &Policy)
These methods set the specified attribute of the DeclSpec, but return true and ignore the request if ...
bool isNoreturnSpecified() const
TST getTypeSpecType() const
SourceLocation getStorageClassSpecLoc() const
SCS getStorageClassSpec() const
bool setModulePrivateSpec(SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
bool SetTypeSpecType(TST T, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID, const PrintingPolicy &Policy)
SourceLocation getBeginLoc() const LLVM_READONLY
bool isTypeSpecSat() const
bool SetTypeSpecSat(SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
SourceRange getSourceRange() const LLVM_READONLY
void SetPackIndexingExpr(SourceLocation EllipsisLoc, Expr *Pack)
bool SetStorageClassSpecThread(TSCS TSC, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
void SetRangeEnd(SourceLocation Loc)
ObjCDeclSpec * getObjCQualifiers() const
bool SetBitIntType(SourceLocation KWLoc, Expr *BitWidth, const char *&PrevSpec, unsigned &DiagID, const PrintingPolicy &Policy)
static const TST TST_auto_type
static const TST TST_interface
static const TST TST_double
static const TST TST_typeofExpr
unsigned getTypeQualifiers() const
getTypeQualifiers - Return a set of TQs.
void SetRangeStart(SourceLocation Loc)
bool SetTypeAltiVecPixel(bool isAltiVecPixel, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID, const PrintingPolicy &Policy)
bool SetFriendSpec(SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
SourceLocation getNoreturnSpecLoc() const
TemplateIdAnnotation * getRepAsTemplateId() const
bool isExternInLinkageSpec() const
const CXXScopeSpec & getTypeSpecScope() const
static const TST TST_union
static const TST TST_typename_pack_indexing
static const TST TST_char
static const TST TST_bool
static const TST TST_char16
SCS
storage-class-specifier
SourceLocation getExplicitSpecLoc() const
static const TST TST_unknown_anytype
SourceLocation getAltiVecLoc() const
SourceLocation getFriendSpecLoc() const
TSC getTypeSpecComplex() const
SourceLocation getModulePrivateSpecLoc() const
void forEachCVRUQualifier(llvm::function_ref< void(TQ, StringRef, SourceLocation)> Handle)
This method calls the passed in handler on each CVRU qual being set.
bool SetTypeSpecComplex(TSC C, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
bool isMissingDeclaratorOk()
Checks if this DeclSpec can stand alone, without a Declarator.
ParsedType getRepAsType() const
void UpdateTypeRep(ParsedType Rep)
TSCS getThreadStorageClassSpec() const
bool isFriendSpecifiedFirst() const
bool setFunctionSpecNoreturn(SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
bool hasAttributes() const
static const TST TST_accum
static const TST TST_half
ParsedAttributes & getAttributes()
SourceLocation getEllipsisLoc() const
bool isTypeAltiVecPixel() const
void ClearTypeQualifiers()
Clear out all of the type qualifiers.
SourceLocation getConstSpecLoc() const
SourceRange getExplicitSpecRange() const
static const TST TST_ibm128
DeclSpec(AttributeFactory &attrFactory)
Expr * getRepAsExpr() const
void addAttributes(const ParsedAttributesView &AL)
Concatenates two attribute lists.
static const TST TST_enum
bool SetTypeAltiVecBool(bool isAltiVecBool, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID, const PrintingPolicy &Policy)
AttributePool & getAttributePool() const
static const TST TST_float128
static const TST TST_decltype
SourceRange getTypeSpecWidthRange() const
SourceLocation getTypeSpecTypeNameLoc() const
static bool isDeclRep(TST T)
void Finish(Sema &S, const PrintingPolicy &Policy)
Finish - This does final analysis of the declspec, issuing diagnostics for things like "_Complex" (la...
bool isInlineSpecified() const
SourceLocation getTypeSpecWidthLoc() const
SourceLocation getRestrictSpecLoc() const
static const TST TST_typeof_unqualExpr
static const TST TST_class
bool hasTagDefinition() const
static const TST TST_decimal64
unsigned getParsedSpecifiers() const
Return a bitmask of which flavors of specifiers this DeclSpec includes.
bool isTypeAltiVecBool() const
void ClearFunctionSpecs()
bool isConstrainedAuto() const
bool SetTypeQual(TQ T, SourceLocation Loc)
static const TST TST_wchar
SourceLocation getTypeSpecComplexLoc() const
static const TST TST_void
static const TSCS TSCS_unspecified
bool isTypeAltiVecVector() const
static const TST TST_bitint
void ClearConstexprSpec()
static const char * getSpecifierName(DeclSpec::TST T, const PrintingPolicy &Policy)
Turn a type-specifier-type into a string like "_Bool" or "union".
static const TST TST_float
static const TST TST_atomic
static const TST TST_fract
SourceLocation getThreadStorageClassSpecLoc() const
Decl * getRepAsDecl() const
static const TST TST_float16
static bool isTransformTypeTrait(TST T)
static const TST TST_unspecified
SourceLocation getAtomicSpecLoc() const
SourceLocation getVirtualSpecLoc() const
TypeSpecifierSign getTypeSpecSign() const
SourceLocation getConstexprSpecLoc() const
CXXScopeSpec & getTypeSpecScope()
bool isEmpty() const
isEmpty - Return true if this declaration specifier is completely empty: no tokens were parsed in the...
SourceLocation getTypeSpecTypeLoc() const
void UpdateExprRep(Expr *Rep)
bool SetTypeSpecType(TST T, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID, TypeResult Rep, const PrintingPolicy &Policy)
static const TST TST_decltype_auto
static const TSCS TSCS_thread_local
void setExternInLinkageSpec(bool Value)
static const TST TST_error
void forEachQualifier(llvm::function_ref< void(TQ, StringRef, SourceLocation)> Handle)
This method calls the passed in handler on each qual being set.
bool setFunctionSpecVirtual(SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
static const TST TST_decimal32
bool SetTypeAltiVecVector(bool isAltiVecVector, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID, const PrintingPolicy &Policy)
TypeSpecifierWidth getTypeSpecWidth() const
ExplicitSpecifier getExplicitSpecifier() const
static const TST TST_char32
bool setFunctionSpecInline(SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
static const TST TST_decimal128
bool isTypeSpecOwned() const
SourceLocation getTypeSpecSatLoc() const
SourceRange getTypeofParensRange() const
SourceLocation getInlineSpecLoc() const
SourceLocation getUnalignedSpecLoc() const
static const TST TST_int128
SourceLocation getVolatileSpecLoc() const
FriendSpecified isFriendSpecified() const
bool hasExplicitSpecifier() const
bool setFunctionSpecForceInline(SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
bool hasConstexprSpecifier() const
void takeAttributesFrom(ParsedAttributes &attrs)
static const TST TST_typeofType
TemplateIdAnnotation * TemplateIdRep
bool SetTypeSpecSign(TypeSpecifierSign S, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
static const TST TST_auto
ParsedSpecifiers
ParsedSpecifiers - Flags to query which specifiers were applied.
@ PQ_StorageClassSpecifier
ConstexprSpecKind getConstexprSpecifier() const
static const TST TST_struct
Decl - This represents one declaration (or definition), e.g.
Information about one declarator, including the parsed type information and the identifier.
DeclaratorChunk & getTypeObject(unsigned i)
bool isFunctionDeclarator(unsigned &idx) const
isFunctionDeclarator - This method returns true if the declarator is a function declarator (looking t...
bool isPastIdentifier() const
isPastIdentifier - Return true if we have parsed beyond the point where the name would appear.
bool isArrayOfUnknownBound() const
isArrayOfUnknownBound - This method returns true if the declarator is a declarator for an array of un...
bool isDeclarationOfFunction() const
Determine whether the declaration that will be produced from this declaration will be a function.
void SetRangeBegin(SourceLocation Loc)
SetRangeBegin - Set the start of the source range to Loc, unless it's invalid.
const DeclaratorChunk & getTypeObject(unsigned i) const
Return the specified TypeInfo from this declarator.
bool hasAttributes() const
hasAttributes - do we contain any attributes?
void setCommaLoc(SourceLocation CL)
bool hasPackIndexing() const
const DeclSpec & getDeclSpec() const
getDeclSpec - Return the declaration-specifier that this declarator was declared with.
SmallVectorImpl< DeclaratorChunk >::const_iterator type_object_iterator
const DeclaratorChunk * getInnermostNonParenChunk() const
Return the innermost (closest to the declarator) chunk of this declarator that is not a parens chunk,...
void AddTypeInfo(const DeclaratorChunk &TI, AttributePool &OtherPool, SourceLocation EndLoc)
AddTypeInfo - Add a chunk to this declarator.
Expr * getAsmLabel() const
void AddInnermostTypeInfo(const DeclaratorChunk &TI)
Add a new innermost chunk to this declarator.
bool isFunctionDeclarationContext() const
Return true if this declaration appears in a context where a function declarator would be a function ...
FunctionDefinitionKind getFunctionDefinitionKind() const
const ParsedAttributes & getAttributes() const
void setRedeclaration(bool Val)
bool isObjCWeakProperty() const
SourceLocation getIdentifierLoc() const
void SetIdentifier(const IdentifierInfo *Id, SourceLocation IdLoc)
Set the name of this declarator to be the given identifier.
bool mayOmitIdentifier() const
mayOmitIdentifier - Return true if the identifier is either optional or not allowed.
bool isFunctionDeclarator() const
isFunctionDeclarator - Once this declarator is fully parsed and formed, this method returns true if t...
bool hasTrailingReturnType() const
Determine whether a trailing return type was written (at any level) within this declarator.
SourceLocation getEndLoc() const LLVM_READONLY
void setObjCIvar(bool Val=true)
bool mayBeFollowedByCXXDirectInit() const
mayBeFollowedByCXXDirectInit - Return true if the declarator can be followed by a C++ direct initiali...
Expr * getTrailingRequiresClause()
Sets a trailing requires clause for this declarator.
bool isExpressionContext() const
Determine whether this declaration appears in a context where an expression could appear.
Expr * getPackIndexingExpr() const
type_object_range type_objects() const
Returns the range of type objects, from the identifier outwards.
bool hasGroupingParens() const
void setDecompositionBindings(SourceLocation LSquareLoc, MutableArrayRef< DecompositionDeclarator::Binding > Bindings, SourceLocation RSquareLoc)
Set the decomposition bindings for this declarator.
void setInvalidType(bool Val=true)
void DropFirstTypeObject()
TemplateParameterList * getInventedTemplateParameterList() const
The template parameter list generated from the explicit template parameters along with any invented t...
void SetSourceRange(SourceRange R)
unsigned getNumTypeObjects() const
Return the number of types applied to this declarator.
bool mayHaveIdentifier() const
mayHaveIdentifier - Return true if the identifier is either optional or required.
void setGroupingParens(bool flag)
const DeclaratorChunk * getOutermostNonParenChunk() const
Return the outermost (furthest from the declarator) chunk of this declarator that is not a parens chu...
bool isRedeclaration() const
DeclaratorChunk::ParamInfo InlineParams[16]
InlineParams - This is a local array used for the first function decl chunk to avoid going to the hea...
const ParsedAttributesView & getDeclarationAttributes() const
Declarator(const DeclSpec &DS, const ParsedAttributesView &DeclarationAttrs, DeclaratorContext C)
DS and DeclarationAttrs must outlive the Declarator.
SourceLocation getEllipsisLoc() const
DeclaratorContext getContext() const
const DecompositionDeclarator & getDecompositionDeclarator() const
SourceLocation getBeginLoc() const LLVM_READONLY
bool isCtorOrDtor()
Returns true if this declares a constructor or a destructor.
bool isFunctionDefinition() const
void setTrailingRequiresClause(Expr *TRC)
Sets a trailing requires clause for this declarator.
void setHasInitializer(bool Val=true)
UnqualifiedId & getName()
Retrieve the name specified by this declarator.
void setTemplateParameterLists(ArrayRef< TemplateParameterList * > TPLs)
Sets the template parameter lists that preceded the declarator.
bool isFirstDeclarator() const
bool hasTrailingRequiresClause() const
Determine whether a trailing requires clause was written in this declarator.
bool hasInitializer() const
SourceLocation getCommaLoc() const
void setFunctionDefinitionKind(FunctionDefinitionKind Val)
AttributePool & getAttributePool() const
const CXXScopeSpec & getCXXScopeSpec() const
getCXXScopeSpec - Return the C++ scope specifier (global scope or nested-name-specifier) that is part...
void takeAttributes(ParsedAttributes &attrs)
takeAttributes - Takes attributes from the given parsed-attributes set and add them to this declarato...
bool hasName() const
hasName - Whether this declarator has a name, which might be an identifier (accessible via getIdentif...
ArrayRef< TemplateParameterList * > getTemplateParameterLists() const
The template parameter lists that preceded the declarator.
bool isFunctionDeclaratorAFunctionDeclaration() const
Return true if a function declarator at this position would be a function declaration.
ParsedType getTrailingReturnType() const
Get the trailing return type appearing (at any level) within this declarator.
void setInventedTemplateParameterList(TemplateParameterList *Invented)
Sets the template parameter list generated from the explicit template parameters along with any inven...
void clear()
Reset the contents of this Declarator.
void AddTypeInfo(const DeclaratorChunk &TI, SourceLocation EndLoc)
AddTypeInfo - Add a chunk to this declarator.
ParsedAttributes & getAttributes()
void setAsmLabel(Expr *E)
void AddTypeInfo(const DeclaratorChunk &TI, ParsedAttributes &&attrs, SourceLocation EndLoc)
AddTypeInfo - Add a chunk to this declarator.
CXXScopeSpec & getCXXScopeSpec()
void ExtendWithDeclSpec(const DeclSpec &DS)
ExtendWithDeclSpec - Extend the declarator source range to include the given declspec,...
void SetRangeEnd(SourceLocation Loc)
SetRangeEnd - Set the end of the source range to Loc, unless it's invalid.
void setExtension(bool Val=true)
bool mayHaveDecompositionDeclarator() const
Return true if the context permits a C++17 decomposition declarator.
bool isInvalidType() const
bool isExplicitObjectMemberFunction()
SourceRange getSourceRange() const LLVM_READONLY
Get the source range that spans this declarator.
void setObjCWeakProperty(bool Val=true)
bool isDecompositionDeclarator() const
Return whether this declarator is a decomposition declarator.
bool isFirstDeclarationOfMember()
Returns true if this declares a real member and not a friend.
bool isPrototypeContext() const
llvm::iterator_range< type_object_iterator > type_object_range
bool isStaticMember()
Returns true if this declares a static member.
DecompositionDeclarator::Binding InlineBindings[16]
void setPackIndexingExpr(Expr *PI)
bool getExtension() const
const DeclaratorChunk::FunctionTypeInfo & getFunctionTypeInfo() const
getFunctionTypeInfo - Retrieves the function type info object (looking through parentheses).
DeclSpec & getMutableDeclSpec()
getMutableDeclSpec - Return a non-const version of the DeclSpec.
DeclaratorChunk::FunctionTypeInfo & getFunctionTypeInfo()
getFunctionTypeInfo - Retrieves the function type info object (looking through parentheses).
void setEllipsisLoc(SourceLocation EL)
const IdentifierInfo * getIdentifier() const
A parsed C++17 decomposition declarator of the form '[' identifier-list ']'.
~DecompositionDeclarator()
DecompositionDeclarator & operator=(const DecompositionDeclarator &G)=delete
ArrayRef< Binding > bindings() const
SourceRange getSourceRange() const
DecompositionDeclarator()
SourceLocation getLSquareLoc() const
DecompositionDeclarator(const DecompositionDeclarator &G)=delete
SourceLocation getRSquareLoc() const
Store information needed for an explicit specifier.
const Expr * getExpr() const
bool isSpecified() const
Determine if the declaration had an explicit specifier of any kind.
This represents one expression.
One of these records is kept for each identifier that is lexed.
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
This represents a decl that may have a name.
Represents a C++ namespace alias.
Represent a C++ namespace.
Class that aids in the construction of nested-name-specifiers along with source-location information ...
A C++ nested-name-specifier augmented with source location information.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
Captures information about "declaration specifiers" specific to Objective-C.
void setObjCDeclQualifier(ObjCDeclQualifier DQVal)
ObjCPropertyAttribute::Kind getPropertyAttributes() const
IdentifierInfo * getSetterName()
void clearObjCDeclQualifier(ObjCDeclQualifier DQVal)
ObjCDeclQualifier
ObjCDeclQualifier - Qualifier used on types in method declarations.
void setSetterName(IdentifierInfo *name, SourceLocation loc)
const IdentifierInfo * getSetterName() const
ObjCDeclQualifier getObjCDeclQualifier() const
SourceLocation getGetterNameLoc() const
SourceLocation getNullabilityLoc() const
NullabilityKind getNullability() const
SourceLocation getSetterNameLoc() const
void setGetterName(IdentifierInfo *name, SourceLocation loc)
void setNullability(SourceLocation loc, NullabilityKind kind)
const IdentifierInfo * getGetterName() const
void setPropertyAttributes(ObjCPropertyAttribute::Kind PRVal)
IdentifierInfo * getGetterName()
ParsedAttr - Represents a syntactic attribute.
void addAll(iterator B, iterator E)
ParsedAttributes - A collection of parsed attributes.
AttributePool & getPool() const
void takeAllFrom(ParsedAttributes &Other)
C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...
Scope - A scope is a transient data structure that is used while parsing the program.
Sema - This implements semantic analysis and AST building for C.
Encodes a location in the source.
bool isValid() const
Return true if this is a valid SourceLocation object.
A trivial tuple used to represent a source range.
SourceLocation getEnd() const
SourceLocation getBegin() const
SourceLocation getEndLoc() const LLVM_READONLY
Represents a C++ template name within the type system.
Stores a list of template parameters for a TemplateDecl and its derived classes.
Base wrapper for a particular "section" of type source info.
Represents a C++ unqualified-id that has been parsed.
struct OFI OperatorFunctionId
When Kind == IK_OperatorFunctionId, the overloaded operator that we parsed.
UnionParsedType ConversionFunctionId
When Kind == IK_ConversionFunctionId, the type that the conversion function names.
void setLiteralOperatorId(const IdentifierInfo *Id, SourceLocation OpLoc, SourceLocation IdLoc)
Specific that this unqualified-id was parsed as a literal-operator-id.
SourceLocation getBeginLoc() const LLVM_READONLY
void setIdentifier(const IdentifierInfo *Id, SourceLocation IdLoc)
Specify that this unqualified-id was parsed as an identifier.
UnionParsedType ConstructorName
When Kind == IK_ConstructorName, the class-name of the type whose constructor is being referenced.
SourceLocation EndLocation
The location of the last token that describes this unqualified-id.
void setOperatorFunctionId(SourceLocation OperatorLoc, OverloadedOperatorKind Op, SourceLocation SymbolLocations[3])
Specify that this unqualified-id was parsed as an operator-function-id.
bool isValid() const
Determine whether this unqualified-id refers to a valid name.
void setImplicitSelfParam(const IdentifierInfo *Id)
Specify that this unqualified-id is an implicit 'self' parameter.
bool isInvalid() const
Determine whether this unqualified-id refers to an invalid name.
void setDeductionGuideName(ParsedTemplateTy Template, SourceLocation TemplateLoc)
Specify that this unqualified-id was parsed as a template-name for a deduction-guide.
SourceRange getSourceRange() const LLVM_READONLY
Return the source range that covers this unqualified-id.
void setConversionFunctionId(SourceLocation OperatorLoc, ParsedType Ty, SourceLocation EndLoc)
Specify that this unqualified-id was parsed as a conversion-function-id.
void setDestructorName(SourceLocation TildeLoc, ParsedType ClassType, SourceLocation EndLoc)
Specify that this unqualified-id was parsed as a destructor name.
void setTemplateId(TemplateIdAnnotation *TemplateId)
Specify that this unqualified-id was parsed as a template-id.
SourceLocation getEndLoc() const LLVM_READONLY
UnionParsedType DestructorName
When Kind == IK_DestructorName, the type referred to by the class-name.
void setConstructorTemplateId(TemplateIdAnnotation *TemplateId)
Specify that this unqualified-id was parsed as a template-id that names a constructor.
SourceLocation StartLocation
The location of the first token that describes this unqualified-id, which will be the location of the...
void setConstructorName(ParsedType ClassType, SourceLocation ClassNameLoc, SourceLocation EndLoc)
Specify that this unqualified-id was parsed as a constructor name.
UnionParsedTemplateTy TemplateName
When Kind == IK_DeductionGuideName, the parsed template-name.
const IdentifierInfo * Identifier
When Kind == IK_Identifier, the parsed identifier, or when Kind == IK_UserLiteralId,...
void clear()
Clear out this unqualified-id, setting it to default (invalid) state.
UnqualifiedIdKind getKind() const
Determine what kind of name we have.
TemplateIdAnnotation * TemplateId
When Kind == IK_TemplateId or IK_ConstructorTemplateId, the template-id annotation that contains the ...
Represents a C++11 virt-specifier-seq.
SourceLocation getOverrideLoc() const
Specifier getLastSpecifier() const
SourceLocation getFirstLocation() const
SourceLocation getLastLocation() const
SourceLocation getAbstractLoc() const
bool isOverrideSpecified() const
SourceLocation getFinalLoc() const
bool isFinalSpecified() const
bool isFinalSpelledSealed() const
static const char * getSpecifierName(Specifier VS)
bool SetSpecifier(Specifier VS, SourceLocation Loc, const char *&PrevSpec)
@ kind_nullability
Indicates that the nullability of the type was spelled with a property attribute rather than a type q...
@ Extend
Lifetime-extend along this path.
The JSON file list parser is used to communicate input to InstallAPI.
TypeSpecifierType
Specifies the kind of type.
@ TST_typename_pack_indexing
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
FunctionDefinitionKind
Described the kind of function definition (if any) provided for a function.
ConstexprSpecKind
Define the kind of constexpr specifier.
NullabilityKind
Describes the nullability of a particular type.
LambdaCaptureKind
The different capture forms in a lambda introducer.
UnqualifiedIdKind
Describes the kind of unqualified-id parsed.
@ IK_DeductionGuideName
A deduction-guide name (a template-name)
@ IK_ImplicitSelfParam
An implicit 'self' parameter.
@ IK_TemplateId
A template-id, e.g., f<int>.
@ IK_ConstructorTemplateId
A constructor named via a template-id.
@ IK_ConstructorName
A constructor name.
@ IK_LiteralOperatorId
A user-defined literal name, e.g., operator "" _i.
@ IK_Identifier
An identifier.
@ IK_DestructorName
A destructor name.
@ IK_OperatorFunctionId
An overloaded operator name, e.g., operator+.
@ IK_ConversionFunctionId
A conversion function name, e.g., operator int.
ThreadStorageClassSpecifier
Thread storage-class-specifier.
@ TSCS_thread_local
C++11 thread_local.
@ TSCS__Thread_local
C11 _Thread_local.
@ TSCS___thread
GNU __thread.
@ CopyInit
[a = b], [a = {b}]
TypeSpecifierWidth
Specifies the width of a type, e.g., short, long, or long long.
ActionResult< ParsedType > TypeResult
TypeSpecifierSign
Specifies the signedness of a type, e.g., signed or unsigned.
LambdaCaptureDefault
The default, if any, capture method for a lambda expression.
OpaquePtr< QualType > ParsedType
An opaque type for threading parsed type information through the parser.
const FunctionProtoType * T
SmallVector< Token, 4 > CachedTokens
A set of tokens that has been cached for later parsing.
@ NumObjCPropertyAttrsBits
Number of bits fitting all the property attributes.
@ Other
Other implicit parameter.
ExceptionSpecificationType
The various types of exception specifications that exist in C++11.
@ EST_Unparsed
not parsed yet
@ EST_None
no exception specification
@ EST_Dynamic
throw(T1, T2)
unsigned isStar
True if this dimension was [*]. In this case, NumElts is null.
unsigned TypeQuals
The type qualifiers for the array: const/volatile/restrict/__unaligned/_Atomic.
unsigned hasStatic
True if this dimension included the 'static' keyword.
Expr * NumElts
This is the size of the array, or null if [] or [*] was specified.
unsigned TypeQuals
For now, sema will catch these as invalid.
SourceLocation getConstQualifierLoc() const
Retrieve the location of the 'const' qualifier.
unsigned isVariadic
isVariadic - If this function has a prototype, and if that proto ends with ',...)',...
SourceLocation getTrailingReturnTypeLoc() const
Get the trailing-return-type location for this function declarator.
SourceLocation getLParenLoc() const
CachedTokens * ExceptionSpecTokens
Pointer to the cached tokens for an exception-specification that has not yet been parsed.
SourceLocation MutableLoc
The location of the 'mutable' qualifer in a lambda-declarator, if any.
SourceLocation getRestrictQualifierLoc() const
Retrieve the location of the 'restrict' qualifier.
bool hasTrailingReturnType() const
Determine whether this function declarator had a trailing-return-type.
UnionParsedType TrailingReturnType
If HasTrailingReturnType is true, this is the trailing return type specified.
TypeAndRange * Exceptions
Pointer to a new[]'d array of TypeAndRange objects that contain the types in the function's dynamic e...
ParamInfo * Params
Params - This is a pointer to a new[]'d array of ParamInfo objects that describe the parameters speci...
ParsedType getTrailingReturnType() const
Get the trailing-return-type for this function declarator.
unsigned RefQualifierIsLValueRef
Whether the ref-qualifier (if any) is an lvalue reference.
SourceLocation getExceptionSpecLocBeg() const
NamedDecl ** DeclsInPrototype
Pointer to a new[]'d array of declarations that need to be available for lookup inside the function b...
AttributeFactory * QualAttrFactory
AttributeFactory for the MethodQualifiers.
SourceLocation ExceptionSpecLocEnd
The end location of the exception specification, if any.
SourceLocation EllipsisLoc
When isVariadic is true, the location of the ellipsis in the source.
ArrayRef< NamedDecl * > getDeclsInPrototype() const
Get the non-parameter decls defined within this function prototype.
unsigned DeleteParams
DeleteParams - If this is true, we need to delete[] Params.
DeclSpec * MethodQualifiers
DeclSpec for the function with the qualifier related info.
SourceLocation getRefQualifierLoc() const
Retrieve the location of the ref-qualifier, if any.
unsigned NumExceptionsOrDecls
NumExceptionsOrDecls - This is the number of types in the dynamic-exception-decl, if the function has...
SourceLocation getRParenLoc() const
SourceLocation RefQualifierLoc
The location of the ref-qualifier, if any.
SourceLocation getExceptionSpecLocEnd() const
SourceLocation getVolatileQualifierLoc() const
Retrieve the location of the 'volatile' qualifier.
SourceLocation getEllipsisLoc() const
SourceLocation RParenLoc
The location of the right parenthesis in the source.
unsigned NumParams
NumParams - This is the number of formal parameters specified by the declarator.
unsigned getNumExceptions() const
Get the number of dynamic exception specifications.
bool hasMutableQualifier() const
Determine whether this lambda-declarator contains a 'mutable' qualifier.
bool isKNRPrototype() const
isKNRPrototype - Return true if this is a K&R style identifier list, like "void foo(a,...
bool hasMethodTypeQualifiers() const
Determine whether this method has qualifiers.
unsigned HasTrailingReturnType
HasTrailingReturnType - If this is true, a trailing return type was specified.
unsigned isAmbiguous
Can this declaration be a constructor-style initializer?
DeclSpec & getOrCreateMethodQualifiers()
void freeParams()
Reset the parameter list to having zero parameters.
unsigned hasPrototype
hasPrototype - This is true if the function had at least one typed parameter.
bool hasRefQualifier() const
Determine whether this function declaration contains a ref-qualifier.
SourceRange getExceptionSpecRange() const
SourceLocation getMutableLoc() const
Retrieve the location of the 'mutable' qualifier, if any.
SourceLocation LParenLoc
The location of the left parenthesis in the source.
unsigned ExceptionSpecType
ExceptionSpecType - An ExceptionSpecificationType value.
SourceLocation ExceptionSpecLocBeg
The beginning location of the exception specification, if any.
ExceptionSpecificationType getExceptionSpecType() const
Get the type of exception specification this function has.
SourceLocation TrailingReturnTypeLoc
If HasTrailingReturnType is true, this is the location of the trailing return type.
Expr * NoexceptExpr
Pointer to the expression in the noexcept-specifier of this function, if it has one.
const CXXScopeSpec & Scope() const
unsigned TypeQuals
The type qualifiers: const/volatile/restrict/__unaligned/_Atomic.
SourceLocation StarLoc
Location of the '*' token.
char ScopeMem[sizeof(CXXScopeSpec)]
ParamInfo - An array of paraminfo objects is allocated whenever a function declarator is parsed.
std::unique_ptr< CachedTokens > DefaultArgTokens
DefaultArgTokens - When the parameter's default argument cannot be parsed immediately (because it occ...
const IdentifierInfo * Ident
ParamInfo(const IdentifierInfo *ident, SourceLocation iloc, Decl *param, std::unique_ptr< CachedTokens > DefArgTokens=nullptr)
unsigned AccessWrites
The access writes.
SourceLocation RestrictQualLoc
The location of the restrict-qualifier, if any.
SourceLocation ConstQualLoc
The location of the const-qualifier, if any.
SourceLocation VolatileQualLoc
The location of the volatile-qualifier, if any.
SourceLocation UnalignedQualLoc
The location of the __unaligned-qualifier, if any.
unsigned TypeQuals
The type qualifiers: const/volatile/restrict/unaligned/atomic.
SourceLocation AtomicQualLoc
The location of the _Atomic-qualifier, if any.
bool LValueRef
True if this is an lvalue reference, false if it's an rvalue reference.
bool HasRestrict
The type qualifier: restrict. [GNU] C++ extension.
One instance of this struct is used for each type in a declarator that is parsed.
SourceRange getSourceRange() const
const ParsedAttributesView & getAttrs() const
If there are attributes applied to this declaratorchunk, return them.
static DeclaratorChunk getBlockPointer(unsigned TypeQuals, SourceLocation Loc)
Return a DeclaratorChunk for a block.
SourceLocation EndLoc
EndLoc - If valid, the place where this chunck ends.
static DeclaratorChunk getFunction(bool HasProto, bool IsAmbiguous, SourceLocation LParenLoc, ParamInfo *Params, unsigned NumParams, SourceLocation EllipsisLoc, SourceLocation RParenLoc, bool RefQualifierIsLvalueRef, SourceLocation RefQualifierLoc, SourceLocation MutableLoc, ExceptionSpecificationType ESpecType, SourceRange ESpecRange, ParsedType *Exceptions, SourceRange *ExceptionRanges, unsigned NumExceptions, Expr *NoexceptExpr, CachedTokens *ExceptionSpecTokens, ArrayRef< NamedDecl * > DeclsInPrototype, SourceLocation LocalRangeBegin, SourceLocation LocalRangeEnd, Declarator &TheDeclarator, TypeResult TrailingReturnType=TypeResult(), SourceLocation TrailingReturnTypeLoc=SourceLocation(), DeclSpec *MethodQualifiers=nullptr)
DeclaratorChunk::getFunction - Return a DeclaratorChunk for a function.
static DeclaratorChunk getPipe(unsigned TypeQuals, SourceLocation Loc)
Return a DeclaratorChunk for a block.
ParsedAttributesView & getAttrs()
enum clang::DeclaratorChunk::@223 Kind
MemberPointerTypeInfo Mem
static DeclaratorChunk getArray(unsigned TypeQuals, bool isStatic, bool isStar, Expr *NumElts, SourceLocation LBLoc, SourceLocation RBLoc)
Return a DeclaratorChunk for an array.
SourceLocation Loc
Loc - The place where this type was defined.
ParsedAttributesView AttrList
static DeclaratorChunk getMemberPointer(const CXXScopeSpec &SS, unsigned TypeQuals, SourceLocation StarLoc, SourceLocation EndLoc)
static DeclaratorChunk getParen(SourceLocation LParenLoc, SourceLocation RParenLoc)
Return a DeclaratorChunk for a paren.
static DeclaratorChunk getPointer(unsigned TypeQuals, SourceLocation Loc, SourceLocation ConstQualLoc, SourceLocation VolatileQualLoc, SourceLocation RestrictQualLoc, SourceLocation AtomicQualLoc, SourceLocation UnalignedQualLoc)
Return a DeclaratorChunk for a pointer.
static DeclaratorChunk getReference(unsigned TypeQuals, SourceLocation Loc, bool lvalue)
Return a DeclaratorChunk for a reference.
std::optional< ParsedAttributes > Attrs