clang
7.0.0
|
ParsedAttr - Represents a syntactic attribute. More...
#include "clang/Sema/ParsedAttr.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 | |
ParsedAttr (const ParsedAttr &)=delete | |
ParsedAttr & | operator= (const ParsedAttr &)=delete |
~ParsedAttr ()=delete | |
void | operator delete (void *)=delete |
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 |
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 | AttributeFactory |
class | AttributePool |
ParsedAttr - 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 105 of file ParsedAttr.h.
Enumerator | |
---|---|
IgnoredAttribute | |
UnknownAttribute |
Definition at line 355 of file ParsedAttr.h.
The style used to specify an attribute.
Definition at line 108 of file ParsedAttr.h.
|
delete |
|
delete |
bool ParsedAttr::appliesToDecl | ( | const Decl * | D, |
attr::SubjectMatchRule | MatchRule | ||
) | const |
Definition at line 191 of file ParsedAttr.cpp.
Referenced by clang::Sema::AddPragmaAttributes().
Definition at line 187 of file ParsedAttr.cpp.
Referenced by HandleLifetimeBoundAttr().
Definition at line 203 of file ParsedAttr.cpp.
bool ParsedAttr::existsInTarget | ( | const TargetInfo & | Target | ) | const |
Definition at line 215 of file ParsedAttr.cpp.
References ParsedAttrInfo::ExistsInTarget, and getInfo().
Referenced by clang::Sema::CheckAttrTarget().
|
inline |
getArg - Return the specified argument.
Definition at line 431 of file ParsedAttr.h.
|
inline |
Definition at line 440 of file ParsedAttr.h.
Referenced by clang::Sema::CheckRegparmAttr(), clang::Sema::checkStringLiteralArgumentAttr(), getCCTypeAttrKind(), HandleAddressSpaceTypeAttribute(), HandleExtVectorTypeAttr(), HandleNeonVectorTypeAttr(), HandleVectorSizeAttr(), and setAttributedTypeLoc().
|
inline |
Definition at line 448 of file ParsedAttr.h.
Referenced by clang::Sema::checkStringLiteralArgumentAttr(), getCCTypeAttrKind(), HandleAddressSpaceTypeAttribute(), HandleExtVectorTypeAttr(), handleObjCGCTypeAttr(), handleObjCOwnershipTypeAttr(), HandleVectorSizeAttr(), and setAttributedTypeLoc().
unsigned ParsedAttr::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 137 of file ParsedAttr.cpp.
|
inline |
Definition at line 457 of file ParsedAttr.h.
References getKind().
|
inline |
Definition at line 452 of file ParsedAttr.h.
References getKind().
|
inline |
Definition at line 462 of file ParsedAttr.h.
References getKind().
|
inline |
Definition at line 421 of file ParsedAttr.h.
|
inline |
Definition at line 423 of file ParsedAttr.h.
References getKind().
Referenced by attributeParsedArgsUnevaluated(), clang::Sema::CheckCallingConvAttr(), distributeNullabilityTypeAttr(), distributeObjCPointerTypeAttr(), getCCTypeAttrKind(), getInfo(), HandleAddressSpaceTypeAttribute(), handleFunctionTypeAttr(), handleMSPointerTypeQualifierAttr(), handleObjCPointerTypeAttr(), clang::ParsedAttributesView::hasAttribute(), and IsBuiltInOrStandardCXX11Attribute().
|
static |
Definition at line 117 of file ParsedAttr.cpp.
|
inline |
Definition at line 493 of file ParsedAttr.h.
References getKind().
|
inline |
Definition at line 364 of file ParsedAttr.h.
References clang::SourceRange::getBegin().
Referenced by clang::Sema::ActOnPragmaAttributePop(), distributeNullabilityTypeAttr(), getAttrLoc(), HandleAddressSpaceTypeAttribute(), HandleExtVectorTypeAttr(), handleFunctionTypeAttr(), handleMSPointerTypeQualifierAttr(), HandleNeonVectorTypeAttr(), handleObjCGCTypeAttr(), handleObjCOwnershipTypeAttr(), HandleOpenCLAccessAttr(), HandleVectorSizeAttr(), and setAttributedTypeLoc().
|
inline |
Definition at line 487 of file ParsedAttr.h.
References getKind().
void ParsedAttr::getMatchRules | ( | const LangOptions & | LangOpts, |
SmallVectorImpl< std::pair< attr::SubjectMatchRule, bool >> & | MatchRules | ||
) | const |
Definition at line 196 of file ParsedAttr.cpp.
References getInfo(), and ParsedAttrInfo::GetPragmaAttributeMatchRules.
Referenced by clang::Sema::ActOnPragmaAttributePush().
unsigned ParsedAttr::getMaxArgs | ( | ) | const |
Definition at line 179 of file ParsedAttr.cpp.
References getInfo(), and ParsedAttrInfo::OptArgs.
Referenced by IsBuiltInOrStandardCXX11Attribute().
|
inline |
Definition at line 477 of file ParsedAttr.h.
References getKind().
unsigned ParsedAttr::getMinArgs | ( | ) | const |
Definition at line 177 of file ParsedAttr.cpp.
References getInfo(), and ParsedAttrInfo::NumArgs.
|
inline |
Definition at line 499 of file ParsedAttr.h.
References getKind().
|
inline |
Definition at line 363 of file ParsedAttr.h.
Referenced by clang::Sema::ActOnPragmaAttributePop(), clang::Sema::ActOnPragmaAttributePush(), clang::Sema::checkStringLiteralArgumentAttr(), distributeNullabilityTypeAttr(), getAttrName(), HandleAddressSpaceTypeAttribute(), HandleExtVectorTypeAttr(), handleMSPointerTypeQualifierAttr(), HandleNeonVectorTypeAttr(), handleObjCGCTypeAttr(), handleObjCOwnershipTypeAttr(), and HandleVectorSizeAttr().
|
inline |
getNumArgs - Return the number of actual arguments to this attribute.
Definition at line 428 of file ParsedAttr.h.
Referenced by getNumAttributeArgs(), HandleAddressSpaceTypeAttribute(), HandleExtVectorTypeAttr(), handleFunctionTypeAttr(), HandleNeonVectorTypeAttr(), handleObjCGCTypeAttr(), and HandleVectorSizeAttr().
|
inline |
Definition at line 407 of file ParsedAttr.h.
Referenced by clang::Sema::CheckCallingConvAttr().
|
inline |
Definition at line 510 of file ParsedAttr.h.
|
inline |
Definition at line 365 of file ParsedAttr.h.
|
inline |
Definition at line 482 of file ParsedAttr.h.
References getKind().
|
inline |
Definition at line 369 of file ParsedAttr.h.
|
inline |
Definition at line 368 of file ParsedAttr.h.
unsigned ParsedAttr::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 225 of file ParsedAttr.cpp.
References getInfo(), and ParsedAttrInfo::SpellingIndexToSemanticSpelling.
Referenced by HandleOpenCLAccessAttr().
|
inline |
Definition at line 467 of file ParsedAttr.h.
References getKind().
|
inline |
Definition at line 505 of file ParsedAttr.h.
|
inline |
Definition at line 472 of file ParsedAttr.h.
References getKind().
bool ParsedAttr::hasCustomParsing | ( | ) | const |
Definition at line 183 of file ParsedAttr.cpp.
References getInfo(), and ParsedAttrInfo::HasCustomParsing.
|
inline |
Definition at line 371 of file ParsedAttr.h.
Referenced by getNumAttributeArgs().
|
inline |
Definition at line 405 of file ParsedAttr.h.
Referenced by clang::Sema::CheckCallingConvAttr().
|
inline |
Definition at line 367 of file ParsedAttr.h.
bool ParsedAttr::hasVariadicArg | ( | ) | const |
Definition at line 229 of file ParsedAttr.cpp.
References getInfo(), and ParsedAttrInfo::OptArgs.
|
inline |
Definition at line 378 of file ParsedAttr.h.
References getKind().
|
inline |
Definition at line 436 of file ParsedAttr.h.
Referenced by getCCTypeAttrKind(), and setAttributedTypeLoc().
|
inline |
Definition at line 444 of file ParsedAttr.h.
Referenced by clang::Sema::checkStringLiteralArgumentAttr(), HandleAddressSpaceTypeAttribute(), HandleExtVectorTypeAttr(), handleObjCGCTypeAttr(), handleObjCOwnershipTypeAttr(), HandleVectorSizeAttr(), and setAttributedTypeLoc().
|
inline |
Definition at line 390 of file ParsedAttr.h.
|
inline |
Definition at line 398 of file ParsedAttr.h.
Referenced by distributeNullabilityTypeAttr().
|
inline |
Definition at line 386 of file ParsedAttr.h.
Referenced by distributeFunctionTypeAttrFromDeclSpec().
|
inline |
Definition at line 383 of file ParsedAttr.h.
|
inline |
Is this the Microsoft __declspec(property) attribute?
Definition at line 374 of file ParsedAttr.h.
Referenced by getMSPropertyAttr().
|
inline |
Definition at line 402 of file ParsedAttr.h.
Referenced by clang::Sema::CheckCallingConvAttr(), clang::Sema::CheckRegparmAttr(), and getCCTypeAttrKind().
|
inline |
Definition at line 394 of file ParsedAttr.h.
bool ParsedAttr::isKnownToGCC | ( | ) | const |
Definition at line 219 of file ParsedAttr.cpp.
References getInfo(), and ParsedAttrInfo::IsKnownToGCC.
|
inline |
Definition at line 384 of file ParsedAttr.h.
|
inline |
Definition at line 420 of file ParsedAttr.h.
References clang::SourceLocation::isValid().
bool ParsedAttr::isStmtAttr | ( | ) | const |
Definition at line 213 of file ParsedAttr.cpp.
References getInfo(), and ParsedAttrInfo::IsStmt.
bool ParsedAttr::isSupportedByPragmaAttribute | ( | ) | const |
Definition at line 221 of file ParsedAttr.cpp.
References getInfo(), and ParsedAttrInfo::IsSupportedByPragmaAttribute.
bool ParsedAttr::isTargetSpecificAttr | ( | ) | const |
Definition at line 207 of file ParsedAttr.cpp.
References getInfo(), and ParsedAttrInfo::IsTargetSpecific.
bool ParsedAttr::isTypeAttr | ( | ) | const |
Definition at line 211 of file ParsedAttr.cpp.
References getInfo(), and ParsedAttrInfo::IsType.
|
inline |
Definition at line 417 of file ParsedAttr.h.
|
delete |
|
delete |
Definition at line 403 of file ParsedAttr.h.
Referenced by clang::Sema::CheckAttrNoArgs(), clang::Sema::CheckCallingConvAttr(), clang::Sema::CheckRegparmAttr(), HandleAddressSpaceTypeAttribute(), handleFunctionTypeAttr(), HandleNeonVectorTypeAttr(), handleObjCGCTypeAttr(), handleObjCOwnershipTypeAttr(), HandleOpenCLAccessAttr(), HandleVectorSizeAttr(), and IsBuiltInOrStandardCXX11Attribute().
|
inline |
Definition at line 412 of file ParsedAttr.h.
|
inline |
Definition at line 418 of file ParsedAttr.h.
|
friend |
Definition at line 214 of file ParsedAttr.h.
|
friend |
Definition at line 215 of file ParsedAttr.h.