25 #include "llvm/ADT/STLExtras.h"
26 #include "llvm/ADT/SmallString.h"
28 using namespace clang;
32 assert(TemplateId &&
"NULL template-id annotation?");
40 assert(TemplateId &&
"NULL template-id annotation?");
49 Builder.
Extend(Context, TemplateKWLoc, TL, ColonColonLoc);
52 Range.
setEnd(ColonColonLoc);
55 "NestedNameSpecifierLoc range computation incorrect");
61 Builder.
Extend(Context, Identifier, IdentifierLoc, ColonColonLoc);
65 Range.
setEnd(ColonColonLoc);
68 "NestedNameSpecifierLoc range computation incorrect");
74 Builder.
Extend(Context, Namespace, NamespaceLoc, ColonColonLoc);
78 Range.
setEnd(ColonColonLoc);
81 "NestedNameSpecifierLoc range computation incorrect");
87 Builder.
Extend(Context, Alias, AliasLoc, ColonColonLoc);
91 Range.
setEnd(ColonColonLoc);
94 "NestedNameSpecifierLoc range computation incorrect");
104 "NestedNameSpecifierLoc range computation incorrect");
110 Builder.
MakeSuper(Context, RD, SuperLoc, ColonColonLoc);
113 Range.
setEnd(ColonColonLoc);
116 "NestedNameSpecifierLoc range computation incorrect");
133 Builder.
Adopt(Other);
160 bool RefQualifierIsLvalueRef,
164 VolatileQualifierLoc,
166 RestrictQualifierLoc,
173 unsigned NumExceptions,
181 "function cannot have _Atomic qualifier");
185 I.
Loc = LocalRangeBegin;
214 assert(I.
Fun.
TypeQuals == TypeQuals &&
"bitfield overflow");
223 if (!TheDeclarator.InlineParamsUsed &&
224 NumParams <= llvm::array_lengthof(TheDeclarator.InlineParams)) {
225 I.
Fun.
Params = TheDeclarator.InlineParams;
227 TheDeclarator.InlineParamsUsed =
true;
232 memcpy(I.
Fun.
Params, Params,
sizeof(Params[0]) * NumParams);
243 for (
unsigned i = 0; i != NumExceptions; ++i) {
262 for (
unsigned i = 0, i_end = DeclTypeInfo.size(); i < i_end; ++i) {
263 switch (DeclTypeInfo[i].
Kind) {
276 llvm_unreachable(
"Invalid type chunk");
306 #define GENERIC_IMAGE_TYPE(ImgType, Id) case TST_##ImgType##_t:
307 #include "clang/Basic/OpenCLImageTypes.def"
318 return E->getType()->isFunctionType();
328 if (
const LocInfoType *LIT = dyn_cast<LocInfoType>(QT))
338 llvm_unreachable(
"Invalid TypeSpecType!");
346 getName().OperatorFunctionId.Operator));
357 return cast<TagDecl>(
getRepAsDecl())->isCompleteDefinition();
375 if (FS_inline_specified || FS_virtual_specified || FS_explicit_specified ||
376 FS_noreturn_specified || FS_forceinline_specified)
382 const char *&PrevSpec,
384 bool IsExtension =
true) {
387 DiagID = diag::err_invalid_decl_spec_combination;
389 DiagID = IsExtension ? diag::ext_duplicate_declspec :
390 diag::warn_duplicate_declspec;
405 llvm_unreachable(
"Unknown typespec!");
415 llvm_unreachable(
"Unknown typespec!");
425 llvm_unreachable(
"Unknown typespec!");
434 llvm_unreachable(
"Unknown typespec!");
444 llvm_unreachable(
"Unknown typespec!");
481 #define GENERIC_IMAGE_TYPE(ImgType, Id) \
482 case DeclSpec::TST_##ImgType##_t: \
483 return #ImgType "_t";
484 #include "clang/Basic/OpenCLImageTypes.def"
487 llvm_unreachable(
"Unknown typespec!");
499 llvm_unreachable(
"Unknown typespec!");
503 const char *&PrevSpec,
520 DiagID = diag::err_opencl_unknown_type_specifier;
527 DiagID = diag::err_opencl_unknown_type_specifier;
543 PrevSpec, DiagID, Policy);
544 assert(!isInvalid &&
"auto SCS -> TST recovery failed");
552 !(SCS_extern_in_linkage_spec &&
557 StorageClassSpec = SC;
558 StorageClassSpecLoc = Loc;
559 assert((
unsigned)SC == StorageClassSpec &&
"SCS constants overflow bitfield");
564 const char *&PrevSpec,
569 ThreadStorageClassSpec =
TSC;
570 ThreadStorageClassSpecLoc = Loc;
578 const char *&PrevSpec,
593 const char *&PrevSpec,
603 const char *&PrevSpec,
613 const char *&PrevSpec,
622 const char *&PrevSpec,
626 assert(
isTypeRep(T) &&
"T does not store a type");
627 assert(Rep &&
"no type provided!");
630 DiagID = diag::err_invalid_decl_spec_combination;
636 TSTNameLoc = TagNameLoc;
637 TypeSpecOwned =
false;
642 const char *&PrevSpec,
646 assert(isExprRep(T) &&
"T does not store an expr");
647 assert(Rep &&
"no expression provided!");
650 DiagID = diag::err_invalid_decl_spec_combination;
657 TypeSpecOwned =
false;
662 const char *&PrevSpec,
664 Decl *Rep,
bool Owned,
666 return SetTypeSpecType(T, Loc, Loc, PrevSpec, DiagID, Rep, Owned, Policy);
671 const char *&PrevSpec,
673 Decl *Rep,
bool Owned,
675 assert(
isDeclRep(T) &&
"T does not store a decl");
680 DiagID = diag::err_invalid_decl_spec_combination;
686 TSTNameLoc = TagNameLoc;
687 TypeSpecOwned = Owned && Rep !=
nullptr;
692 const char *&PrevSpec,
696 "rep required for these type-spec kinds!");
699 DiagID = diag::err_invalid_decl_spec_combination;
704 if (TypeAltiVecVector && (T ==
TST_bool) && !TypeAltiVecBool) {
705 TypeAltiVecBool =
true;
709 TypeSpecOwned =
false;
714 const char *&PrevSpec,
unsigned &DiagID,
718 DiagID = diag::err_invalid_vector_decl_spec_combination;
721 TypeAltiVecVector = isAltiVecVector;
727 const char *&PrevSpec,
unsigned &DiagID,
732 DiagID = diag::err_invalid_decl_spec_combination;
743 const char *&PrevSpec,
unsigned &DiagID,
745 if (!TypeAltiVecVector || TypeAltiVecPixel ||
748 DiagID = diag::err_invalid_pixel_decl_spec_combination;
751 TypeAltiVecPixel = isAltiVecPixel;
758 const char *&PrevSpec,
unsigned &DiagID,
760 if (!TypeAltiVecVector || TypeAltiVecBool ||
763 DiagID = diag::err_invalid_vector_bool_decl_spec;
766 TypeAltiVecBool = isAltiVecBool;
774 TypeSpecOwned =
false;
786 if (TypeQualifiers & T) {
787 bool IsExtension =
true;
790 return BadSpecifier(T, T, PrevSpec, DiagID, IsExtension);
796 case TQ_const: TQ_constLoc = Loc;
return false;
797 case TQ_restrict: TQ_restrictLoc = Loc;
return false;
798 case TQ_volatile: TQ_volatileLoc = Loc;
return false;
800 case TQ_atomic: TQ_atomicLoc = Loc;
return false;
803 llvm_unreachable(
"Unknown type qualifier!");
810 if (FS_inline_specified) {
811 DiagID = diag::warn_duplicate_declspec;
815 FS_inline_specified =
true;
822 if (FS_forceinline_specified) {
823 DiagID = diag::warn_duplicate_declspec;
824 PrevSpec =
"__forceinline";
827 FS_forceinline_specified =
true;
828 FS_forceinlineLoc = Loc;
833 const char *&PrevSpec,
837 if (FS_virtual_specified) {
838 DiagID = diag::warn_duplicate_declspec;
839 PrevSpec =
"virtual";
842 FS_virtual_specified =
true;
848 const char *&PrevSpec,
852 if (FS_explicit_specified) {
853 DiagID = diag::warn_duplicate_declspec;
854 PrevSpec =
"explicit";
857 FS_explicit_specified =
true;
858 FS_explicitLoc = Loc;
863 const char *&PrevSpec,
867 if (FS_noreturn_specified) {
868 DiagID = diag::warn_duplicate_declspec;
869 PrevSpec =
"_Noreturn";
872 FS_noreturn_specified =
true;
873 FS_noreturnLoc = Loc;
879 if (Friend_specified) {
886 DiagID = diag::warn_duplicate_declspec;
890 Friend_specified =
true;
898 PrevSpec =
"__module_private__";
899 DiagID = diag::ext_duplicate_declspec;
903 ModulePrivateLoc = Loc;
911 if (Constexpr_specified) {
912 DiagID = diag::warn_duplicate_declspec;
913 PrevSpec =
"constexpr";
916 Constexpr_specified =
true;
923 if (Concept_specified) {
924 DiagID = diag::ext_duplicate_declspec;
925 PrevSpec =
"concept";
928 Concept_specified =
true;
933 void DeclSpec::SaveWrittenBuiltinSpecs() {
941 if (attrs->
getKind() == AttributeList::AT_Mode) {
955 SaveWrittenBuiltinSpecs();
964 TypeAltiVecVector || TypeAltiVecPixel || TypeAltiVecBool ||
966 const unsigned NumLocs = 9;
968 TSWLoc, TSCLoc, TSSLoc, AltiVecLoc,
969 TQ_constLoc, TQ_restrictLoc, TQ_volatileLoc, TQ_atomicLoc, TQ_unalignedLoc
973 for (
unsigned I = 0;
I != NumLocs; ++
I) {
974 if (ExtraLocs[
I].isValid()) {
978 FirstLoc = ExtraLocs[I];
985 TypeAltiVecVector = TypeAltiVecPixel = TypeAltiVecBool =
false;
987 S.
Diag(TSTLoc, diag::err_decltype_auto_cannot_be_combined)
988 << Hints[0] << Hints[1] << Hints[2] << Hints[3]
989 << Hints[4] << Hints[5] << Hints[6] << Hints[7];
993 if (TypeAltiVecVector) {
994 if (TypeAltiVecBool) {
997 S.
Diag(TSSLoc, diag::err_invalid_vector_bool_decl_spec)
1003 (TypeSpecType !=
TST_int)) || TypeAltiVecPixel) {
1004 S.
Diag(TSTLoc, diag::err_invalid_vector_bool_decl_spec)
1005 << (TypeAltiVecPixel ?
"__pixel" :
1012 S.
Diag(TSWLoc, diag::err_invalid_vector_bool_decl_spec)
1020 S.
Diag(TSTLoc, diag::err_invalid_vector_long_long_decl_spec);
1030 S.
Diag(TSWLoc, diag::err_invalid_vector_long_double_decl_spec);
1033 S.
Diag(TSTLoc, diag::err_invalid_vector_double_decl_spec);
1037 S.
Diag(TSTLoc, diag::err_invalid_vector_float_decl_spec);
1038 }
else if (TypeSpecWidth ==
TSW_long) {
1041 S.
Diag(TSWLoc, diag::err_invalid_vector_long_decl_spec);
1043 S.
Diag(TSWLoc, diag::warn_vector_long_decl_spec_combination)
1047 if (TypeAltiVecPixel) {
1052 TypeSpecOwned =
false;
1062 S.
Diag(TSSLoc, diag::err_invalid_sign_spec)
1070 switch (TypeSpecWidth) {
1076 else if (TypeSpecType !=
TST_int) {
1077 S.
Diag(TSWLoc, diag::err_invalid_width_spec) << (int)TypeSpecWidth
1080 TypeSpecOwned =
false;
1087 S.
Diag(TSWLoc, diag::err_invalid_width_spec) << (int)TypeSpecWidth
1090 TypeSpecOwned =
false;
1099 S.
Diag(TSCLoc, diag::ext_plain_complex)
1107 S.
Diag(TSTLoc, diag::ext_integer_complex);
1109 S.
Diag(TSCLoc, diag::err_invalid_complex_spec)
1119 switch (StorageClassSpec) {
1129 diag::err_invalid_decl_spec_combination)
1134 diag::err_invalid_decl_spec_combination)
1151 TSTLoc = TSTNameLoc = StorageClassSpecLoc;
1157 S.
Diag(TSTLoc, diag::ext_auto_type_specifier);
1160 S.
Diag(StorageClassSpecLoc, diag::warn_auto_storage_class)
1163 S.
Diag(TSTLoc, diag::warn_cxx98_compat_unicode_type)
1164 << (TypeSpecType ==
TST_char16 ?
"char16_t" :
"char32_t");
1165 if (Constexpr_specified)
1166 S.
Diag(ConstexprLoc, diag::warn_cxx98_compat_constexpr);
1184 if (!SpecName.empty()) SpecName +=
" ";
1190 S.
Diag(SCLoc, diag::err_friend_decl_spec)
1191 << SpecName << StorageHint << ThreadHint;
1208 Keyword =
"virtual";
1211 Keyword =
"explicit";
1216 S.
Diag(SCLoc, diag::err_friend_decl_spec)
1219 FS_virtual_specified = FS_explicit_specified =
false;
1223 assert(!TypeSpecOwned ||
isDeclRep((
TST) TypeSpecType));
1245 for (
unsigned I = 0;
I != 3; ++
I) {
1254 const char *&PrevSpec) {
1256 FirstLocation = Loc;
1260 if (Specifiers & VS) {
1268 default: llvm_unreachable(
"Unknown specifier!");
1271 case VS_Final: VS_finalLoc = Loc;
break;
1279 default: llvm_unreachable(
"Unknown specifier");
SourceLocation getThreadStorageClassSpecLoc() const
Defines the clang::ASTContext interface.
SourceLocation getEnd() const
IdKind getKind() const
Determine what kind of name we have.
unsigned MutableLoc
The location of the 'mutable' qualifer in a lambda-declarator, if any.
NestedNameSpecifier * getRepresentation() const
Retrieve the representation of the nested-name-specifier.
unsigned RefQualifierIsLValueRef
Whether the ref-qualifier (if any) is an lvalue reference.
void MakeSuper(ASTContext &Context, CXXRecordDecl *RD, SourceLocation SuperLoc, SourceLocation ColonColonLoc)
Turns this (empty) nested-name-specifier into '__super' nested-name-specifier.
A (possibly-)qualified type.
void MakeTrivial(ASTContext &Context, NestedNameSpecifier *Qualifier, SourceRange R)
Make a new nested-name-specifier from incomplete source-location information.
SourceLocation getExplicitSpecLoc() const
TSW getTypeSpecWidth() const
static const TSS TSS_unsigned
unsigned RestrictQualifierLoc
The location of the restrict-qualifier, if any.
SourceLocation StartLocation
The location of the first token that describes this unqualified-id, which will be the location of the...
TheContext getContext() const
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range covering the entirety of this nested-name-specifier.
static const TST TST_wchar
Decl * getRepAsDecl() const
const LangOptions & getLangOpts() const
SourceLocation TemplateNameLoc
TemplateNameLoc - The location of the template name within the source.
unsigned MSWChar
When true, print the built-in wchar_t type as __wchar_t.
static const TST TST_typeofExpr
SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID)
Emit a diagnostic.
static const TST TST_char16
unsigned ExceptionSpecLocBeg
The beginning location of the exception specification, if any.
bool SetConstexprSpec(SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
unsigned EllipsisLoc
When isVariadic is true, the location of the ellipsis in the source.
SCS getStorageClassSpec() const
static DeclaratorChunk getFunction(bool HasProto, bool IsAmbiguous, SourceLocation LParenLoc, ParamInfo *Params, unsigned NumParams, SourceLocation EllipsisLoc, SourceLocation RParenLoc, unsigned TypeQuals, bool RefQualifierIsLvalueRef, SourceLocation RefQualifierLoc, SourceLocation ConstQualifierLoc, SourceLocation VolatileQualifierLoc, SourceLocation RestrictQualifierLoc, SourceLocation MutableLoc, ExceptionSpecificationType ESpecType, SourceRange ESpecRange, ParsedType *Exceptions, SourceRange *ExceptionRanges, unsigned NumExceptions, Expr *NoexceptExpr, CachedTokens *ExceptionSpecTokens, SourceLocation LocalRangeBegin, SourceLocation LocalRangeEnd, Declarator &TheDeclarator, TypeResult TrailingReturnType=TypeResult())
DeclaratorChunk::getFunction - Return a DeclaratorChunk for a function.
One instance of this struct is used for each type in a declarator that is parsed. ...
NamespaceDecl - Represent a C++ namespace.
SourceLocation EndLoc
EndLoc - If valid, the place where this chunck ends.
SourceLocation getLocForEndOfToken(SourceLocation Loc, unsigned Offset=0)
Calls Lexer::getLocForEndOfToken()
static const char * getSpecifierName(DeclSpec::TST T, const PrintingPolicy &Policy)
Turn a type-specifier-type into a string like "_Bool" or "union".
static const char * getSpecifierName(Specifier VS)
bool SetTypeAltiVecBool(bool isAltiVecBool, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID, const PrintingPolicy &Policy)
unsigned getRawEncoding() const
When a SourceLocation itself cannot be used, this returns an (opaque) 32-bit integer encoding for it...
unsigned RefQualifierLoc
The location of the ref-qualifier, if any.
void Adopt(NestedNameSpecifierLoc Other)
Adopt an existing nested-name-specifier (with source-range information).
static const TSCS TSCS_unspecified
static const TST TST_underlyingType
Information about one declarator, including the parsed type information and the identifier.
bool setFunctionSpecExplicit(SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
TypeSpecifierType
Specifies the kind of type.
static const TST TST_interface
static const TST TST_char
void setBegin(SourceLocation b)
Describes how types, statements, expressions, and declarations should be printed. ...
void Adopt(NestedNameSpecifierLoc Other)
Adopt an existing nested-name-specifier (with source-range information).
OpenCLOptions & getOpenCLOptions()
Information about a template-id annotation token.
static const TST TST_unknown_anytype
Base wrapper for a particular "section" of type source info.
TemplateIdAnnotation * TemplateId
When Kind == IK_TemplateId or IK_ConstructorTemplateId, the template-id annotation that contains the ...
Expr * NoexceptExpr
Pointer to the expression in the noexcept-specifier of this function, if it has one.
One of these records is kept for each identifier that is lexed.
void setConstructorTemplateId(TemplateIdAnnotation *TemplateId)
Specify that this unqualified-id was parsed as a template-id that names a constructor.
static const TST TST_decimal32
AttributeList * getList() const
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.
TypeSpecifierSign
Specifies the signedness of a type, e.g., signed or unsigned.
unsigned VolatileQualifierLoc
The location of the volatile-qualifier, if any.
TSS getTypeSpecSign() const
static const TST TST_class
OverloadedOperatorKind Operator
The kind of overloaded operator.
unsigned TypeQuals
The type qualifiers: const/volatile/restrict/__unaligned The qualifier bitmask values are the same as...
static const TST TST_double
struct OFI OperatorFunctionId
When Kind == IK_OperatorFunctionId, the overloaded operator that we parsed.
bool setFunctionSpecVirtual(SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
static const TST TST_error
static const TST TST_enum
static const TSW TSW_unspecified
void ClearStorageClassSpecs()
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
bool SetTypeAltiVecPixel(bool isAltiVecPixel, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID, const PrintingPolicy &Policy)
SourceLocation getBeginLoc() const
Get the begin source location.
const TargetInfo & getTargetInfo() const
bool setFunctionSpecForceInline(SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
SCS
storage-class-specifier
unsigned HasTrailingReturnType
HasTrailingReturnType - If this is true, a trailing return type was specified.
bool SetFriendSpec(SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
unsigned RParenLoc
The location of the right parenthesis in the source.
bool SetTypePipe(bool isPipe, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID, const PrintingPolicy &Policy)
bool setFunctionSpecNoreturn(SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
NestedNameSpecifierLoc getWithLocInContext(ASTContext &Context) const
Retrieve a nested-name-specifier with location information, copied into the given AST context...
void setTemplateId(TemplateIdAnnotation *TemplateId)
Specify that this unqualified-id was parsed as a template-id.
detail::InMemoryDirectory::const_iterator I
static const TST TST_float
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range covered by this nested-name-specifier.
Sema - This implements semantic analysis and AST building for C.
static const TSW TSW_long
TST getTypeSpecType() const
void MakeTrivial(ASTContext &Context, NestedNameSpecifier *Qualifier, SourceRange R)
Make a new nested-name-specifier from incomplete source-location information.
Holds a QualType and a TypeSourceInfo* that came out of a declarator parsing.
unsigned NumParams
NumParams - This is the number of formal parameters specified by the declarator.
unsigned NumExceptions
NumExceptions - This is the number of types in the dynamic-exception- decl, if the function has one...
static bool isDeclRep(TST T)
Expr - This represents one expression.
Defines the clang::LangOptions interface.
bool isDeclarationOfFunction() const
Determine whether the declaration that will be produced from this declaration will be a function...
SourceLocation getTypeSpecComplexLoc() const
bool isBeforeInTranslationUnit(SourceLocation LHS, SourceLocation RHS) const
Determines the order of 2 source locations in the translation unit.
unsigned SymbolLocations[3]
The source locations of the individual tokens that name the operator, e.g., the "new", "[", and "]" tokens in operator new [].
This file defines the classes used to store parsed information about declaration-specifiers and decla...
enum clang::DeclaratorChunk::@185 Kind
static const TST TST_decimal64
Defines the clang::TypeLoc interface and its subclasses.
CachedTokens * ExceptionSpecTokens
Pointer to the cached tokens for an exception-specification that has not yet been parsed...
bool hasTypeSpecifier() const
Return true if any type-specifier has been found.
SourceLocation Loc
Loc - The place where this type was defined.
bool SetTypeSpecSign(TSS S, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
static const TST TST_half
Wraps an identifier and optional source location for the identifier.
SourceLocation getStorageClassSpecLoc() const
static bool BadSpecifier(T TNew, T TPrev, const char *&PrevSpec, unsigned &DiagID, bool IsExtension=true)
static const TSW TSW_short
bool isVirtualSpecified() const
UnionParsedType TrailingReturnType
If HasTrailingReturnType is true, this is the trailing return type specified.
bool SetTypeSpecWidth(TSW 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 isValid() const
Determine whether this unqualified-id refers to a valid name.
TypeAndRange * Exceptions
Pointer to a new[]'d array of TypeAndRange objects that contain the types in the function's dynamic e...
static const TST TST_char32
unsigned Bool
Whether we can use 'bool' rather than '_Bool' (even if the language doesn't actually have 'bool'...
bool isCtorOrDtor()
Returns true if this declares a constructor or a destructor.
SourceLocation getLastQualifierNameLoc() const
Retrieve the location of the name in the last qualifier in this nested name specifier.
bool SetConceptSpec(SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
ActionResult - This structure is used while parsing/acting on expressions, stmts, etc...
void MakeSuper(ASTContext &Context, CXXRecordDecl *RD, SourceLocation SuperLoc, SourceLocation ColonColonLoc)
Turns this (empty) nested-name-specifier into '__super' nested-name-specifier.
Encodes a location in the source.
static const TST TST_auto_type
An overloaded operator name, e.g., operator+.
Expr * getRepAsExpr() const
UnqualifiedId & getName()
Retrieve the name specified by this declarator.
bool isValid() const
Return true if this is a valid SourceLocation object.
NestedNameSpecifierLoc getWithLocInContext(ASTContext &Context) const
Retrieve a nested-name-specifier with location information, copied into the given AST context...
NestedNameSpecifierLoc getTemporary() const
Retrieve a nested-name-specifier with location information based on the information in this builder...
static const TST TST_union
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...
ParsedType getRepAsType() const
SourceLocation getLocalBeginLoc() const
Retrieve the location of the beginning of this component of the nested-name-specifier.
static const TSS TSS_signed
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
void MakeGlobal(ASTContext &Context, SourceLocation ColonColonLoc)
Turn this (empty) nested-name-specifier into the global nested-name-specifier '::'.
SourceLocation getVirtualSpecLoc() const
static const TST TST_typeofType
SourceLocation getBegin() const
bool SetTypeQual(TQ T, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID, const LangOptions &Lang)
bool isStaticMember()
Returns true if this declares a static member.
bool SetTypeAltiVecVector(bool isAltiVecVector, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID, const PrintingPolicy &Policy)
A constructor named via a template-id.
static const TST TST_decltype_auto
bool setModulePrivateSpec(SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
static bool isInvalid(LocType Loc, bool *Invalid)
static bool isStaticOverloadedOperator(OverloadedOperatorKind OOK)
Returns true if the given operator is implicitly static in a record context.
TSCS getThreadStorageClassSpec() const
static const TSS TSS_unspecified
static const TST TST_decltype
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
static const TST TST_auto
bool isFriendSpecified() const
static const TST TST_void
unsigned isVariadic
isVariadic - If this function has a prototype, and if that proto ends with ',...)', this is true.
SourceLocation RAngleLoc
The location of the '>' after the template argument list.
static const TST TST_int128
unsigned DeleteParams
DeleteParams - If this is true, we need to delete[] Params.
bool isMissingDeclaratorOk()
Checks if this DeclSpec can stand alone, without a Declarator.
static FixItHint CreateRemoval(CharSourceRange RemoveRange)
Create a code modification hint that removes the given source range.
bool hasTagDefinition() const
unsigned ConstQualifierLoc
The location of the const-qualifier, if any.
detail::InMemoryDirectory::const_iterator E
static const TST TST_unspecified
bool SetSpecifier(Specifier VS, SourceLocation Loc, const char *&PrevSpec)
static const TST TST_decimal128
SourceManager & getSourceManager() const
static const TSCS TSCS___thread
unsigned hasPrototype
hasPrototype - This is true if the function had at least one typed parameter.
unsigned LParenLoc
The location of the left parenthesis in the source.
bool isFunctionType() const
bool SetStorageClassSpecThread(TSCS TSC, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
void setOperatorFunctionId(SourceLocation OperatorLoc, OverloadedOperatorKind Op, SourceLocation SymbolLocations[3])
Specify that this unqualified-id was parsed as an operator-function-id.
static const TST TST_typename
ExceptionSpecificationType
The various types of exception specifications that exist in C++11.
static FixItHint CreateInsertion(SourceLocation InsertionLoc, StringRef Code, bool BeforePreviousInsertions=false)
Create a code modification hint that inserts the given code string at a specific location.
A template-id, e.g., f<int>.
bool SetTypeSpecType(TST T, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID, const PrintingPolicy &Policy)
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
void Extend(ASTContext &Context, SourceLocation TemplateKWLoc, TypeLoc TL, SourceLocation ColonColonLoc)
Extend the current nested-name-specifier by another nested-name-specifier component of the form 'type...
unsigned ExceptionSpecType
ExceptionSpecType - An ExceptionSpecificationType value.
ThreadStorageClassSpecifier
Thread storage-class-specifier.
bool isExplicitSpecified() const
void setEnd(SourceLocation e)
Represents a C++ struct/union/class.
static const TSCS TSCS_thread_local
TypeSpecifierWidth
Specifies the width of a type, e.g., short, long, or long long.
static const TST TST_float128
static const TST TST_bool
void MakeGlobal(ASTContext &Context, SourceLocation ColonColonLoc)
Turn this (empty) nested-name-specifier into the global nested-name-specifier '::'.
void Finish(Sema &S, const PrintingPolicy &Policy)
Finish - This does final analysis of the declspec, issuing diagnostics for things like "_Imaginary" (...
Defines the clang::TargetInfo interface.
static const TSW TSW_longlong
static Decl::Kind getKind(const Decl *D)
unsigned getParsedSpecifiers() const
Return a bitmask of which flavors of specifiers this DeclSpec includes.
virtual bool hasFeature(StringRef Feature) const
Determine whether the given target has the given feature.
static const TST TST_atomic
void Extend(ASTContext &Context, SourceLocation TemplateKWLoc, TypeLoc TL, SourceLocation ColonColonLoc)
Extend the current nested-name-specifier by another nested-name-specifier component of the form 'type...
static const TST TST_struct
Annotates a diagnostic with some code that should be inserted, removed, or replaced to fix the proble...
ParamInfo - An array of paraminfo objects is allocated whenever a function declarator is parsed...
AttributeList * getNext() const
A trivial tuple used to represent a source range.
bool SetTypeSpecComplex(TSC C, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
unsigned ExceptionSpecLocEnd
The end location of the exception specification, if any.
bool isModulePrivateSpecified() const
Represents a C++ namespace alias.
SourceLocation EndLocation
The location of the last token that describes this unqualified-id.
static const TSCS TSCS__Thread_local
bool isNull() const
Return true if this QualType doesn't point to a type yet.
enum clang::UnqualifiedId::IdKind Kind
ParamInfo * Params
Params - This is a pointer to a new[]'d array of ParamInfo objects that describe the parameters speci...
ParsedAttributes & getAttributes()
const DeclSpec & getDeclSpec() const
getDeclSpec - Return the declaration-specifier that this declarator was declared with.
AttributeList - Represents a syntactic attribute.
void Clear()
Clear out this builder, and prepare it to build another nested-name-specifier with source-location in...
bool setFunctionSpecInline(SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
unsigned isAmbiguous
Can this declaration be a constructor-style initializer?