clang
17.0.0git
|
#include "clang/Sema/ParsedAttr.h"
Classes | |
struct | Spelling |
The syntaxes supported by this attribute and how they're spelled. More... | |
Public Types | |
enum | AttrHandling { NotHandled, AttributeApplied, AttributeNotApplied } |
Public Member Functions | |
virtual | ~ParsedAttrInfo ()=default |
virtual bool | diagAppertainsToDecl (Sema &S, const ParsedAttr &Attr, const Decl *D) const |
Check if this attribute appertains to D, and issue a diagnostic if not. More... | |
virtual bool | diagAppertainsToStmt (Sema &S, const ParsedAttr &Attr, const Stmt *St) const |
Check if this attribute appertains to St, and issue a diagnostic if not. More... | |
virtual bool | diagMutualExclusion (Sema &S, const ParsedAttr &A, const Decl *D) const |
Check if the given attribute is mutually exclusive with other attributes already applied to the given declaration. More... | |
virtual bool | acceptsLangOpts (const LangOptions &LO) const |
Check if this attribute is allowed by the language we are compiling. More... | |
virtual bool | existsInTarget (const TargetInfo &Target) const |
Check if this attribute is allowed when compiling for the given target. More... | |
virtual unsigned | spellingIndexToSemanticSpelling (const ParsedAttr &Attr) const |
Convert the spelling index of Attr to a semantic spelling enum value. More... | |
virtual bool | isParamExpr (size_t N) const |
Returns true if the specified parameter index for this attribute in Attr.td is an ExprArgument or VariadicExprArgument, or a subclass thereof; returns false otherwise. More... | |
virtual void | getPragmaAttributeMatchRules (llvm::SmallVectorImpl< std::pair< attr::SubjectMatchRule, bool >> &Rules, const LangOptions &LangOpts) const |
Populate Rules with the match rules of this attribute. More... | |
virtual AttrHandling | handleDeclAttribute (Sema &S, Decl *D, const ParsedAttr &Attr) const |
If this ParsedAttrInfo knows how to handle this ParsedAttr applied to this Decl then do so and return either AttributeApplied if it was applied or AttributeNotApplied if it wasn't. More... | |
Static Public Member Functions | |
static const ParsedAttrInfo & | get (const AttributeCommonInfo &A) |
static ArrayRef< const ParsedAttrInfo * > | getAllBuiltin () |
Public Attributes | |
unsigned | AttrKind: 16 |
Corresponds to the Kind enum. More... | |
unsigned | NumArgs: 4 |
The number of required arguments of this attribute. More... | |
unsigned | OptArgs: 4 |
The number of optional arguments of this attributes. More... | |
unsigned | NumArgMembers: 4 |
The number of non-fake arguments specified in the attribute definition. More... | |
unsigned | HasCustomParsing: 1 |
True if the parsing does not match the semantic content. More... | |
unsigned | AcceptsExprPack: 1 |
unsigned | IsTargetSpecific: 1 |
True if this attribute is only available for certain targets. More... | |
unsigned | IsType: 1 |
True if this attribute applies to types. More... | |
unsigned | IsStmt: 1 |
True if this attribute applies to statements. More... | |
unsigned | IsKnownToGCC: 1 |
True if this attribute has any spellings that are known to gcc. More... | |
unsigned | IsSupportedByPragmaAttribute: 1 |
True if this attribute is supported by #pragma clang attribute. More... | |
ArrayRef< Spelling > | Spellings |
ArrayRef< const char * > | ArgNames |
Protected Member Functions | |
constexpr | ParsedAttrInfo (AttributeCommonInfo::Kind AttrKind=AttributeCommonInfo::NoSemaHandlerAttribute) |
constexpr | ParsedAttrInfo (AttributeCommonInfo::Kind AttrKind, unsigned NumArgs, unsigned OptArgs, unsigned NumArgMembers, unsigned HasCustomParsing, unsigned AcceptsExprPack, unsigned IsTargetSpecific, unsigned IsType, unsigned IsStmt, unsigned IsKnownToGCC, unsigned IsSupportedByPragmaAttribute, ArrayRef< Spelling > Spellings, ArrayRef< const char * > ArgNames) |
Definition at line 44 of file ParsedAttr.h.
Enumerator | |
---|---|
NotHandled | |
AttributeApplied | |
AttributeNotApplied |
Definition at line 138 of file ParsedAttr.h.
|
inlineconstexprprotected |
Definition at line 77 of file ParsedAttr.h.
|
inlineconstexprprotected |
Definition at line 83 of file ParsedAttr.h.
|
virtualdefault |
|
inlinevirtual |
Check if this attribute is allowed by the language we are compiling.
Definition at line 118 of file ParsedAttr.h.
|
inlinevirtual |
Check if this attribute appertains to D, and issue a diagnostic if not.
Definition at line 102 of file ParsedAttr.h.
|
inlinevirtual |
Check if this attribute appertains to St, and issue a diagnostic if not.
Definition at line 107 of file ParsedAttr.h.
|
inlinevirtual |
Check if the given attribute is mutually exclusive with other attributes already applied to the given declaration.
Definition at line 113 of file ParsedAttr.h.
|
inlinevirtual |
Check if this attribute is allowed when compiling for the given target.
Definition at line 121 of file ParsedAttr.h.
Referenced by clang::ParsedAttr::existsInTarget().
|
static |
Definition at line 112 of file ParsedAttr.cpp.
References clang::AttributeCommonInfo::AS_ContextSensitiveKeyword, clang::AttributeCommonInfo::AS_Keyword, clang::AttributeCommonInfo::getNormalizedFullName(), clang::AttributeCommonInfo::getParsedKind(), clang::AttributeCommonInfo::getSyntax(), clang::AttributeCommonInfo::IgnoredAttribute, and string().
|
static |
Definition at line 148 of file ParsedAttr.cpp.
|
inlinevirtual |
Populate Rules with the match rules of this attribute.
Definition at line 134 of file ParsedAttr.h.
|
inlinevirtual |
If this ParsedAttrInfo knows how to handle this ParsedAttr applied to this Decl then do so and return either AttributeApplied if it was applied or AttributeNotApplied if it wasn't.
Otherwise return NotHandled.
Definition at line 146 of file ParsedAttr.h.
Returns true if the specified parameter index for this attribute in Attr.td is an ExprArgument or VariadicExprArgument, or a subclass thereof; returns false otherwise.
Definition at line 132 of file ParsedAttr.h.
Referenced by clang::ParsedAttr::isParamExpr().
|
inlinevirtual |
Convert the spelling index of Attr to a semantic spelling enum value.
Definition at line 126 of file ParsedAttr.h.
References UINT_MAX.
Referenced by clang::ParsedAttr::getSemanticSpelling().
unsigned clang::ParsedAttrInfo::AcceptsExprPack |
Definition at line 56 of file ParsedAttr.h.
Referenced by clang::ParsedAttr::acceptsExprPack().
ArrayRef<const char *> clang::ParsedAttrInfo::ArgNames |
Definition at line 74 of file ParsedAttr.h.
unsigned clang::ParsedAttrInfo::AttrKind |
Corresponds to the Kind enum.
Definition at line 46 of file ParsedAttr.h.
Referenced by clang::ParsedAttr::getKind().
unsigned clang::ParsedAttrInfo::HasCustomParsing |
True if the parsing does not match the semantic content.
Definition at line 54 of file ParsedAttr.h.
Referenced by clang::ParsedAttr::hasCustomParsing().
unsigned clang::ParsedAttrInfo::IsKnownToGCC |
True if this attribute has any spellings that are known to gcc.
Definition at line 64 of file ParsedAttr.h.
Referenced by clang::ParsedAttr::isKnownToGCC().
unsigned clang::ParsedAttrInfo::IsStmt |
True if this attribute applies to statements.
Definition at line 62 of file ParsedAttr.h.
Referenced by clang::ParsedAttr::isStmtAttr().
unsigned clang::ParsedAttrInfo::IsSupportedByPragmaAttribute |
True if this attribute is supported by #pragma clang attribute.
Definition at line 66 of file ParsedAttr.h.
Referenced by clang::ParsedAttr::isSupportedByPragmaAttribute().
unsigned clang::ParsedAttrInfo::IsTargetSpecific |
True if this attribute is only available for certain targets.
Definition at line 58 of file ParsedAttr.h.
Referenced by clang::ParsedAttr::isTargetSpecificAttr().
unsigned clang::ParsedAttrInfo::IsType |
True if this attribute applies to types.
Definition at line 60 of file ParsedAttr.h.
Referenced by clang::ParsedAttr::isTypeAttr().
unsigned clang::ParsedAttrInfo::NumArgMembers |
The number of non-fake arguments specified in the attribute definition.
Definition at line 52 of file ParsedAttr.h.
Referenced by clang::ParsedAttr::getNumArgMembers().
unsigned clang::ParsedAttrInfo::NumArgs |
The number of required arguments of this attribute.
Definition at line 48 of file ParsedAttr.h.
Referenced by clang::ParsedAttr::getMinArgs().
unsigned clang::ParsedAttrInfo::OptArgs |
The number of optional arguments of this attributes.
Definition at line 50 of file ParsedAttr.h.
Referenced by clang::ParsedAttr::getMaxArgs(), and clang::ParsedAttr::hasVariadicArg().
Definition at line 72 of file ParsedAttr.h.