struct ParsedAttrInfo

Declaration

struct ParsedAttrInfo { /* full declaration omitted */ };

Declared at: clang/include/clang/Sema/ParsedAttr.h:44

Member Variables

public unsigned int AttrKind
Corresponds to the Kind enum.
public unsigned int NumArgs
The number of required arguments of this attribute.
public unsigned int OptArgs
The number of optional arguments of this attributes.
public unsigned int NumArgMembers
The number of non-fake arguments specified in the attribute definition.
public unsigned int HasCustomParsing
True if the parsing does not match the semantic content.
public unsigned int AcceptsExprPack
public unsigned int IsTargetSpecific
True if this attribute is only available for certain targets.
public unsigned int IsType
True if this attribute applies to types.
public unsigned int IsStmt
True if this attribute applies to statements.
public unsigned int IsKnownToGCC
True if this attribute has any spellings that are known to gcc.
public unsigned int IsSupportedByPragmaAttribute
True if this attribute is supported by #pragma clang attribute.
public ArrayRef<clang::ParsedAttrInfo::Spelling> Spellings
public ArrayRef<const char*> ArgNames

Method Overview

  • protected constexpr ParsedAttrInfo(AttributeCommonInfo::Kind AttrKind = AttributeCommonInfo::NoSemaHandlerAttribute)
  • protected constexpr ParsedAttrInfo(AttributeCommonInfo::Kind AttrKind, unsigned int NumArgs, unsigned int OptArgs, unsigned int NumArgMembers, unsigned int HasCustomParsing, unsigned int AcceptsExprPack, unsigned int IsTargetSpecific, unsigned int IsType, unsigned int IsStmt, unsigned int IsKnownToGCC, unsigned int IsSupportedByPragmaAttribute, ArrayRef<clang::ParsedAttrInfo::Spelling> Spellings, ArrayRef<const char *> ArgNames)
  • public virtual bool acceptsLangOpts(const clang::LangOptions & LO) const
  • public virtual bool diagAppertainsToDecl(clang::Sema & S, const clang::ParsedAttr & Attr, const clang::Decl * D) const
  • public virtual bool diagAppertainsToStmt(clang::Sema & S, const clang::ParsedAttr & Attr, const clang::Stmt * St) const
  • public virtual bool diagMutualExclusion(clang::Sema & S, const clang::ParsedAttr & A, const clang::Decl * D) const
  • public virtual bool existsInTarget(const clang::TargetInfo & Target) const
  • public static const clang::ParsedAttrInfo & get(const clang::AttributeCommonInfo & A)
  • public static ArrayRef<const clang::ParsedAttrInfo *> getAllBuiltin()
  • public virtual void getPragmaAttributeMatchRules(llvm::SmallVectorImpl<std::pair<attr::SubjectMatchRule, bool>> & Rules, const clang::LangOptions & LangOpts) const
  • public virtual clang::ParsedAttrInfo::AttrHandling handleDeclAttribute(clang::Sema & S, clang::Decl * D, const clang::ParsedAttr & Attr) const
  • public virtual bool isParamExpr(size_t N) const
  • public virtual unsigned int spellingIndexToSemanticSpelling(const clang::ParsedAttr & Attr) const
  • public virtual ~ParsedAttrInfo()

Methods

constexpr ParsedAttrInfo(
    AttributeCommonInfo::Kind AttrKind =
        AttributeCommonInfo::
            NoSemaHandlerAttribute)

Declared at: clang/include/clang/Sema/ParsedAttr.h:77

Parameters

AttributeCommonInfo::Kind AttrKind = AttributeCommonInfo::NoSemaHandlerAttribute

constexpr ParsedAttrInfo(
    AttributeCommonInfo::Kind AttrKind,
    unsigned int NumArgs,
    unsigned int OptArgs,
    unsigned int NumArgMembers,
    unsigned int HasCustomParsing,
    unsigned int AcceptsExprPack,
    unsigned int IsTargetSpecific,
    unsigned int IsType,
    unsigned int IsStmt,
    unsigned int IsKnownToGCC,
    unsigned int IsSupportedByPragmaAttribute,
    ArrayRef<clang::ParsedAttrInfo::Spelling>
        Spellings,
    ArrayRef<const char*> ArgNames)

Declared at: clang/include/clang/Sema/ParsedAttr.h:83

Parameters

AttributeCommonInfo::Kind AttrKind
unsigned int NumArgs
unsigned int OptArgs
unsigned int NumArgMembers
unsigned int HasCustomParsing
unsigned int AcceptsExprPack
unsigned int IsTargetSpecific
unsigned int IsType
unsigned int IsStmt
unsigned int IsKnownToGCC
unsigned int IsSupportedByPragmaAttribute
ArrayRef<clang::ParsedAttrInfo::Spelling> Spellings
ArrayRef<const char*> ArgNames

virtual bool acceptsLangOpts(
    const clang::LangOptions& LO) const

Description

Check if this attribute is allowed by the language we are compiling.

Declared at: clang/include/clang/Sema/ParsedAttr.h:118

Parameters

const clang::LangOptions& LO

virtual bool diagAppertainsToDecl(
    clang::Sema& S,
    const clang::ParsedAttr& Attr,
    const clang::Decl* D) const

Description

Check if this attribute appertains to D, and issue a diagnostic if not.

Declared at: clang/include/clang/Sema/ParsedAttr.h:102

Parameters

clang::Sema& S
const clang::ParsedAttr& Attr
const clang::Decl* D

virtual bool diagAppertainsToStmt(
    clang::Sema& S,
    const clang::ParsedAttr& Attr,
    const clang::Stmt* St) const

Description

Check if this attribute appertains to St, and issue a diagnostic if not.

Declared at: clang/include/clang/Sema/ParsedAttr.h:107

Parameters

clang::Sema& S
const clang::ParsedAttr& Attr
const clang::Stmt* St

virtual bool diagMutualExclusion(
    clang::Sema& S,
    const clang::ParsedAttr& A,
    const clang::Decl* D) const

Description

Check if the given attribute is mutually exclusive with other attributes already applied to the given declaration.

Declared at: clang/include/clang/Sema/ParsedAttr.h:113

Parameters

clang::Sema& S
const clang::ParsedAttr& A
const clang::Decl* D

virtual bool existsInTarget(
    const clang::TargetInfo& Target) const

Description

Check if this attribute is allowed when compiling for the given target.

Declared at: clang/include/clang/Sema/ParsedAttr.h:121

Parameters

const clang::TargetInfo& Target

static const clang::ParsedAttrInfo& get(
    const clang::AttributeCommonInfo& A)

Declared at: clang/include/clang/Sema/ParsedAttr.h:151

Parameters

const clang::AttributeCommonInfo& A

static ArrayRef<const clang::ParsedAttrInfo*>
getAllBuiltin()

Declared at: clang/include/clang/Sema/ParsedAttr.h:152

virtual void getPragmaAttributeMatchRules(
    llvm::SmallVectorImpl<
        std::pair<attr::SubjectMatchRule, bool>>&
        Rules,
    const clang::LangOptions& LangOpts) const

Description

Populate Rules with the match rules of this attribute.

Declared at: clang/include/clang/Sema/ParsedAttr.h:134

Parameters

llvm::SmallVectorImpl< std::pair<attr::SubjectMatchRule, bool>>& Rules
const clang::LangOptions& LangOpts

virtual clang::ParsedAttrInfo::AttrHandling
handleDeclAttribute(
    clang::Sema& S,
    clang::Decl* D,
    const clang::ParsedAttr& Attr) const

Description

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.

Declared at: clang/include/clang/Sema/ParsedAttr.h:146

Parameters

clang::Sema& S
clang::Decl* D
const clang::ParsedAttr& Attr

virtual bool isParamExpr(size_t N) const

Description

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.

Declared at: clang/include/clang/Sema/ParsedAttr.h:132

Parameters

size_t N

virtual unsigned int
spellingIndexToSemanticSpelling(
    const clang::ParsedAttr& Attr) const

Description

Convert the spelling index of Attr to a semantic spelling enum value.

Declared at: clang/include/clang/Sema/ParsedAttr.h:126

Parameters

const clang::ParsedAttr& Attr

virtual ~ParsedAttrInfo()

Declared at: clang/include/clang/Sema/ParsedAttr.h:99