clang 22.0.0git
Attributes.cpp File Reference
#include "clang/Basic/Attributes.h"
#include "clang/Basic/AttrSubjectMatchRules.h"
#include "clang/Basic/IdentifierTable.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/ParsedAttrInfo.h"
#include "clang/Basic/SimpleTypoCorrection.h"
#include "clang/Basic/TargetInfo.h"
#include "llvm/ADT/StringSwitch.h"
#include "clang/Basic/AttrHasAttributeImpl.inc"
#include "clang/Basic/AttrSubMatchRulesList.inc"
#include "clang/Sema/AttrParsedAttrKinds.inc"
#include "clang/Basic/CXX11AttributeInfo.inc"
#include "clang/Sema/AttrSpellingListIndex.inc"
#include "clang/Basic/AttributeSpellingList.inc"

Go to the source code of this file.

Macros

#define ATTR_MATCH_RULE(NAME, SPELLING, IsAbstract)
#define CXX11_ATTR_ARGS_INFO
#define ATTR_NAME(NAME)
#define ATTR_SCOPE_NAME(SCOPE_NAME)

Functions

static StringRef canonicalizeScopeName (StringRef Name)
static StringRef canonicalizeAttrName (StringRef Name)
static int hasAttributeImpl (AttributeCommonInfo::Syntax Syntax, StringRef Name, StringRef ScopeName, const TargetInfo &Target, const LangOptions &LangOpts)
static StringRef normalizeAttrScopeName (StringRef ScopeName, AttributeCommonInfo::Syntax SyntaxUsed)
static StringRef normalizeAttrScopeName (const IdentifierInfo *ScopeName, AttributeCommonInfo::Syntax SyntaxUsed)
static StringRef normalizeAttrName (StringRef AttrName, StringRef NormalizedScopeName, AttributeCommonInfo::Syntax SyntaxUsed)
static SmallString< 64 > normalizeName (StringRef AttrName, StringRef ScopeName, AttributeCommonInfo::Syntax SyntaxUsed)
static SmallString< 64 > normalizeName (const IdentifierInfo *Name, const IdentifierInfo *Scope, AttributeCommonInfo::Syntax SyntaxUsed)
static AttributeCommonInfo::Scope getScopeFromNormalizedScopeName (StringRef ScopeName)

Variables

static constexpr const char * AttrSpellingList []
static constexpr const char * AttrScopeSpellingList []

Macro Definition Documentation

◆ ATTR_MATCH_RULE

#define ATTR_MATCH_RULE ( NAME,
SPELLING,
IsAbstract )
Value:
case attr::NAME: \
return SPELLING;

◆ ATTR_NAME

#define ATTR_NAME ( NAME)
Value:
NAME,

Definition at line 255 of file Attributes.cpp.

◆ ATTR_SCOPE_NAME

#define ATTR_SCOPE_NAME ( SCOPE_NAME)
Value:
SCOPE_NAME,

Definition at line 260 of file Attributes.cpp.

◆ CXX11_ATTR_ARGS_INFO

#define CXX11_ATTR_ARGS_INFO

Function Documentation

◆ canonicalizeAttrName()

StringRef canonicalizeAttrName ( StringRef Name)
static

Definition at line 36 of file Attributes.cpp.

Referenced by normalizeAttrName().

◆ canonicalizeScopeName()

StringRef canonicalizeScopeName ( StringRef Name)
static

Definition at line 25 of file Attributes.cpp.

Referenced by normalizeAttrScopeName().

◆ getScopeFromNormalizedScopeName()

◆ hasAttributeImpl()

int hasAttributeImpl ( AttributeCommonInfo::Syntax Syntax,
StringRef Name,
StringRef ScopeName,
const TargetInfo & Target,
const LangOptions & LangOpts )
static

Definition at line 44 of file Attributes.cpp.

◆ normalizeAttrName()

◆ normalizeAttrScopeName() [1/2]

StringRef normalizeAttrScopeName ( const IdentifierInfo * ScopeName,
AttributeCommonInfo::Syntax SyntaxUsed )
static

Definition at line 118 of file Attributes.cpp.

References clang::IdentifierInfo::getName(), and normalizeAttrScopeName().

◆ normalizeAttrScopeName() [2/2]

StringRef normalizeAttrScopeName ( StringRef ScopeName,
AttributeCommonInfo::Syntax SyntaxUsed )
static

◆ normalizeName() [1/2]

SmallString< 64 > normalizeName ( const IdentifierInfo * Name,
const IdentifierInfo * Scope,
AttributeCommonInfo::Syntax SyntaxUsed )
static

◆ normalizeName() [2/2]

Variable Documentation

◆ AttrScopeSpellingList

const char* AttrScopeSpellingList[]
staticconstexpr
Initial value:
= {
}

Definition at line 261 of file Attributes.cpp.

Referenced by clang::AttributeCommonInfo::tryGetCorrectedScopeName().

◆ AttrSpellingList

const char* AttrSpellingList[]
staticconstexpr
Initial value:
= {
}

Definition at line 256 of file Attributes.cpp.

Referenced by clang::AttributeCommonInfo::tryGetCorrectedAttrName().