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"
88 LLVM_PREFERRED_TYPE(
bool)
90 LLVM_PREFERRED_TYPE(
bool)
97 : GetterId(getterId), SetterId(setterId) {}
113using ArgsUnion = llvm::PointerUnion<Expr *, IdentifierLoc *>;
127 private llvm::TrailingObjects<
128 ParsedAttr, ArgsUnion, detail::AvailabilityData,
129 detail::TypeTagForDatatypeData, ParsedType, detail::PropertyData> {
130 friend TrailingObjects;
132 size_t numTrailingObjects(OverloadToken<ArgsUnion>)
const {
return NumArgs; }
133 size_t numTrailingObjects(OverloadToken<detail::AvailabilityData>)
const {
134 return IsAvailability;
137 numTrailingObjects(OverloadToken<detail::TypeTagForDatatypeData>)
const {
138 return IsTypeTagForDatatype;
140 size_t numTrailingObjects(OverloadToken<ParsedType>)
const {
141 return HasParsedType;
143 size_t numTrailingObjects(OverloadToken<detail::PropertyData>)
const {
154 unsigned NumArgs : 16;
157 LLVM_PREFERRED_TYPE(
bool)
158 mutable unsigned Invalid : 1;
161 LLVM_PREFERRED_TYPE(
bool)
162 mutable unsigned UsedAsTypeAttr : 1;
166 LLVM_PREFERRED_TYPE(
bool)
167 unsigned IsAvailability : 1;
171 LLVM_PREFERRED_TYPE(
bool)
172 unsigned IsTypeTagForDatatype : 1;
176 LLVM_PREFERRED_TYPE(
bool)
177 unsigned IsProperty : 1;
180 LLVM_PREFERRED_TYPE(
bool)
181 unsigned HasParsedType : 1;
184 LLVM_PREFERRED_TYPE(
bool)
185 mutable unsigned HasProcessingCache : 1;
188 mutable unsigned ProcessingCache : 8;
191 LLVM_PREFERRED_TYPE(
bool)
192 mutable unsigned IsPragmaClangAttribute : 1;
198 const Expr *MessageExpr;
202 ArgsUnion *getArgsBuffer() {
return getTrailingObjects<ArgsUnion>(); }
204 return getTrailingObjects<ArgsUnion>();
208 return getTrailingObjects<detail::AvailabilityData>();
211 return getTrailingObjects<detail::AvailabilityData>();
224 EllipsisLoc(ellipsisLoc), NumArgs(numArgs), Invalid(
false),
227 HasProcessingCache(
false), IsPragmaClangAttribute(
false),
242 NumArgs(1), Invalid(
false), UsedAsTypeAttr(
false), IsAvailability(
true),
244 HasProcessingCache(
false), IsPragmaClangAttribute(
false),
245 UnavailableLoc(unavailable), MessageExpr(messageExpr),
249 new (getAvailabilityData())
251 replacementExpr, environmentLoc);
255 ParsedAttr(IdentifierInfo *attrName, SourceRange attrRange,
256 IdentifierInfo *scopeName, SourceLocation scopeLoc,
257 IdentifierLoc *Parm1, IdentifierLoc *Parm2, IdentifierLoc *Parm3,
259 : AttributeCommonInfo(attrName, scopeName, attrRange, scopeLoc, formUsed),
260 NumArgs(3), Invalid(
false), UsedAsTypeAttr(
false),
262 HasParsedType(
false), HasProcessingCache(
false),
263 IsPragmaClangAttribute(
false), Info(ParsedAttrInfo::get(*this)) {
264 ArgsUnion *Args = getArgsBuffer();
271 ParsedAttr(IdentifierInfo *attrName, SourceRange attrRange,
272 IdentifierInfo *scopeName, SourceLocation scopeLoc,
273 IdentifierLoc *ArgKind, ParsedType matchingCType,
274 bool layoutCompatible,
bool mustBeNull, Form formUsed)
275 : AttributeCommonInfo(attrName, scopeName, attrRange, scopeLoc, formUsed),
277 IsAvailability(
false), IsTypeTagForDatatype(
true), IsProperty(
false),
278 HasParsedType(
false), HasProcessingCache(
false),
279 IsPragmaClangAttribute(
false), Info(ParsedAttrInfo::get(*this)) {
281 memcpy(getArgsBuffer(), &PVal,
sizeof(ArgsUnion));
282 detail::TypeTagForDatatypeData &ExtraData = getTypeTagForDatatypeDataSlot();
283 new (&ExtraData.MatchingCType)
ParsedType(matchingCType);
284 ExtraData.LayoutCompatible = layoutCompatible;
285 ExtraData.MustBeNull = mustBeNull;
289 ParsedAttr(IdentifierInfo *attrName, SourceRange attrRange,
290 IdentifierInfo *scopeName, SourceLocation scopeLoc,
291 ParsedType typeArg, Form formUsed, SourceLocation ellipsisLoc)
292 : AttributeCommonInfo(attrName, scopeName, attrRange, scopeLoc, formUsed),
295 IsTypeTagForDatatype(
false), IsProperty(
false), HasParsedType(
true),
296 HasProcessingCache(
false), IsPragmaClangAttribute(
false),
297 Info(ParsedAttrInfo::get(*this)) {
302 ParsedAttr(IdentifierInfo *attrName, SourceRange attrRange,
303 IdentifierInfo *scopeName, SourceLocation scopeLoc,
304 IdentifierInfo *getterId, IdentifierInfo *setterId, Form formUsed)
305 : AttributeCommonInfo(attrName, scopeName, attrRange, scopeLoc, formUsed),
307 IsAvailability(
false), IsTypeTagForDatatype(
false), IsProperty(
true),
308 HasParsedType(
false), HasProcessingCache(
false),
309 IsPragmaClangAttribute(
false), Info(ParsedAttrInfo::get(*this)) {
310 new (&getPropertyDataBuffer()) detail::PropertyData(getterId, setterId);
316 detail::TypeTagForDatatypeData &getTypeTagForDatatypeDataSlot() {
317 return *getTrailingObjects<detail::TypeTagForDatatypeData>();
319 const detail::TypeTagForDatatypeData &getTypeTagForDatatypeDataSlot()
const {
320 return *getTrailingObjects<detail::TypeTagForDatatypeData>();
325 ParsedType &getTypeBuffer() {
return *getTrailingObjects<ParsedType>(); }
327 return *getTrailingObjects<ParsedType>();
332 detail::PropertyData &getPropertyDataBuffer() {
334 return *getTrailingObjects<detail::PropertyData>();
336 const detail::PropertyData &getPropertyDataBuffer()
const {
338 return *getTrailingObjects<detail::PropertyData>();
341 size_t allocated_size()
const;
350 void operator delete(
void *) =
delete;
365 assert(hasProcessingCache());
366 return ProcessingCache;
370 ProcessingCache = value;
371 HasProcessingCache =
true;
390 assert(Arg < NumArgs &&
"Arg access out of range!");
391 return getArgsBuffer()[Arg];
395 return Arg < NumArgs && getArg(Arg).is<
Expr*>();
399 return getArg(Arg).get<
Expr*>();
411 assert(getParsedKind() == AT_Availability &&
412 "Not an availability attribute");
413 return getAvailabilityData()->Changes[detail::IntroducedSlot];
417 assert(getParsedKind() == AT_Availability &&
418 "Not an availability attribute");
419 return getAvailabilityData()->Changes[detail::DeprecatedSlot];
423 assert(getParsedKind() == AT_Availability &&
424 "Not an availability attribute");
425 return getAvailabilityData()->Changes[detail::ObsoletedSlot];
429 assert(getParsedKind() == AT_Availability &&
430 "Not an availability attribute");
431 return getAvailabilityData()->StrictLoc;
435 assert(getParsedKind() == AT_Availability &&
436 "Not an availability attribute");
437 return UnavailableLoc;
441 assert(getParsedKind() == AT_Availability &&
442 "Not an availability attribute");
447 assert(getParsedKind() == AT_Availability &&
448 "Not an availability attribute");
449 return getAvailabilityData()->Replacement;
453 assert(getParsedKind() == AT_Availability &&
454 "Not an availability attribute");
455 return getAvailabilityData()->EnvironmentLoc;
459 assert(getParsedKind() == AT_TypeTagForDatatype &&
460 "Not a type_tag_for_datatype attribute");
461 return getTypeTagForDatatypeDataSlot().MatchingCType;
465 assert(getParsedKind() == AT_TypeTagForDatatype &&
466 "Not a type_tag_for_datatype attribute");
467 return getTypeTagForDatatypeDataSlot().LayoutCompatible;
471 assert(getParsedKind() == AT_TypeTagForDatatype &&
472 "Not a type_tag_for_datatype attribute");
473 return getTypeTagForDatatypeDataSlot().MustBeNull;
477 assert(HasParsedType &&
"Not a type attribute");
478 return getTypeBuffer();
482 assert(isDeclspecPropertyAttribute() &&
483 "Not a __delcspec(property) attribute");
484 return getPropertyDataBuffer().GetterId;
488 assert(isDeclspecPropertyAttribute() &&
489 "Not a __delcspec(property) attribute");
490 return getPropertyDataBuffer().SetterId;
498 MacroExpansionLoc =
Loc;
509 assert(hasMacroIdentifier() &&
"Can only get the macro expansion location "
510 "if this attribute has a macro identifier.");
511 return MacroExpansionLoc;
516 bool checkExactlyNumArgs(
class Sema &S,
unsigned Num)
const;
519 bool checkAtLeastNumArgs(
class Sema &S,
unsigned Num)
const;
522 bool checkAtMostNumArgs(
class Sema &S,
unsigned Num)
const;
524 bool isTargetSpecificAttr()
const;
525 bool isTypeAttr()
const;
526 bool isStmtAttr()
const;
528 bool hasCustomParsing()
const;
529 bool acceptsExprPack()
const;
530 bool isParamExpr(
size_t N)
const;
531 unsigned getMinArgs()
const;
532 unsigned getMaxArgs()
const;
533 unsigned getNumArgMembers()
const;
534 bool hasVariadicArg()
const;
535 void handleAttrWithDelayedArgs(
Sema &S,
Decl *
D)
const;
536 bool diagnoseAppertainsTo(
class Sema &S,
const Decl *
D)
const;
537 bool diagnoseAppertainsTo(
class Sema &S,
const Stmt *St)
const;
538 bool diagnoseMutualExclusion(
class Sema &S,
const Decl *
D)
const;
549 bool diagnoseLangOpts(
class Sema &S)
const;
551 bool isKnownToGCC()
const;
552 bool isSupportedByPragmaAttribute()
const;
564 bool slidesFromDeclToDeclSpecLegacyBehavior()
const;
571 unsigned getSemanticSpelling()
const;
576 switch (getParsedKind()) {
577 case ParsedAttr::AT_OpenCLConstantAddressSpace:
578 return LangAS::opencl_constant;
579 case ParsedAttr::AT_OpenCLGlobalAddressSpace:
580 return LangAS::opencl_global;
581 case ParsedAttr::AT_OpenCLGlobalDeviceAddressSpace:
582 return LangAS::opencl_global_device;
583 case ParsedAttr::AT_OpenCLGlobalHostAddressSpace:
584 return LangAS::opencl_global_host;
585 case ParsedAttr::AT_OpenCLLocalAddressSpace:
586 return LangAS::opencl_local;
587 case ParsedAttr::AT_OpenCLPrivateAddressSpace:
588 return LangAS::opencl_private;
589 case ParsedAttr::AT_OpenCLGenericAddressSpace:
590 return LangAS::opencl_generic;
592 return LangAS::Default;
600 case ParsedAttr::AT_OpenCLGlobalAddressSpace:
601 return LangAS::sycl_global;
602 case ParsedAttr::AT_OpenCLGlobalDeviceAddressSpace:
603 return LangAS::sycl_global_device;
604 case ParsedAttr::AT_OpenCLGlobalHostAddressSpace:
605 return LangAS::sycl_global_host;
606 case ParsedAttr::AT_OpenCLLocalAddressSpace:
607 return LangAS::sycl_local;
608 case ParsedAttr::AT_OpenCLPrivateAddressSpace:
609 return LangAS::sycl_private;
610 case ParsedAttr::AT_OpenCLGenericAddressSpace:
612 return LangAS::Default;
619 switch (getParsedKind()) {
620 case ParsedAttr::AT_HLSLGroupSharedAddressSpace:
621 return LangAS::hlsl_groupshared;
623 return LangAS::Default;
642 AvailabilityAllocSize =
646 TypeTagForDatatypeAllocSize =
663 InlineFreeListsCapacity =
664 1 + (AvailabilityAllocSize -
sizeof(
ParsedAttr)) /
sizeof(
void *)
667 llvm::BumpPtrAllocator Alloc;
671 SmallVector<SmallVector<ParsedAttr *, 8>, InlineFreeListsCapacity> FreeLists;
677 void *allocate(
size_t size);
700 void *allocate(
size_t size) {
701 return Factory.allocate(size);
705 Attrs.push_back(attr);
709 void remove(ParsedAttr *attr) {
710 assert(llvm::is_contained(Attrs, attr) &&
711 "Can't take attribute from a pool that doesn't own it!");
712 Attrs.erase(llvm::find(Attrs, attr));
715 void takePool(AttributePool &pool);
738 Factory.reclaimPool(*
this);
756 void *memory = allocate(
761 return add(
new (memory)
ParsedAttr(attrName, attrRange, scopeName, scopeLoc,
762 args, numArgs, form, ellipsisLoc));
772 const Expr *ReplacementExpr,
774 void *memory = allocate(AttributeFactory::AvailabilityAllocSize);
775 return add(
new (memory)
ParsedAttr(attrName, attrRange, scopeName, scopeLoc,
776 Param, introduced, deprecated, obsoleted,
777 unavailable, MessageExpr, form, strict,
778 ReplacementExpr, EnvironmentLoc));
785 void *memory = allocate(
789 return add(
new (memory)
ParsedAttr(attrName, attrRange, scopeName, scopeLoc,
790 Param1, Param2, Param3, form));
797 ParsedType matchingCType,
bool layoutCompatible,
799 void *memory = allocate(AttributeFactory::TypeTagForDatatypeAllocSize);
800 return add(
new (memory)
ParsedAttr(attrName, attrRange, scopeName, scopeLoc,
801 argumentKind, matchingCType,
802 layoutCompatible, mustBeNull, form));
811 void *memory = allocate(
815 return add(
new (memory)
ParsedAttr(attrName, attrRange, scopeName, scopeLoc,
816 typeArg, formUsed, ellipsisLoc));
824 void *memory = allocate(AttributeFactory::PropertyAllocSize);
825 return add(
new (memory)
ParsedAttr(attrName, attrRange, scopeName, scopeLoc,
826 getterId, setterId, formUsed));
833 using SizeType =
decltype(std::declval<VecTy>().size());
843 bool empty()
const {
return AttrList.empty(); }
844 SizeType
size()
const {
return AttrList.size(); }
850 AttrList.push_back(newAttr);
854 assert(is_contained(AttrList, ToBeRemoved) &&
855 "Cannot remove attribute that isn't in the list");
856 AttrList.erase(llvm::find(AttrList, ToBeRemoved));
861 struct iterator : llvm::iterator_adaptor_base<iterator, VecTy::iterator,
862 std::random_access_iterator_tag,
865 iterator(VecTy::iterator I) : iterator_adaptor_base(I) {}
870 : llvm::iterator_adaptor_base<const_iterator, VecTy::const_iterator,
871 std::random_access_iterator_tag,
881 AttrList.insert(AttrList.begin(), B.I,
E.I);
885 AttrList.insert(AttrList.begin(), B.I,
E.I);
889 AttrList.insert(AttrList.end(), B.I,
E.I);
893 AttrList.insert(AttrList.end(), B.I,
E.I);
903 return *AttrList.front();
907 return *AttrList.front();
911 return *AttrList.back();
915 return *AttrList.back();
919 return llvm::any_of(AttrList, [K](
const ParsedAttr *AL) {
925 auto It = llvm::find_if(AttrList, [](
const ParsedAttr *AL) {
928 if (It != AttrList.end())
940 : StringLiterals(StringLiteralBits) {}
943 if (I >= StringLiterals.size())
944 return StringLiterals.test(StringLiterals.size() - 1);
945 return StringLiterals.test(I);
949 std::bitset<32> StringLiterals;
968 assert(&
Other !=
this &&
969 "ParsedAttributes can't take attributes from itself");
971 Other.clearListOnly();
972 pool.takeAllFrom(
Other.pool);
976 assert(&
Other !=
this &&
977 "ParsedAttributes can't take attribute from itself");
978 Other.getPool().remove(PA);
995 ParsedAttr *
attr = pool.create(attrName, attrRange, scopeName, scopeLoc,
996 args, numArgs, form, ellipsisLoc);
1009 const Expr *ReplacementExpr,
1012 pool.create(attrName, attrRange, scopeName, scopeLoc, Param, introduced,
1013 deprecated, obsoleted, unavailable, MessageExpr, form,
1014 strict, ReplacementExpr, EnvironmentLoc);
1024 ParsedAttr *
attr = pool.create(attrName, attrRange, scopeName, scopeLoc,
1025 Param1, Param2, Param3, form);
1035 ParsedType matchingCType,
bool layoutCompatible,
1038 attrName, attrRange, scopeName, scopeLoc, argumentKind, matchingCType,
1039 layoutCompatible, mustBeNull, form);
1050 pool.createTypeAttribute(attrName, attrRange, scopeName, scopeLoc,
1051 typeArg, formUsed, ellipsisLoc);
1063 attrName, attrRange, scopeName, scopeLoc, getterId, setterId, formUsed);
1075 ParsedAttributes &
Result);
1127 std::enable_if_t<std::is_same<ACI, AttributeCommonInfo>::value,
int> = 0>
1130 DB.
AddTaggedVal(
reinterpret_cast<uint64_t
>(CI.getAttrName()),
1137 std::enable_if_t<std::is_same<ACI, AttributeCommonInfo>::value,
int> = 0>
1140 DB.
AddTaggedVal(
reinterpret_cast<uint64_t
>(CI->getAttrName()),
Defines the Diagnostic-related interfaces.
static Decl::Kind getKind(const Decl *D)
llvm::MachO::Target Target
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 ...
const IdentifierInfo * getAttrName() const
Kind getParsedKind() const
A factory, from which one makes pools, from which one creates individual attributes which are dealloc...
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 * 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.
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, IdentifierLoc *EnvironmentLoc)
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
ParsedAttr(ParsedAttr &&)=delete
LangAS asSYCLLangAS() const
If this is an OpenCL address space attribute, returns its SYCL representation in LangAS,...
IdentifierLoc * getArgAsIdent(unsigned Arg) const
bool hasParsedType() const
const AvailabilityChange & getAvailabilityIntroduced() const
void setInvalid(bool b=true) 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
const Expr * getReplacementExpr() const
IdentifierInfo * getPropertyDataSetter() const
bool hasProcessingCache() const
SourceLocation getUnavailableLoc() const
unsigned getProcessingCache() const
const IdentifierLoc * getEnvironment() const
LangAS asOpenCLLangAS() const
If this is an OpenCL address space attribute, returns its representation in LangAS,...
const Expr * getMessageExpr() const
const ParsedType & getMatchingCType() const
const ParsedType & getTypeArg() const
SourceLocation getStrictLoc() 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 isUsedAsTypeAttr() const
bool isPragmaClangAttribute() const
True if the attribute is specified using '#pragma clang attribute'.
AttributeCommonInfo::Kind getKind() const
void setProcessingCache(unsigned value) const
SourceLocation getMacroExpansionLoc() const
ParsedAttr(const ParsedAttr &)=delete
bool isArgExpr(unsigned Arg) const
bool getLayoutCompatible() const
void setUsedAsTypeAttr(bool Used=true)
bool isDeclspecPropertyAttribute() const
Is this the Microsoft __declspec(property) attribute?
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()
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
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.
ParsedAttributes(ParsedAttributes &&G)=default
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, IdentifierLoc *EnvironmentLoc)
Add availability attribute.
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.
The JSON file list parser is used to communicate input to InstallAPI.
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.
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, const IdentifierLoc *EnvironmentLoc)
const IdentifierLoc * EnvironmentLoc
AvailabilityChange Changes[NumAvailabilitySlots]
PropertyData(IdentifierInfo *getterId, IdentifierInfo *setterId)
IdentifierInfo * GetterId
unsigned LayoutCompatible