14#ifndef LLVM_CLANG_SEMA_PARSEDATTR_H
15#define LLVM_CLANG_SEMA_PARSEDATTR_H
23#include "llvm/ADT/PointerUnion.h"
24#include "llvm/ADT/SmallVector.h"
25#include "llvm/Support/Allocator.h"
26#include "llvm/Support/VersionTuple.h"
108using ArgsUnion = llvm::PointerUnion<Expr *, IdentifierLoc *>;
122 private llvm::TrailingObjects<
123 ParsedAttr, ArgsUnion, detail::AvailabilityData,
124 detail::TypeTagForDatatypeData, ParsedType, detail::PropertyData> {
125 friend TrailingObjects;
127 size_t numTrailingObjects(OverloadToken<ArgsUnion>)
const {
return NumArgs; }
128 size_t numTrailingObjects(OverloadToken<detail::AvailabilityData>)
const {
129 return IsAvailability;
132 numTrailingObjects(OverloadToken<detail::TypeTagForDatatypeData>)
const {
133 return IsTypeTagForDatatype;
135 size_t numTrailingObjects(OverloadToken<ParsedType>)
const {
136 return HasParsedType;
138 size_t numTrailingObjects(OverloadToken<detail::PropertyData>)
const {
149 unsigned NumArgs : 16;
152 mutable unsigned Invalid : 1;
155 mutable unsigned UsedAsTypeAttr : 1;
159 unsigned IsAvailability : 1;
163 unsigned IsTypeTagForDatatype : 1;
167 unsigned IsProperty : 1;
170 unsigned HasParsedType : 1;
173 mutable unsigned HasProcessingCache : 1;
176 mutable unsigned ProcessingCache : 8;
179 mutable unsigned IsPragmaClangAttribute : 1;
185 const Expr *MessageExpr;
189 ArgsUnion *getArgsBuffer() {
return getTrailingObjects<ArgsUnion>(); }
191 return getTrailingObjects<ArgsUnion>();
195 return getTrailingObjects<detail::AvailabilityData>();
198 return getTrailingObjects<detail::AvailabilityData>();
211 EllipsisLoc(ellipsisLoc), NumArgs(numArgs), Invalid(
false),
214 HasProcessingCache(
false), IsPragmaClangAttribute(
false),
227 const Expr *replacementExpr)
229 NumArgs(1), Invalid(
false), UsedAsTypeAttr(
false), IsAvailability(
true),
231 HasProcessingCache(
false), IsPragmaClangAttribute(
false),
232 UnavailableLoc(unavailable), MessageExpr(messageExpr),
237 introduced, deprecated, obsoleted, strict, replacementExpr);
241 ParsedAttr(IdentifierInfo *attrName, SourceRange attrRange,
242 IdentifierInfo *scopeName, SourceLocation scopeLoc,
243 IdentifierLoc *Parm1, IdentifierLoc *Parm2, IdentifierLoc *Parm3,
245 : AttributeCommonInfo(attrName, scopeName, attrRange, scopeLoc, formUsed),
246 NumArgs(3), Invalid(
false), UsedAsTypeAttr(
false),
248 HasParsedType(
false), HasProcessingCache(
false),
249 IsPragmaClangAttribute(
false), Info(ParsedAttrInfo::get(*this)) {
257 ParsedAttr(IdentifierInfo *attrName, SourceRange attrRange,
258 IdentifierInfo *scopeName, SourceLocation scopeLoc,
259 IdentifierLoc *ArgKind,
ParsedType matchingCType,
260 bool layoutCompatible,
bool mustBeNull, Form formUsed)
262 NumArgs(1), Invalid(
false), UsedAsTypeAttr(
false),
263 IsAvailability(
false), IsTypeTagForDatatype(
true), IsProperty(
false),
264 HasParsedType(
false), HasProcessingCache(
false),
265 IsPragmaClangAttribute(
false), Info(ParsedAttrInfo::get(*this)) {
268 detail::TypeTagForDatatypeData &ExtraData = getTypeTagForDatatypeDataSlot();
269 new (&ExtraData.MatchingCType)
ParsedType(matchingCType);
270 ExtraData.LayoutCompatible = layoutCompatible;
271 ExtraData.MustBeNull = mustBeNull;
275 ParsedAttr(IdentifierInfo *attrName, SourceRange attrRange,
276 IdentifierInfo *scopeName, SourceLocation scopeLoc,
277 ParsedType typeArg, Form formUsed, SourceLocation ellipsisLoc)
279 EllipsisLoc(ellipsisLoc), NumArgs(0), Invalid(
false),
281 IsTypeTagForDatatype(
false), IsProperty(
false), HasParsedType(
true),
282 HasProcessingCache(
false), IsPragmaClangAttribute(
false),
283 Info(ParsedAttrInfo::get(*this)) {
288 ParsedAttr(IdentifierInfo *attrName, SourceRange attrRange,
289 IdentifierInfo *scopeName, SourceLocation scopeLoc,
290 IdentifierInfo *getterId, IdentifierInfo *setterId, Form formUsed)
292 NumArgs(0), Invalid(
false), UsedAsTypeAttr(
false),
293 IsAvailability(
false), IsTypeTagForDatatype(
false), IsProperty(
true),
294 HasParsedType(
false), HasProcessingCache(
false),
295 IsPragmaClangAttribute(
false), Info(ParsedAttrInfo::get(*this)) {
296 new (&getPropertyDataBuffer()) detail::PropertyData(getterId, setterId);
302 detail::TypeTagForDatatypeData &getTypeTagForDatatypeDataSlot() {
303 return *getTrailingObjects<detail::TypeTagForDatatypeData>();
305 const detail::TypeTagForDatatypeData &getTypeTagForDatatypeDataSlot()
const {
306 return *getTrailingObjects<detail::TypeTagForDatatypeData>();
311 ParsedType &getTypeBuffer() {
return *getTrailingObjects<ParsedType>(); }
313 return *getTrailingObjects<ParsedType>();
318 detail::PropertyData &getPropertyDataBuffer() {
320 return *getTrailingObjects<detail::PropertyData>();
322 const detail::PropertyData &getPropertyDataBuffer()
const {
324 return *getTrailingObjects<detail::PropertyData>();
327 size_t allocated_size()
const;
336 void operator delete(
void *) =
delete;
352 return ProcessingCache;
356 ProcessingCache = value;
357 HasProcessingCache =
true;
376 assert(Arg < NumArgs &&
"Arg access out of range!");
377 return getArgsBuffer()[Arg];
381 return Arg < NumArgs &&
getArg(Arg).is<
Expr*>();
398 "Not an availability attribute");
404 "Not an availability attribute");
410 "Not an availability attribute");
416 "Not an availability attribute");
422 "Not an availability attribute");
423 return UnavailableLoc;
428 "Not an availability attribute");
434 "Not an availability attribute");
440 "Not a type_tag_for_datatype attribute");
446 "Not a type_tag_for_datatype attribute");
452 "Not a type_tag_for_datatype attribute");
453 return getTypeTagForDatatypeDataSlot().
MustBeNull;
457 assert(HasParsedType &&
"Not a type attribute");
458 return getTypeBuffer();
463 "Not a __delcspec(property) attribute");
464 return getPropertyDataBuffer().
GetterId;
469 "Not a __delcspec(property) attribute");
470 return getPropertyDataBuffer().
SetterId;
478 MacroExpansionLoc = Loc;
490 "if this attribute has a macro identifier.");
491 return MacroExpansionLoc;
557 case ParsedAttr::AT_OpenCLConstantAddressSpace:
559 case ParsedAttr::AT_OpenCLGlobalAddressSpace:
561 case ParsedAttr::AT_OpenCLGlobalDeviceAddressSpace:
563 case ParsedAttr::AT_OpenCLGlobalHostAddressSpace:
565 case ParsedAttr::AT_OpenCLLocalAddressSpace:
567 case ParsedAttr::AT_OpenCLPrivateAddressSpace:
569 case ParsedAttr::AT_OpenCLGenericAddressSpace:
580 case ParsedAttr::AT_OpenCLGlobalAddressSpace:
582 case ParsedAttr::AT_OpenCLGlobalDeviceAddressSpace:
584 case ParsedAttr::AT_OpenCLGlobalHostAddressSpace:
586 case ParsedAttr::AT_OpenCLLocalAddressSpace:
588 case ParsedAttr::AT_OpenCLPrivateAddressSpace:
590 case ParsedAttr::AT_OpenCLGenericAddressSpace:
600 case ParsedAttr::AT_HLSLGroupSharedAddressSpace:
643 InlineFreeListsCapacity =
647 llvm::BumpPtrAllocator Alloc;
651 SmallVector<SmallVector<ParsedAttr *, 8>, InlineFreeListsCapacity> FreeLists;
657 void *allocate(
size_t size);
679 void *allocate(
size_t size) {
680 return Factory.allocate(size);
684 Attrs.push_back(attr);
688 void remove(ParsedAttr *attr) {
689 assert(llvm::is_contained(Attrs, attr) &&
690 "Can't take attribute from a pool that doesn't own it!");
691 Attrs.erase(llvm::find(Attrs, attr));
694 void takePool(AttributePool &pool);
717 Factory.reclaimPool(*
this);
736 void *memory = allocate(
741 return add(
new (memory)
ParsedAttr(attrName, attrRange, scopeName, scopeLoc,
742 args, numArgs, form, ellipsisLoc));
752 const Expr *ReplacementExpr) {
755 attrName, attrRange, scopeName, scopeLoc, Param, introduced, deprecated,
756 obsoleted, unavailable, MessageExpr, form, strict, ReplacementExpr));
763 void *memory = allocate(
767 return add(
new (memory)
ParsedAttr(attrName, attrRange, scopeName, scopeLoc,
768 Param1, Param2, Param3, form));
775 ParsedType matchingCType,
bool layoutCompatible,
778 return add(
new (memory)
ParsedAttr(attrName, attrRange, scopeName, scopeLoc,
779 argumentKind, matchingCType,
780 layoutCompatible, mustBeNull, form));
789 void *memory = allocate(
793 return add(
new (memory)
ParsedAttr(attrName, attrRange, scopeName, scopeLoc,
794 typeArg, formUsed, ellipsisLoc));
803 return add(
new (memory)
ParsedAttr(attrName, attrRange, scopeName, scopeLoc,
804 getterId, setterId, formUsed));
810 using SizeType =
decltype(std::declval<VecTy>().size());
820 bool empty()
const {
return AttrList.empty(); }
821 SizeType
size()
const {
return AttrList.size(); }
827 AttrList.push_back(newAttr);
831 assert(is_contained(AttrList, ToBeRemoved) &&
832 "Cannot remove attribute that isn't in the list");
833 AttrList.erase(llvm::find(AttrList, ToBeRemoved));
838 struct iterator : llvm::iterator_adaptor_base<iterator, VecTy::iterator,
839 std::random_access_iterator_tag,
842 iterator(VecTy::iterator I) : iterator_adaptor_base(I) {}
847 : llvm::iterator_adaptor_base<const_iterator, VecTy::const_iterator,
848 std::random_access_iterator_tag,
858 AttrList.insert(AttrList.begin(), B.I, E.I);
862 AttrList.insert(AttrList.begin(), B.I, E.I);
866 AttrList.insert(AttrList.end(), B.I, E.I);
870 AttrList.insert(AttrList.end(), B.I, E.I);
880 return *AttrList.front();
884 return *AttrList.front();
888 return *AttrList.back();
892 return *AttrList.back();
896 return llvm::any_of(AttrList, [K](
const ParsedAttr *AL) {
902 auto It = llvm::find_if(AttrList, [](
const ParsedAttr *AL) {
905 if (It != AttrList.end())
917 : StringLiterals(StringLiteralBits) {}
920 if (I >= StringLiterals.size())
921 return StringLiterals.test(StringLiterals.size() - 1);
922 return StringLiterals.test(I);
926 std::bitset<32> StringLiterals;
944 assert(&
Other !=
this &&
945 "ParsedAttributes can't take attributes from itself");
947 Other.clearListOnly();
952 assert(&
Other !=
this &&
953 "ParsedAttributes can't take attribute from itself");
954 Other.getPool().remove(PA);
972 args, numArgs, form, ellipsisLoc);
985 const Expr *ReplacementExpr) {
987 attrName, attrRange, scopeName, scopeLoc, Param, introduced, deprecated,
988 obsoleted, unavailable, MessageExpr, form, strict, ReplacementExpr);
999 Param1, Param2, Param3, form);
1009 ParsedType matchingCType,
bool layoutCompatible,
1012 attrName, attrRange, scopeName, scopeLoc, argumentKind, matchingCType,
1013 layoutCompatible, mustBeNull, form);
1025 typeArg, formUsed, ellipsisLoc);
1037 attrName, attrRange, scopeName, scopeLoc, getterId, setterId, formUsed);
1049 ParsedAttributes &
Result);
1101 std::enable_if_t<std::is_same<ACI, AttributeCommonInfo>::value,
int> = 0>
1104 DB.
AddTaggedVal(
reinterpret_cast<uint64_t
>(CI.getAttrName()),
1111 std::enable_if_t<std::is_same<ACI, AttributeCommonInfo>::value,
int> = 0>
1114 DB.
AddTaggedVal(
reinterpret_cast<uint64_t
>(CI->getAttrName()),
Defines the Diagnostic-related interfaces.
Defines the clang::SourceLocation class and associated facilities.
__DEVICE__ void * memcpy(void *__a, const void *__b, size_t __c)
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
AttributeCommonInfo(const IdentifierInfo *AttrName, const IdentifierInfo *ScopeName, SourceRange AttrRange, SourceLocation ScopeLoc, Kind AttrKind, Form FormUsed)
const IdentifierInfo * getAttrName() const
Kind getParsedKind() const
A factory, from which one makes pools, from which one creates individual attributes which are dealloc...
@ TypeTagForDatatypeAllocSize
ParsedAttr * create(IdentifierInfo *attrName, SourceRange attrRange, IdentifierInfo *scopeName, SourceLocation scopeLoc, ArgsUnion *args, unsigned numArgs, ParsedAttr::Form form, SourceLocation ellipsisLoc=SourceLocation())
ParsedAttr * createTypeTagForDatatype(IdentifierInfo *attrName, SourceRange attrRange, IdentifierInfo *scopeName, SourceLocation scopeLoc, IdentifierLoc *argumentKind, ParsedType matchingCType, bool layoutCompatible, bool mustBeNull, ParsedAttr::Form form)
AttributePool(AttributePool &&pool)=default
Move the given pool's allocations to this pool.
AttributePool(AttributeFactory &factory)
Create a new pool for a factory.
ParsedAttr * create(IdentifierInfo *attrName, SourceRange attrRange, IdentifierInfo *scopeName, SourceLocation scopeLoc, IdentifierLoc *Param1, IdentifierLoc *Param2, IdentifierLoc *Param3, ParsedAttr::Form form)
AttributePool & operator=(AttributePool &&pool)=delete
AttributePool(const AttributePool &)=delete
AttributeFactory & getFactory() const
ParsedAttr * create(IdentifierInfo *attrName, SourceRange attrRange, IdentifierInfo *scopeName, SourceLocation scopeLoc, IdentifierLoc *Param, const AvailabilityChange &introduced, const AvailabilityChange &deprecated, const AvailabilityChange &obsoleted, SourceLocation unavailable, const Expr *MessageExpr, ParsedAttr::Form form, SourceLocation strict, const Expr *ReplacementExpr)
ParsedAttr * createPropertyAttribute(IdentifierInfo *attrName, SourceRange attrRange, IdentifierInfo *scopeName, SourceLocation scopeLoc, IdentifierInfo *getterId, IdentifierInfo *setterId, ParsedAttr::Form formUsed)
ParsedAttr * createTypeAttribute(IdentifierInfo *attrName, SourceRange attrRange, IdentifierInfo *scopeName, SourceLocation scopeLoc, ParsedType typeArg, ParsedAttr::Form formUsed, SourceLocation ellipsisLoc)
void takeAllFrom(AttributePool &pool)
Take the given pool's allocations and add them to this pool.
AttributePool & operator=(const AttributePool &)=delete
Decl - This represents one declaration (or definition), e.g.
@ ak_identifierinfo
IdentifierInfo.
This represents one expression.
One of these records is kept for each identifier that is lexed.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
ParsedAttr - Represents a syntactic attribute.
bool isPackExpansion() const
const AvailabilityChange & getAvailabilityDeprecated() const
bool isTargetSpecificAttr() const
bool hasCustomParsing() const
ParsedAttr(ParsedAttr &&)=delete
LangAS asSYCLLangAS() const
If this is an OpenCL address space attribute, returns its SYCL representation in LangAS,...
unsigned getSemanticSpelling() const
If the parsed attribute has a semantic equivalent, and it would have a semantic Spelling enumeration ...
bool appliesToDecl(const Decl *D, attr::SubjectMatchRule MatchRule) const
bool isKnownToGCC() const
bool existsInTarget(const TargetInfo &Target) const
unsigned getMinArgs() const
bool checkExactlyNumArgs(class Sema &S, unsigned Num) const
Check if the attribute has exactly as many args as Num.
IdentifierLoc * getArgAsIdent(unsigned Arg) const
bool hasParsedType() const
const AvailabilityChange & getAvailabilityIntroduced() const
void setInvalid(bool b=true) const
bool hasVariadicArg() const
const ParsedAttrInfo & getInfo() const
bool hasMacroIdentifier() const
Returns true if this attribute was declared in a macro.
ParsedAttr & operator=(ParsedAttr &&)=delete
ParsedAttr & operator=(const ParsedAttr &)=delete
void handleAttrWithDelayedArgs(Sema &S, Decl *D) const
const Expr * getReplacementExpr() const
IdentifierInfo * getPropertyDataSetter() const
bool diagnoseMutualExclusion(class Sema &S, const Decl *D) const
bool hasProcessingCache() const
SourceLocation getUnavailableLoc() const
bool diagnoseAppertainsTo(class Sema &S, const Decl *D) const
unsigned getProcessingCache() const
LangAS asOpenCLLangAS() const
If this is an OpenCL address space attribute, returns its representation in LangAS,...
bool acceptsExprPack() const
const Expr * getMessageExpr() const
const ParsedType & getMatchingCType() const
const ParsedType & getTypeArg() const
SourceLocation getStrictLoc() const
bool isSupportedByPragmaAttribute() const
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this attribute.
bool isArgIdent(unsigned Arg) const
Expr * getArgAsExpr(unsigned Arg) const
bool getMustBeNull() const
bool diagnoseMutualExclusion(class Sema &S, const Stmt *St) const
bool checkAtLeastNumArgs(class Sema &S, unsigned Num) const
Check if the attribute has at least as many args as Num.
bool isUsedAsTypeAttr() const
unsigned getNumArgMembers() const
unsigned getMaxArgs() const
bool isPragmaClangAttribute() const
True if the attribute is specified using '#pragma clang attribute'.
bool slidesFromDeclToDeclSpecLegacyBehavior() const
Returns whether a [[]] attribute, if specified ahead of a declaration, should be applied to the decl-...
AttributeCommonInfo::Kind getKind() const
void setProcessingCache(unsigned value) const
SourceLocation getMacroExpansionLoc() const
ParsedAttr(const ParsedAttr &)=delete
void getMatchRules(const LangOptions &LangOpts, SmallVectorImpl< std::pair< attr::SubjectMatchRule, bool > > &MatchRules) const
bool isParamExpr(size_t N) const
bool isArgExpr(unsigned Arg) const
bool getLayoutCompatible() const
void setUsedAsTypeAttr(bool Used=true)
bool isDeclspecPropertyAttribute() const
Is this the Microsoft __declspec(property) attribute?
bool diagnoseLangOpts(class Sema &S) const
ArgsUnion getArg(unsigned Arg) const
getArg - Return the specified argument.
SourceLocation getEllipsisLoc() const
IdentifierInfo * getPropertyDataGetter() const
void setMacroIdentifier(IdentifierInfo *MacroName, SourceLocation Loc)
Set the macro identifier info object that this parsed attribute was declared in if it was declared in...
LangAS asHLSLLangAS() const
If this is an HLSL address space attribute, returns its representation in LangAS, otherwise returns d...
void setIsPragmaClangAttribute()
bool checkAtMostNumArgs(class Sema &S, unsigned Num) const
Check if the attribute has at most as many args as Num.
const AvailabilityChange & getAvailabilityObsoleted() const
IdentifierInfo * getMacroIdentifier() const
Return the macro identifier if this attribute was declared in a macro.
static const ParsedAttributesView & none()
const ParsedAttr & front() const
bool hasMSPropertyAttr() const
const ParsedAttr & back() const
const_iterator begin() const
const ParsedAttr * getMSPropertyAttr() const
void addAll(const_iterator B, const_iterator E)
void addAllAtEnd(const_iterator B, const_iterator E)
void addAtEnd(ParsedAttr *newAttr)
void addAll(iterator B, iterator E)
bool hasAttribute(ParsedAttr::Kind K) const
ParsedAttr & operator[](SizeType pos)
const_iterator end() const
void remove(ParsedAttr *ToBeRemoved)
const ParsedAttr & operator[](SizeType pos) const
void addAllAtEnd(iterator B, iterator E)
ParsedAttributes - A collection of parsed attributes.
ParsedAttr * addNew(IdentifierInfo *attrName, SourceRange attrRange, IdentifierInfo *scopeName, SourceLocation scopeLoc, ArgsUnion *args, unsigned numArgs, ParsedAttr::Form form, SourceLocation ellipsisLoc=SourceLocation())
Add attribute with expression arguments.
void takeOneFrom(ParsedAttributes &Other, ParsedAttr *PA)
ParsedAttr * addNew(IdentifierInfo *attrName, SourceRange attrRange, IdentifierInfo *scopeName, SourceLocation scopeLoc, IdentifierLoc *Param1, IdentifierLoc *Param2, IdentifierLoc *Param3, ParsedAttr::Form form)
Add objc_bridge_related attribute.
AttributePool & getPool() const
ParsedAttr * addNew(IdentifierInfo *attrName, SourceRange attrRange, IdentifierInfo *scopeName, SourceLocation scopeLoc, IdentifierLoc *Param, const AvailabilityChange &introduced, const AvailabilityChange &deprecated, const AvailabilityChange &obsoleted, SourceLocation unavailable, const Expr *MessageExpr, ParsedAttr::Form form, SourceLocation strict, const Expr *ReplacementExpr)
Add availability attribute.
ParsedAttributes & operator=(const ParsedAttributes &)=delete
ParsedAttr * addNewPropertyAttr(IdentifierInfo *attrName, SourceRange attrRange, IdentifierInfo *scopeName, SourceLocation scopeLoc, IdentifierInfo *getterId, IdentifierInfo *setterId, ParsedAttr::Form formUsed)
Add microsoft __delspec(property) attribute.
ParsedAttributes(const ParsedAttributes &)=delete
void takeAllFrom(ParsedAttributes &Other)
ParsedAttributes(AttributeFactory &factory)
ParsedAttr * addNewTypeTagForDatatype(IdentifierInfo *attrName, SourceRange attrRange, IdentifierInfo *scopeName, SourceLocation scopeLoc, IdentifierLoc *argumentKind, ParsedType matchingCType, bool layoutCompatible, bool mustBeNull, ParsedAttr::Form form)
Add type_tag_for_datatype attribute.
ParsedAttr * addNewTypeAttr(IdentifierInfo *attrName, SourceRange attrRange, IdentifierInfo *scopeName, SourceLocation scopeLoc, ParsedType typeArg, ParsedAttr::Form formUsed, SourceLocation ellipsisLoc=SourceLocation())
Add an attribute with a single type argument.
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.
Stmt - This represents one statement.
The streaming interface shared between DiagnosticBuilder and PartialDiagnostic.
void AddTaggedVal(uint64_t V, DiagnosticsEngine::ArgumentKind Kind) const
Exposes information about the current target.
@ Decl
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
const internal::VariadicAllOfMatcher< Attr > attr
Matches attributes.
SubjectMatchRule
A list of all the recognized kinds of attributes.
AttributeDeclKind
These constants match the enumerated choices of warn_attribute_wrong_decl_type and err_attribute_wron...
@ ExpectedFunctionMethodOrParameter
@ ExpectedFunctionWithProtoType
@ ExpectedFunctionMethodOrBlock
@ ExpectedTypeOrNamespace
@ ExpectedVariableFieldOrTag
@ ExpectedVariableOrField
@ ExpectedFunctionOrMethod
@ ExpectedVariableOrFunction
@ ExpectedFunctionVariableOrClass
llvm::PointerUnion< Expr *, IdentifierLoc * > ArgsUnion
A union of the various pointer types that can be passed to an ParsedAttr as an argument.
const StreamingDiagnostic & operator<<(const StreamingDiagnostic &DB, const ASTContext::SectionInfo &Section)
Insertion operator for diagnostics.
void takeAndConcatenateAttrs(ParsedAttributes &First, ParsedAttributes &Second, ParsedAttributes &Result)
Consumes the attributes from First and Second and concatenates them into Result.
AttributeArgumentNType
These constants match the enumerated choices of err_attribute_argument_n_type and err_attribute_argum...
@ AANT_ArgumentIntegerConstant
@ AANT_ArgumentBuiltinFunction
@ AANT_ArgumentConstantExpr
@ AANT_ArgumentIdentifier
@ Result
The result type of a method or function.
LangAS
Defines the address space values used by the address space qualifier of QualType.
OpaquePtr< QualType > ParsedType
An opaque type for threading parsed type information through the parser.
@ Other
Other implicit parameter.
Represents information about a change in availability for an entity, which is part of the encoding of...
VersionTuple Version
The version number at which the change occurred.
bool isValid() const
Determine whether this availability change is valid.
SourceLocation KeywordLoc
The location of the keyword indicating the kind of change.
SourceRange VersionRange
The source range covering the version number.
Wraps an identifier and optional source location for the identifier.
static IdentifierLoc * create(ASTContext &Ctx, SourceLocation Loc, IdentifierInfo *Ident)
unsigned AttrKind
Corresponds to the Kind enum.
ParsedAttributeArgumentsProperties(uint32_t StringLiteralBits)
bool isStringLiteralArg(unsigned I) const
const_iterator(VecTy::const_iterator I)
reference operator*() const
reference operator*() const
iterator(VecTy::iterator I)
Describes the trailing object for Availability attribute in ParsedAttr.
AvailabilityData(const AvailabilityChange &Introduced, const AvailabilityChange &Deprecated, const AvailabilityChange &Obsoleted, SourceLocation Strict, const Expr *ReplaceExpr)
AvailabilityChange Changes[NumAvailabilitySlots]
IdentifierInfo * SetterId
PropertyData(IdentifierInfo *getterId, IdentifierInfo *setterId)
IdentifierInfo * GetterId
unsigned LayoutCompatible