clang  12.0.0git
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
clang::ParsedAttrInfo Struct Reference

#include "clang/Sema/ParsedAttr.h"

Collaboration diagram for clang::ParsedAttrInfo:
Collaboration graph
[legend]

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

 ParsedAttrInfo (AttributeCommonInfo::Kind AttrKind=AttributeCommonInfo::NoSemaHandlerAttribute)
 
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 diagLangOpts (Sema &S, const ParsedAttr &Attr) const
 Check if this attribute is allowed by the language we are compiling, and issue a diagnostic if not. 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 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 ParsedAttrInfoget (const AttributeCommonInfo &A)
 

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 HasCustomParsing: 1
 True if the parsing does not match the semantic content. More...
 
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< SpellingSpellings
 

Detailed Description

Definition at line 44 of file ParsedAttr.h.

Member Enumeration Documentation

◆ AttrHandling

Enumerator
NotHandled 
AttributeApplied 
AttributeNotApplied 

Definition at line 102 of file ParsedAttr.h.

Constructor & Destructor Documentation

◆ ParsedAttrInfo()

clang::ParsedAttrInfo::ParsedAttrInfo ( AttributeCommonInfo::Kind  AttrKind = AttributeCommonInfo::NoSemaHandlerAttribute)
inline

Definition at line 70 of file ParsedAttr.h.

References ~ParsedAttrInfo().

◆ ~ParsedAttrInfo()

virtual clang::ParsedAttrInfo::~ParsedAttrInfo ( )
virtualdefault

Referenced by ParsedAttrInfo().

Member Function Documentation

◆ diagAppertainsToDecl()

virtual bool clang::ParsedAttrInfo::diagAppertainsToDecl ( Sema S,
const ParsedAttr Attr,
const Decl D 
) const
inlinevirtual

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

Definition at line 79 of file ParsedAttr.h.

◆ diagLangOpts()

virtual bool clang::ParsedAttrInfo::diagLangOpts ( Sema S,
const ParsedAttr Attr 
) const
inlinevirtual

Check if this attribute is allowed by the language we are compiling, and issue a diagnostic if not.

Definition at line 85 of file ParsedAttr.h.

◆ existsInTarget()

virtual bool clang::ParsedAttrInfo::existsInTarget ( const TargetInfo Target) const
inlinevirtual

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

Definition at line 89 of file ParsedAttr.h.

Referenced by clang::ParsedAttr::existsInTarget().

◆ get()

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

◆ getPragmaAttributeMatchRules()

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

Populate Rules with the match rules of this attribute.

Definition at line 98 of file ParsedAttr.h.

Referenced by clang::ParsedAttr::getMatchRules().

◆ handleDeclAttribute()

virtual AttrHandling clang::ParsedAttrInfo::handleDeclAttribute ( Sema S,
Decl D,
const ParsedAttr Attr 
) const
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 110 of file ParsedAttr.h.

◆ spellingIndexToSemanticSpelling()

virtual unsigned clang::ParsedAttrInfo::spellingIndexToSemanticSpelling ( const ParsedAttr Attr) const
inlinevirtual

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

Definition at line 94 of file ParsedAttr.h.

References UINT_MAX.

Referenced by clang::ParsedAttr::getSemanticSpelling().

Member Data Documentation

◆ AttrKind

unsigned clang::ParsedAttrInfo::AttrKind

Corresponds to the Kind enum.

Definition at line 46 of file ParsedAttr.h.

Referenced by clang::ParsedAttr::getKind().

◆ HasCustomParsing

unsigned clang::ParsedAttrInfo::HasCustomParsing

True if the parsing does not match the semantic content.

Definition at line 52 of file ParsedAttr.h.

Referenced by clang::ParsedAttr::hasCustomParsing().

◆ IsKnownToGCC

unsigned clang::ParsedAttrInfo::IsKnownToGCC

True if this attribute has any spellings that are known to gcc.

Definition at line 60 of file ParsedAttr.h.

Referenced by clang::ParsedAttr::isKnownToGCC().

◆ IsStmt

unsigned clang::ParsedAttrInfo::IsStmt

True if this attribute applies to statements.

Definition at line 58 of file ParsedAttr.h.

Referenced by clang::ParsedAttr::isStmtAttr().

◆ IsSupportedByPragmaAttribute

unsigned clang::ParsedAttrInfo::IsSupportedByPragmaAttribute

True if this attribute is supported by #pragma clang attribute.

Definition at line 62 of file ParsedAttr.h.

Referenced by clang::ParsedAttr::isSupportedByPragmaAttribute().

◆ IsTargetSpecific

unsigned clang::ParsedAttrInfo::IsTargetSpecific

True if this attribute is only available for certain targets.

Definition at line 54 of file ParsedAttr.h.

Referenced by clang::ParsedAttr::isTargetSpecificAttr().

◆ IsType

unsigned clang::ParsedAttrInfo::IsType

True if this attribute applies to types.

Definition at line 56 of file ParsedAttr.h.

Referenced by clang::ParsedAttr::isTypeAttr().

◆ NumArgs

unsigned clang::ParsedAttrInfo::NumArgs

The number of required arguments of this attribute.

Definition at line 48 of file ParsedAttr.h.

Referenced by clang::ParsedAttr::getArg(), clang::ParsedAttr::getMinArgs(), clang::ParsedAttr::getNumArgs(), clang::ParsedAttr::isArgExpr(), and clang::ParsedAttr::isArgIdent().

◆ OptArgs

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().

◆ Spellings

ArrayRef<Spelling> clang::ParsedAttrInfo::Spellings

Definition at line 68 of file ParsedAttr.h.


The documentation for this struct was generated from the following files: