15#ifndef LLVM_CLANG_BASIC_PARSEDATTRINFO_H
16#define LLVM_CLANG_BASIC_PARSEDATTRINFO_H
20#include "llvm/ADT/ArrayRef.h"
21#include "llvm/Support/Registry.h"
45 LLVM_PREFERRED_TYPE(
bool)
48 LLVM_PREFERRED_TYPE(
bool)
51 LLVM_PREFERRED_TYPE(
bool)
54 LLVM_PREFERRED_TYPE(
bool)
57 LLVM_PREFERRED_TYPE(
bool)
60 LLVM_PREFERRED_TYPE(
bool)
63 LLVM_PREFERRED_TYPE(
bool)
102 return (S.Syntax == Syntax && S.NormalizedFullName == Name);
108 const Decl *
D)
const {
113 const Stmt *St)
const {
119 const Decl *
D)
const {
131 const unsigned SpellingListIndex)
const {
llvm::MachO::Target Target
Attr - This represents one attribute.
Syntax
The style used to specify an attribute.
Decl - This represents one declaration (or definition), e.g.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
ParsedAttr - Represents a syntactic attribute.
Sema - This implements semantic analysis and AST building for C.
Stmt - This represents one statement.
Exposes information about the current target.
@ Decl
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
The JSON file list parser is used to communicate input to InstallAPI.
const std::list< std::unique_ptr< ParsedAttrInfo > > & getAttributePluginInstances()
llvm::Registry< ParsedAttrInfo > ParsedAttrInfoRegistry
The syntaxes supported by this attribute and how they're spelled.
const char * NormalizedFullName
AttributeCommonInfo::Syntax Syntax
constexpr ParsedAttrInfo(AttributeCommonInfo::Kind AttrKind=AttributeCommonInfo::NoSemaHandlerAttribute)
bool hasSpelling(AttributeCommonInfo::Syntax Syntax, StringRef Name) const
Check if this attribute has specified spelling.
virtual bool acceptsLangOpts(const LangOptions &LO) const
Check if this attribute is allowed by the language we are compiling.
static ArrayRef< const ParsedAttrInfo * > getAllBuiltin()
unsigned IsKnownToGCC
True if this attribute has any spellings that are known to gcc.
ArrayRef< const char * > ArgNames
unsigned HasCustomParsing
True if the parsing does not match the semantic content.
ArrayRef< Spelling > Spellings
unsigned IsType
True if this attribute applies to types.
unsigned IsTargetSpecific
True if this attribute is only available for certain targets.
unsigned IsSupportedByPragmaAttribute
True if this attribute is supported by #pragma clang attribute.
unsigned AttrKind
Corresponds to the Kind enum.
unsigned NumArgs
The number of required arguments of this attribute.
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 unsigned spellingIndexToSemanticSpelling(const ParsedAttr &Attr) const
Convert the spelling index of Attr to a semantic spelling enum value.
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...
static const ParsedAttrInfo & get(const AttributeCommonInfo &A)
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)
virtual bool isParamExpr(size_t N) const
Returns true if the specified parameter index for this attribute in Attr.td is an ExprArgument or Var...
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 bool existsInTarget(const TargetInfo &Target) const
Check if this attribute is allowed when compiling for the given target.
virtual ~ParsedAttrInfo()=default
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 bool diagAppertainsToDecl(Sema &S, const ParsedAttr &Attr, const Decl *D) const
Check if this attribute appertains to D, and issue a diagnostic if not.
unsigned OptArgs
The number of optional arguments of this attributes.
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...
unsigned IsStmt
True if this attribute applies to statements.
unsigned NumArgMembers
The number of non-fake arguments specified in the attribute definition.