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. | |
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 34 of file ParsedAttrInfo.h.
Enumerator | |
---|---|
NotHandled | |
AttributeApplied | |
AttributeNotApplied |
Definition at line 149 of file ParsedAttrInfo.h.
|
inlineconstexprprotected |
Definition at line 75 of file ParsedAttrInfo.h.
|
inlineconstexprprotected |
Definition at line 81 of file ParsedAttrInfo.h.
|
virtualdefault |
|
inlinevirtual |
Check if this attribute is allowed by the language we are compiling.
Definition at line 123 of file ParsedAttrInfo.h.
|
inlinevirtual |
Check if this attribute appertains to D, and issue a diagnostic if not.
Definition at line 107 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 112 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 118 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 126 of file ParsedAttrInfo.h.
Referenced by clang::ParsedAttr::existsInTarget().
|
static |
Definition at line 115 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 144 of file ParsedAttr.cpp.
Referenced by clang::SemaCodeCompletion::CodeCompleteAttribute().
|
inlinevirtual |
Populate Rules with the match rules of this attribute.
Definition at line 145 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 153 of file ParsedAttrInfo.h.
References NotHandled.
Referenced by ProcessDeclAttribute().
|
inline |
Check if this attribute has specified spelling.
Definition at line 100 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 143 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 130 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 137 of file ParsedAttrInfo.h.
References UINT_MAX.
Referenced by clang::ParsedAttr::getSemanticSpelling().
unsigned clang::ParsedAttrInfo::AcceptsExprPack |
Definition at line 49 of file ParsedAttrInfo.h.
Referenced by clang::ParsedAttr::acceptsExprPack().
ArrayRef<const char *> clang::ParsedAttrInfo::ArgNames |
Definition at line 72 of file ParsedAttrInfo.h.
unsigned clang::ParsedAttrInfo::AttrKind |
Corresponds to the Kind enum.
Definition at line 37 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 46 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 61 of file ParsedAttrInfo.h.
Referenced by clang::ParsedAttr::isKnownToGCC().
unsigned clang::ParsedAttrInfo::IsStmt |
True if this attribute applies to statements.
Definition at line 58 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 64 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 52 of file ParsedAttrInfo.h.
Referenced by clang::ParsedAttr::isTargetSpecificAttr().
unsigned clang::ParsedAttrInfo::IsType |
True if this attribute applies to types.
Definition at line 55 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 43 of file ParsedAttrInfo.h.
Referenced by clang::ParsedAttr::getNumArgMembers().
unsigned clang::ParsedAttrInfo::NumArgs |
The number of required arguments of this attribute.
Definition at line 39 of file ParsedAttrInfo.h.
Referenced by clang::ParsedAttr::getMinArgs().
unsigned clang::ParsedAttrInfo::OptArgs |
The number of optional arguments of this attributes.
Definition at line 41 of file ParsedAttrInfo.h.
Referenced by clang::ParsedAttr::getMaxArgs(), and clang::ParsedAttr::hasVariadicArg().
Definition at line 70 of file ParsedAttrInfo.h.
Referenced by hasSpelling().