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");
315 return E->getType()->isFunctionType();
325 if (
const LocInfoType *LIT = dyn_cast<LocInfoType>(QT))
335 llvm_unreachable(
"Invalid TypeSpecType!");
343 getName().OperatorFunctionId.Operator));
354 return cast<TagDecl>(
getRepAsDecl())->isCompleteDefinition();
372 if (FS_inline_specified || FS_virtual_specified || FS_explicit_specified ||
373 FS_noreturn_specified || FS_forceinline_specified)
379 const char *&PrevSpec,
381 bool IsExtension =
true) {
384 DiagID = diag::err_invalid_decl_spec_combination;
386 DiagID = IsExtension ? diag::ext_duplicate_declspec :
387 diag::warn_duplicate_declspec;
402 llvm_unreachable(
"Unknown typespec!");
412 llvm_unreachable(
"Unknown typespec!");
422 llvm_unreachable(
"Unknown typespec!");
431 llvm_unreachable(
"Unknown typespec!");
441 llvm_unreachable(
"Unknown typespec!");
479 llvm_unreachable(
"Unknown typespec!");
490 llvm_unreachable(
"Unknown typespec!");
494 const char *&PrevSpec,
511 DiagID = diag::err_opencl_unknown_type_specifier;
518 DiagID = diag::err_opencl_unknown_type_specifier;
534 PrevSpec, DiagID, Policy);
535 assert(!isInvalid &&
"auto SCS -> TST recovery failed");
543 !(SCS_extern_in_linkage_spec &&
548 StorageClassSpec = SC;
549 StorageClassSpecLoc = Loc;
550 assert((
unsigned)SC == StorageClassSpec &&
"SCS constants overflow bitfield");
555 const char *&PrevSpec,
560 ThreadStorageClassSpec =
TSC;
561 ThreadStorageClassSpecLoc = Loc;
569 const char *&PrevSpec,
584 const char *&PrevSpec,
594 const char *&PrevSpec,
604 const char *&PrevSpec,
613 const char *&PrevSpec,
617 assert(
isTypeRep(T) &&
"T does not store a type");
618 assert(Rep &&
"no type provided!");
621 DiagID = diag::err_invalid_decl_spec_combination;
627 TSTNameLoc = TagNameLoc;
628 TypeSpecOwned =
false;
633 const char *&PrevSpec,
637 assert(isExprRep(T) &&
"T does not store an expr");
638 assert(Rep &&
"no expression provided!");
641 DiagID = diag::err_invalid_decl_spec_combination;
648 TypeSpecOwned =
false;
653 const char *&PrevSpec,
655 Decl *Rep,
bool Owned,
657 return SetTypeSpecType(T, Loc, Loc, PrevSpec, DiagID, Rep, Owned, Policy);
662 const char *&PrevSpec,
664 Decl *Rep,
bool Owned,
666 assert(
isDeclRep(T) &&
"T does not store a decl");
671 DiagID = diag::err_invalid_decl_spec_combination;
677 TSTNameLoc = TagNameLoc;
678 TypeSpecOwned = Owned && Rep !=
nullptr;
683 const char *&PrevSpec,
687 "rep required for these type-spec kinds!");
690 DiagID = diag::err_invalid_decl_spec_combination;
695 if (TypeAltiVecVector && (T ==
TST_bool) && !TypeAltiVecBool) {
696 TypeAltiVecBool =
true;
700 TypeSpecOwned =
false;
705 const char *&PrevSpec,
unsigned &DiagID,
709 DiagID = diag::err_invalid_vector_decl_spec_combination;
712 TypeAltiVecVector = isAltiVecVector;
718 const char *&PrevSpec,
unsigned &DiagID,
723 DiagID = diag::err_invalid_decl_spec_combination;
734 const char *&PrevSpec,
unsigned &DiagID,
736 if (!TypeAltiVecVector || TypeAltiVecPixel ||
739 DiagID = diag::err_invalid_pixel_decl_spec_combination;
742 TypeAltiVecPixel = isAltiVecPixel;
749 const char *&PrevSpec,
unsigned &DiagID,
751 if (!TypeAltiVecVector || TypeAltiVecBool ||
754 DiagID = diag::err_invalid_vector_bool_decl_spec;
757 TypeAltiVecBool = isAltiVecBool;
765 TypeSpecOwned =
false;
777 if (TypeQualifiers & T) {
778 bool IsExtension =
true;
781 return BadSpecifier(T, T, PrevSpec, DiagID, IsExtension);
787 case TQ_const: TQ_constLoc = Loc;
return false;
788 case TQ_restrict: TQ_restrictLoc = Loc;
return false;
789 case TQ_volatile: TQ_volatileLoc = Loc;
return false;
790 case TQ_atomic: TQ_atomicLoc = Loc;
return false;
793 llvm_unreachable(
"Unknown type qualifier!");
800 if (FS_inline_specified) {
801 DiagID = diag::warn_duplicate_declspec;
805 FS_inline_specified =
true;
812 if (FS_forceinline_specified) {
813 DiagID = diag::warn_duplicate_declspec;
814 PrevSpec =
"__forceinline";
817 FS_forceinline_specified =
true;
818 FS_forceinlineLoc = Loc;
823 const char *&PrevSpec,
827 if (FS_virtual_specified) {
828 DiagID = diag::warn_duplicate_declspec;
829 PrevSpec =
"virtual";
832 FS_virtual_specified =
true;
838 const char *&PrevSpec,
842 if (FS_explicit_specified) {
843 DiagID = diag::warn_duplicate_declspec;
844 PrevSpec =
"explicit";
847 FS_explicit_specified =
true;
848 FS_explicitLoc = Loc;
853 const char *&PrevSpec,
857 if (FS_noreturn_specified) {
858 DiagID = diag::warn_duplicate_declspec;
859 PrevSpec =
"_Noreturn";
862 FS_noreturn_specified =
true;
863 FS_noreturnLoc = Loc;
869 if (Friend_specified) {
876 DiagID = diag::warn_duplicate_declspec;
880 Friend_specified =
true;
888 PrevSpec =
"__module_private__";
889 DiagID = diag::ext_duplicate_declspec;
893 ModulePrivateLoc = Loc;
901 if (Constexpr_specified) {
902 DiagID = diag::warn_duplicate_declspec;
903 PrevSpec =
"constexpr";
906 Constexpr_specified =
true;
913 if (Concept_specified) {
914 DiagID = diag::ext_duplicate_declspec;
915 PrevSpec =
"concept";
918 Concept_specified =
true;
923 void DeclSpec::SaveWrittenBuiltinSpecs() {
931 if (attrs->
getKind() == AttributeList::AT_Mode) {
945 SaveWrittenBuiltinSpecs();
954 TypeAltiVecVector || TypeAltiVecPixel || TypeAltiVecBool ||
956 const unsigned NumLocs = 8;
958 TSWLoc, TSCLoc, TSSLoc, AltiVecLoc,
959 TQ_constLoc, TQ_restrictLoc, TQ_volatileLoc, TQ_atomicLoc
963 for (
unsigned I = 0;
I != NumLocs; ++
I) {
964 if (ExtraLocs[
I].isValid()) {
968 FirstLoc = ExtraLocs[I];
975 TypeAltiVecVector = TypeAltiVecPixel = TypeAltiVecBool =
false;
977 S.
Diag(TSTLoc, diag::err_decltype_auto_cannot_be_combined)
978 << Hints[0] << Hints[1] << Hints[2] << Hints[3]
979 << Hints[4] << Hints[5] << Hints[6] << Hints[7];
983 if (TypeAltiVecVector) {
984 if (TypeAltiVecBool) {
987 S.
Diag(TSSLoc, diag::err_invalid_vector_bool_decl_spec)
993 (TypeSpecType !=
TST_int)) || TypeAltiVecPixel) {
994 S.
Diag(TSTLoc, diag::err_invalid_vector_bool_decl_spec)
995 << (TypeAltiVecPixel ?
"__pixel" :
1002 S.
Diag(TSWLoc, diag::err_invalid_vector_bool_decl_spec)
1010 S.
Diag(TSTLoc, diag::err_invalid_vector_long_long_decl_spec);
1020 S.
Diag(TSWLoc, diag::err_invalid_vector_long_double_decl_spec);
1023 S.
Diag(TSTLoc, diag::err_invalid_vector_double_decl_spec);
1027 S.
Diag(TSTLoc, diag::err_invalid_vector_float_decl_spec);
1028 }
else if (TypeSpecWidth ==
TSW_long) {
1031 S.
Diag(TSWLoc, diag::err_invalid_vector_long_decl_spec);
1033 S.
Diag(TSWLoc, diag::warn_vector_long_decl_spec_combination)
1037 if (TypeAltiVecPixel) {
1042 TypeSpecOwned =
false;
1052 S.
Diag(TSSLoc, diag::err_invalid_sign_spec)
1060 switch (TypeSpecWidth) {
1066 else if (TypeSpecType !=
TST_int) {
1067 S.
Diag(TSWLoc, diag::err_invalid_width_spec) << (int)TypeSpecWidth
1070 TypeSpecOwned =
false;
1077 S.
Diag(TSWLoc, diag::err_invalid_width_spec) << (int)TypeSpecWidth
1080 TypeSpecOwned =
false;
1089 S.
Diag(TSCLoc, diag::ext_plain_complex)
1097 S.
Diag(TSTLoc, diag::ext_integer_complex);
1099 S.
Diag(TSCLoc, diag::err_invalid_complex_spec)
1109 switch (StorageClassSpec) {
1119 diag::err_invalid_decl_spec_combination)
1124 diag::err_invalid_decl_spec_combination)
1141 TSTLoc = TSTNameLoc = StorageClassSpecLoc;
1147 S.
Diag(TSTLoc, diag::ext_auto_type_specifier);
1150 S.
Diag(StorageClassSpecLoc, diag::warn_auto_storage_class)
1153 S.
Diag(TSTLoc, diag::warn_cxx98_compat_unicode_type)
1154 << (TypeSpecType ==
TST_char16 ?
"char16_t" :
"char32_t");
1155 if (Constexpr_specified)
1156 S.
Diag(ConstexprLoc, diag::warn_cxx98_compat_constexpr);
1174 if (!SpecName.empty()) SpecName +=
" ";
1180 S.
Diag(SCLoc, diag::err_friend_decl_spec)
1181 << SpecName << StorageHint << ThreadHint;
1198 Keyword =
"virtual";
1201 Keyword =
"explicit";
1206 S.
Diag(SCLoc, diag::err_friend_decl_spec)
1209 FS_virtual_specified = FS_explicit_specified =
false;
1213 assert(!TypeSpecOwned ||
isDeclRep((
TST) TypeSpecType));
1235 for (
unsigned I = 0;
I != 3; ++
I) {
1244 const char *&PrevSpec) {
1246 FirstLocation = Loc;
1250 if (Specifiers & VS) {
1258 default: llvm_unreachable(
"Unknown specifier!");
1261 case VS_Final: VS_finalLoc = Loc;
break;
1269 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
Decl - This represents one declaration (or definition), e.g.
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.
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...
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' (bec...
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...
enum clang::DeclaratorChunk::@183 Kind
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 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 bool isInvalid(SourceLocation Loc, bool *Invalid)
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_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?