clang 20.0.0git
|
#include "clang/Basic/ParsedAttrInfo.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 |
bool | hasSpelling (AttributeCommonInfo::Syntax Syntax, StringRef Name) const |
Check if this attribute has specified spelling. | |
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. | |
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. | |
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. | |
virtual bool | acceptsLangOpts (const LangOptions &LO) const |
Check if this attribute is allowed by the language we are compiling. | |
virtual bool | existsInTarget (const TargetInfo &Target) const |
Check if this attribute is allowed when compiling for the given target. | |
virtual bool | spellingExistsInTarget (const TargetInfo &Target, const unsigned SpellingListIndex) const |
Check if this attribute's spelling is allowed when compiling for the given target. | |
virtual unsigned | spellingIndexToSemanticSpelling (const ParsedAttr &Attr) const |
Convert the spelling index of Attr to a semantic spelling enum value. | |
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. | |
virtual void | getPragmaAttributeMatchRules (llvm::SmallVectorImpl< std::pair< attr::SubjectMatchRule, bool > > &Rules, const LangOptions &LangOpts) const |
Populate Rules with the match rules of this attribute. | |
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. | |
virtual AttrHandling | handleStmtAttribute (Sema &S, Stmt *St, const ParsedAttr &Attr, class Attr *&Result) const |
If this ParsedAttrInfo knows how to handle this ParsedAttr applied to this Stmt then do so (referencing the resulting Attr in Result) and return either AttributeApplied if it was applied or AttributeNotApplied if it wasn't. | |
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. | |
unsigned | NumArgs: 4 |
The number of required arguments of this attribute. | |
unsigned | OptArgs: 4 |
The number of optional arguments of this attributes. | |
unsigned | NumArgMembers: 4 |
The number of non-fake arguments specified in the attribute definition. | |
unsigned | HasCustomParsing: 1 |
True if the parsing does not match the semantic content. | |
unsigned | AcceptsExprPack: 1 |
unsigned | IsTargetSpecific: 1 |
True if this attribute is only available for certain targets. | |
unsigned | IsType: 1 |
True if this attribute applies to types. | |
unsigned | IsStmt: 1 |
True if this attribute applies to statements. | |
unsigned | IsKnownToGCC: 1 |
True if this attribute has any spellings that are known to gcc. | |
unsigned | IsSupportedByPragmaAttribute: 1 |
True if this attribute is supported by #pragma clang attribute. | |
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 36 of file ParsedAttrInfo.h.
Enumerator | |
---|---|
NotHandled | |
AttributeApplied | |
AttributeNotApplied |
Definition at line 151 of file ParsedAttrInfo.h.
|
inlineconstexprprotected |
Definition at line 77 of file ParsedAttrInfo.h.
|
inlineconstexprprotected |
Definition at line 83 of file ParsedAttrInfo.h.
|
virtualdefault |
|
inlinevirtual |
Check if this attribute is allowed by the language we are compiling.
Definition at line 125 of file ParsedAttrInfo.h.
|
inlinevirtual |
Check if this attribute appertains to D, and issue a diagnostic if not.
Definition at line 109 of file ParsedAttrInfo.h.
Referenced by clang::ParsedAttr::diagnoseAppertainsTo().
|
inlinevirtual |
Check if this attribute appertains to St, and issue a diagnostic if not.
Definition at line 114 of file ParsedAttrInfo.h.
Referenced by clang::ParsedAttr::diagnoseAppertainsTo().
|
inlinevirtual |
Check if the given attribute is mutually exclusive with other attributes already applied to the given declaration.
Definition at line 120 of file ParsedAttrInfo.h.
Referenced by clang::ParsedAttr::diagnoseMutualExclusion().
|
inlinevirtual |
Check if this attribute is allowed when compiling for the given target.
Definition at line 128 of file ParsedAttrInfo.h.
Referenced by clang::ParsedAttr::existsInTarget().
|
static |
Definition at line 113 of file ParsedAttr.cpp.
References clang::AttributeCommonInfo::AS_ContextSensitiveKeyword, clang::AttributeCommonInfo::AS_Keyword, FullName, clang::getAttributePluginInstances(), clang::AttributeCommonInfo::getNormalizedFullName(), clang::AttributeCommonInfo::getParsedKind(), clang::AttributeCommonInfo::getSyntax(), clang::AttributeCommonInfo::IgnoredAttribute, and clang::AttributeCommonInfo::UnknownAttribute.
|
static |
Definition at line 142 of file ParsedAttr.cpp.
Referenced by clang::SemaCodeCompletion::CodeCompleteAttribute().
|
inlinevirtual |
Populate Rules with the match rules of this attribute.
Definition at line 147 of file ParsedAttrInfo.h.
Referenced by clang::ParsedAttr::getMatchRules().
|
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 155 of file ParsedAttrInfo.h.
References NotHandled.
Referenced by ProcessDeclAttribute().
|
inlinevirtual |
If this ParsedAttrInfo knows how to handle this ParsedAttr applied to this Stmt then do so (referencing the resulting Attr in Result) and return either AttributeApplied if it was applied or AttributeNotApplied if it wasn't.
Otherwise return NotHandled.
Definition at line 163 of file ParsedAttrInfo.h.
References NotHandled.
|
inline |
Check if this attribute has specified spelling.
Definition at line 102 of file ParsedAttrInfo.h.
References Spellings.
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 145 of file ParsedAttrInfo.h.
Referenced by clang::ParsedAttr::isParamExpr().
|
inlinevirtual |
Check if this attribute's spelling is allowed when compiling for the given target.
Definition at line 132 of file ParsedAttrInfo.h.
Referenced by clang::ParsedAttr::existsInTarget().
|
inlinevirtual |
Convert the spelling index of Attr to a semantic spelling enum value.
Definition at line 139 of file ParsedAttrInfo.h.
References UINT_MAX.
Referenced by clang::ParsedAttr::getSemanticSpelling().
unsigned clang::ParsedAttrInfo::AcceptsExprPack |
Definition at line 51 of file ParsedAttrInfo.h.
Referenced by clang::ParsedAttr::acceptsExprPack().
ArrayRef<const char *> clang::ParsedAttrInfo::ArgNames |
Definition at line 74 of file ParsedAttrInfo.h.
unsigned clang::ParsedAttrInfo::AttrKind |
Corresponds to the Kind enum.
Definition at line 39 of file ParsedAttrInfo.h.
Referenced by clang::ParsedAttr::getKind().
unsigned clang::ParsedAttrInfo::HasCustomParsing |
True if the parsing does not match the semantic content.
Definition at line 48 of file ParsedAttrInfo.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 63 of file ParsedAttrInfo.h.
Referenced by clang::ParsedAttr::isKnownToGCC().
unsigned clang::ParsedAttrInfo::IsStmt |
True if this attribute applies to statements.
Definition at line 60 of file ParsedAttrInfo.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 ParsedAttrInfo.h.
Referenced by clang::ParsedAttr::isSupportedByPragmaAttribute().
unsigned clang::ParsedAttrInfo::IsTargetSpecific |
True if this attribute is only available for certain targets.
Definition at line 54 of file ParsedAttrInfo.h.
Referenced by clang::ParsedAttr::isTargetSpecificAttr().
unsigned clang::ParsedAttrInfo::IsType |
True if this attribute applies to types.
Definition at line 57 of file ParsedAttrInfo.h.
Referenced by clang::ParsedAttr::isTypeAttr().
unsigned clang::ParsedAttrInfo::NumArgMembers |
The number of non-fake arguments specified in the attribute definition.
Definition at line 45 of file ParsedAttrInfo.h.
Referenced by clang::ParsedAttr::getNumArgMembers().
unsigned clang::ParsedAttrInfo::NumArgs |
The number of required arguments of this attribute.
Definition at line 41 of file ParsedAttrInfo.h.
Referenced by clang::ParsedAttr::getMinArgs().
unsigned clang::ParsedAttrInfo::OptArgs |
The number of optional arguments of this attributes.
Definition at line 43 of file ParsedAttrInfo.h.
Referenced by clang::ParsedAttr::getMaxArgs(), and clang::ParsedAttr::hasVariadicArg().
Definition at line 72 of file ParsedAttrInfo.h.
Referenced by hasSpelling().