clang
6.0.0
|
AttributeList - Represents a syntactic attribute. More...
#include "clang/Sema/AttributeList.h"
Classes | |
struct | PropertyData |
struct | TypeTagForDatatypeData |
Public Types | |
enum | Syntax { AS_GNU, AS_CXX11, AS_C2x, AS_Declspec, AS_Microsoft, AS_Keyword, AS_Pragma, AS_ContextSensitiveKeyword } |
The style used to specify an attribute. More... | |
enum | Kind { IgnoredAttribute, UnknownAttribute } |
Public Member Functions | |
IdentifierInfo * | getName () const |
SourceLocation | getLoc () const |
SourceRange | getRange () const |
bool | hasScope () const |
IdentifierInfo * | getScopeName () const |
SourceLocation | getScopeLoc () const |
bool | hasParsedType () const |
bool | isDeclspecPropertyAttribute () const |
Is this the Microsoft __declspec(property) attribute? More... | |
bool | isAlignasAttribute () const |
bool | isDeclspecAttribute () const |
bool | isMicrosoftAttribute () const |
bool | isCXX11Attribute () const |
bool | isC2xAttribute () const |
bool | isKeywordAttribute () const |
bool | isContextSensitiveKeywordAttribute () const |
bool | isInvalid () const |
void | setInvalid (bool b=true) const |
bool | hasProcessingCache () const |
unsigned | getProcessingCache () const |
void | setProcessingCache (unsigned value) const |
bool | isUsedAsTypeAttr () const |
void | setUsedAsTypeAttr () |
bool | isPackExpansion () const |
SourceLocation | getEllipsisLoc () const |
Kind | getKind () const |
AttributeList * | getNext () const |
void | setNext (AttributeList *N) |
unsigned | getNumArgs () const |
getNumArgs - Return the number of actual arguments to this attribute. More... | |
ArgsUnion | getArg (unsigned Arg) const |
getArg - Return the specified argument. More... | |
bool | isArgExpr (unsigned Arg) const |
Expr * | getArgAsExpr (unsigned Arg) const |
bool | isArgIdent (unsigned Arg) const |
IdentifierLoc * | getArgAsIdent (unsigned Arg) const |
const AvailabilityChange & | getAvailabilityIntroduced () const |
const AvailabilityChange & | getAvailabilityDeprecated () const |
const AvailabilityChange & | getAvailabilityObsoleted () const |
SourceLocation | getStrictLoc () const |
SourceLocation | getUnavailableLoc () const |
const Expr * | getMessageExpr () const |
const Expr * | getReplacementExpr () const |
const ParsedType & | getMatchingCType () const |
bool | getLayoutCompatible () const |
bool | getMustBeNull () const |
const ParsedType & | getTypeArg () const |
const PropertyData & | getPropertyData () const |
unsigned | getAttributeSpellingListIndex () const |
Get an index into the attribute spelling list defined in Attr.td. More... | |
bool | isTargetSpecificAttr () const |
bool | isTypeAttr () const |
bool | isStmtAttr () const |
bool | hasCustomParsing () const |
unsigned | getMinArgs () const |
unsigned | getMaxArgs () const |
bool | hasVariadicArg () const |
bool | diagnoseAppertainsTo (class Sema &S, const Decl *D) const |
bool | appliesToDecl (const Decl *D, attr::SubjectMatchRule MatchRule) const |
void | getMatchRules (const LangOptions &LangOpts, SmallVectorImpl< std::pair< attr::SubjectMatchRule, bool >> &MatchRules) const |
bool | diagnoseLangOpts (class Sema &S) const |
bool | existsInTarget (const TargetInfo &Target) const |
bool | isKnownToGCC () const |
bool | isSupportedByPragmaAttribute () const |
unsigned | getSemanticSpelling () const |
If the parsed attribute has a semantic equivalent, and it would have a semantic Spelling enumeration (due to having semantically-distinct spelling variations), return the value of that semantic spelling. More... | |
Static Public Member Functions | |
static Kind | getKind (const IdentifierInfo *Name, const IdentifierInfo *Scope, Syntax SyntaxUsed) |
Friends | |
class | AttributePool |
class | AttributeFactory |
AttributeList - Represents a syntactic attribute.
For a GNU attribute, there are four forms of this construct:
1: attribute(( const )). ParmName/Args/NumArgs will all be unused. 2: attribute(( mode(byte) )). ParmName used, Args/NumArgs unused. 3: attribute(( format(printf, 1, 2) )). ParmName/Args/NumArgs all used. 4: attribute(( aligned(16) )). ParmName is unused, Args/Num used.
Definition at line 95 of file AttributeList.h.
Enumerator | |
---|---|
IgnoredAttribute | |
UnknownAttribute |
Definition at line 350 of file AttributeList.h.
The style used to specify an attribute.
Definition at line 98 of file AttributeList.h.
bool AttributeList::appliesToDecl | ( | const Decl * | D, |
attr::SubjectMatchRule | MatchRule | ||
) | const |
Definition at line 201 of file AttributeList.cpp.
Referenced by clang::Sema::AddPragmaAttributes().
Definition at line 197 of file AttributeList.cpp.
Definition at line 213 of file AttributeList.cpp.
bool AttributeList::existsInTarget | ( | const TargetInfo & | Target | ) | const |
Definition at line 229 of file AttributeList.cpp.
References ParsedAttrInfo::ExistsInTarget, and getInfo().
Referenced by clang::Sema::CheckNoCallerSavedRegsAttr().
|
inline |
getArg - Return the specified argument.
Definition at line 424 of file AttributeList.h.
|
inline |
Definition at line 432 of file AttributeList.h.
Referenced by clang::Sema::CheckRegparmAttr(), clang::Sema::checkStringLiteralArgumentAttr(), fillAttributedTypeLoc(), fillDependentAddressSpaceTypeLoc(), getCCTypeAttrKind(), HandleAddressSpaceTypeAttribute(), HandleExtVectorTypeAttr(), HandleNeonVectorTypeAttr(), and HandleVectorSizeAttr().
|
inline |
Definition at line 439 of file AttributeList.h.
Referenced by clang::Sema::checkStringLiteralArgumentAttr(), fillAttributedTypeLoc(), getCCTypeAttrKind(), HandleAddressSpaceTypeAttribute(), HandleExtVectorTypeAttr(), handleObjCGCTypeAttr(), and handleObjCOwnershipTypeAttr().
unsigned AttributeList::getAttributeSpellingListIndex | ( | ) | const |
Get an index into the attribute spelling list defined in Attr.td.
This index is used by an attribute to pretty print itself.
Definition at line 146 of file AttributeList.cpp.
|
inline |
Definition at line 448 of file AttributeList.h.
References getKind().
|
inline |
Definition at line 443 of file AttributeList.h.
References getKind().
|
inline |
Definition at line 453 of file AttributeList.h.
References getKind().
|
inline |
Definition at line 411 of file AttributeList.h.
|
inline |
Definition at line 413 of file AttributeList.h.
References getKind().
Referenced by attributeParsedArgsUnevaluated(), clang::Sema::CheckCallingConvAttr(), distributeNullabilityTypeAttr(), distributeObjCPointerTypeAttr(), fillAttributedTypeLoc(), fillDependentAddressSpaceTypeLoc(), getCCTypeAttrKind(), getInfo(), HandleAddressSpaceTypeAttribute(), handleFunctionTypeAttr(), handleMSPointerTypeQualifierAttr(), handleObjCPointerTypeAttr(), clang::Sema::IdentifyCUDATarget(), IsBuiltInOrStandardCXX11Attribute(), processTypeAttrs(), and clang::DeclSpec::SetConstexprSpec().
|
static |
Definition at line 126 of file AttributeList.cpp.
|
inline |
Definition at line 484 of file AttributeList.h.
References getKind().
|
inline |
Definition at line 359 of file AttributeList.h.
References clang::SourceRange::getBegin().
Referenced by clang::Sema::ActOnPragmaAttributePop(), distributeNullabilityTypeAttr(), fillAttributedTypeLoc(), fillDependentAddressSpaceTypeLoc(), getAttrLoc(), HandleAddressSpaceTypeAttribute(), HandleExtVectorTypeAttr(), handleFunctionTypeAttr(), handleMSPointerTypeQualifierAttr(), HandleNeonVectorTypeAttr(), handleObjCGCTypeAttr(), handleObjCOwnershipTypeAttr(), HandleOpenCLAccessAttr(), HandleVectorSizeAttr(), clang::Parser::ParseTopLevelDecl(), and processTypeAttrs().
|
inline |
Definition at line 478 of file AttributeList.h.
References getKind().
void AttributeList::getMatchRules | ( | const LangOptions & | LangOpts, |
SmallVectorImpl< std::pair< attr::SubjectMatchRule, bool >> & | MatchRules | ||
) | const |
Definition at line 206 of file AttributeList.cpp.
References getInfo(), and ParsedAttrInfo::GetPragmaAttributeMatchRules.
Referenced by clang::Sema::ActOnPragmaAttributePush().
unsigned AttributeList::getMaxArgs | ( | ) | const |
Definition at line 189 of file AttributeList.cpp.
References getInfo(), and ParsedAttrInfo::OptArgs.
Referenced by IsBuiltInOrStandardCXX11Attribute().
|
inline |
Definition at line 468 of file AttributeList.h.
References getKind().
unsigned AttributeList::getMinArgs | ( | ) | const |
Definition at line 185 of file AttributeList.cpp.
References getInfo(), and ParsedAttrInfo::NumArgs.
|
inline |
Definition at line 490 of file AttributeList.h.
References getKind().
|
inline |
Definition at line 358 of file AttributeList.h.
Referenced by clang::Sema::ActOnPragmaAttributePop(), clang::Sema::ActOnPragmaAttributePush(), clang::Sema::checkStringLiteralArgumentAttr(), distributeNullabilityTypeAttr(), getAttrName(), HandleAddressSpaceTypeAttribute(), HandleExtVectorTypeAttr(), handleMSPointerTypeQualifierAttr(), HandleNeonVectorTypeAttr(), handleObjCGCTypeAttr(), handleObjCOwnershipTypeAttr(), HandleVectorSizeAttr(), clang::Parser::ParseTopLevelDecl(), and processTypeAttrs().
|
inline |
Definition at line 417 of file AttributeList.h.
Referenced by clang::Sema::ActOnFinishCXXMemberSpecification(), clang::ParsedAttributes::add(), clang::ParsedAttributes::addAll(), clang::ParsedAttributes::addAllAtEnd(), addConstexprToLambdaDeclSpecifier(), clang::Sema::AddPragmaAttributes(), distributeTypeAttrsFromDeclarator(), fillAttributedTypeLoc(), fillDependentAddressSpaceTypeLoc(), clang::Declarator::getCXX11AttributeRanges(), getMSPropertyAttr(), hasNullabilityAttr(), clang::Sema::IdentifyCUDATarget(), inferARCWriteback(), clang::Parser::ParseTopLevelDecl(), clang::Sema::ProcessAccessDeclAttributeList(), processTypeAttrs(), clang::DeclSpec::SetConstexprSpec(), spliceAttrOutOfList(), takeDeclAttributes(), and transferARCOwnershipToDeclaratorChunk().
|
inline |
getNumArgs - Return the number of actual arguments to this attribute.
Definition at line 421 of file AttributeList.h.
Referenced by getNumAttributeArgs(), HandleAddressSpaceTypeAttribute(), HandleExtVectorTypeAttr(), handleFunctionTypeAttr(), HandleNeonVectorTypeAttr(), handleObjCGCTypeAttr(), and HandleVectorSizeAttr().
|
inline |
Definition at line 398 of file AttributeList.h.
Referenced by clang::Sema::CheckCallingConvAttr().
|
inline |
Definition at line 501 of file AttributeList.h.
|
inline |
Definition at line 360 of file AttributeList.h.
Referenced by clang::Declarator::getCXX11AttributeRanges().
|
inline |
Definition at line 473 of file AttributeList.h.
References getKind().
|
inline |
Definition at line 364 of file AttributeList.h.
|
inline |
Definition at line 363 of file AttributeList.h.
Referenced by processTypeAttrs().
unsigned AttributeList::getSemanticSpelling | ( | ) | const |
If the parsed attribute has a semantic equivalent, and it would have a semantic Spelling enumeration (due to having semantically-distinct spelling variations), return the value of that semantic spelling.
If the parsed attribute does not have a semantic equivalent, or would not have a Spelling enumeration, the value UINT_MAX is returned.
Definition at line 241 of file AttributeList.cpp.
References getInfo(), and ParsedAttrInfo::SpellingIndexToSemanticSpelling.
Referenced by HandleOpenCLAccessAttr().
|
inline |
Definition at line 458 of file AttributeList.h.
References getKind().
|
inline |
Definition at line 496 of file AttributeList.h.
|
inline |
Definition at line 463 of file AttributeList.h.
References getKind().
bool AttributeList::hasCustomParsing | ( | ) | const |
Definition at line 193 of file AttributeList.cpp.
References getInfo(), and ParsedAttrInfo::HasCustomParsing.
|
inline |
Definition at line 366 of file AttributeList.h.
Referenced by getNumAttributeArgs().
|
inline |
Definition at line 397 of file AttributeList.h.
Referenced by clang::Sema::CheckCallingConvAttr().
|
inline |
Definition at line 362 of file AttributeList.h.
bool AttributeList::hasVariadicArg | ( | ) | const |
Definition at line 245 of file AttributeList.cpp.
References getInfo(), and ParsedAttrInfo::OptArgs.
|
inline |
Definition at line 373 of file AttributeList.h.
References getKind().
|
inline |
Definition at line 429 of file AttributeList.h.
Referenced by fillAttributedTypeLoc(), and getCCTypeAttrKind().
|
inline |
Definition at line 436 of file AttributeList.h.
Referenced by clang::Sema::checkStringLiteralArgumentAttr(), fillAttributedTypeLoc(), HandleAddressSpaceTypeAttribute(), HandleExtVectorTypeAttr(), handleObjCGCTypeAttr(), and handleObjCOwnershipTypeAttr().
|
inline |
Definition at line 383 of file AttributeList.h.
|
inline |
Definition at line 390 of file AttributeList.h.
Referenced by distributeNullabilityTypeAttr(), and processTypeAttrs().
|
inline |
Definition at line 380 of file AttributeList.h.
Referenced by distributeFunctionTypeAttrFromDeclSpec(), clang::Declarator::getCXX11AttributeRanges(), clang::Parser::ParseTopLevelDecl(), and processTypeAttrs().
|
inline |
Definition at line 378 of file AttributeList.h.
|
inline |
Is this the Microsoft __declspec(property) attribute?
Definition at line 369 of file AttributeList.h.
|
inline |
Definition at line 394 of file AttributeList.h.
Referenced by clang::Sema::CheckCallingConvAttr(), clang::Sema::CheckRegparmAttr(), getCCTypeAttrKind(), and processTypeAttrs().
|
inline |
Definition at line 386 of file AttributeList.h.
bool AttributeList::isKnownToGCC | ( | ) | const |
Definition at line 233 of file AttributeList.cpp.
References getInfo(), and ParsedAttrInfo::IsKnownToGCC.
Referenced by clang::Parser::ParseTopLevelDecl().
|
inline |
Definition at line 379 of file AttributeList.h.
|
inline |
Definition at line 410 of file AttributeList.h.
References clang::SourceLocation::isValid().
bool AttributeList::isStmtAttr | ( | ) | const |
Definition at line 225 of file AttributeList.cpp.
References getInfo(), and ParsedAttrInfo::IsStmt.
bool AttributeList::isSupportedByPragmaAttribute | ( | ) | const |
Definition at line 237 of file AttributeList.cpp.
References getInfo(), and ParsedAttrInfo::IsSupportedByPragmaAttribute.
bool AttributeList::isTargetSpecificAttr | ( | ) | const |
Definition at line 217 of file AttributeList.cpp.
References getInfo(), and ParsedAttrInfo::IsTargetSpecific.
bool AttributeList::isTypeAttr | ( | ) | const |
Definition at line 221 of file AttributeList.cpp.
References getInfo(), and ParsedAttrInfo::IsType.
|
inline |
Definition at line 407 of file AttributeList.h.
Referenced by takeDeclAttributes().
Definition at line 395 of file AttributeList.h.
Referenced by clang::Sema::CheckCallingConvAttr(), clang::Sema::CheckNoReturnAttr(), clang::Sema::CheckRegparmAttr(), HandleAddressSpaceTypeAttribute(), handleFunctionTypeAttr(), HandleNeonVectorTypeAttr(), handleObjCGCTypeAttr(), handleObjCOwnershipTypeAttr(), HandleOpenCLAccessAttr(), HandleVectorSizeAttr(), IsBuiltInOrStandardCXX11Attribute(), and processTypeAttrs().
|
inline |
Definition at line 418 of file AttributeList.h.
Referenced by clang::ParsedAttributes::add(), clang::ParsedAttributes::addAll(), clang::ParsedAttributes::addAllAtEnd(), spliceAttrIntoList(), spliceAttrOutOfList(), and takeDeclAttributes().
|
inline |
Definition at line 402 of file AttributeList.h.
|
inline |
Definition at line 408 of file AttributeList.h.
Referenced by processTypeAttrs().
|
friend |
Definition at line 347 of file AttributeList.h.
|
friend |
Definition at line 346 of file AttributeList.h.