clang  3.7.0
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
clang::DeclSpec Class Reference

Captures information about "declaration specifiers". More...

#include <DeclSpec.h>

Inheritance diagram for clang::DeclSpec:
[legend]
Collaboration diagram for clang::DeclSpec:
[legend]

Public Types

enum  SCS {
  SCS_unspecified = 0, SCS_typedef, SCS_extern, SCS_static,
  SCS_auto, SCS_register, SCS_private_extern, SCS_mutable
}
 storage-class-specifier More...
 
enum  TSC { TSC_unspecified, TSC_imaginary, TSC_complex }
 
enum  TQ {
  TQ_unspecified = 0, TQ_const = 1, TQ_restrict = 2, TQ_volatile = 4,
  TQ_atomic = 8
}
 
enum  ParsedSpecifiers {
  PQ_None = 0, PQ_StorageClassSpecifier = 1, PQ_TypeSpecifier = 2, PQ_TypeQualifier = 4,
  PQ_FunctionSpecifier = 8
}
 
typedef ThreadStorageClassSpecifier TSCS
 
typedef TypeSpecifierWidth TSW
 
typedef TypeSpecifierSign TSS
 
typedef TypeSpecifierType TST
 

Public Member Functions

 DeclSpec (AttributeFactory &attrFactory)
 
SCS getStorageClassSpec () const
 
TSCS getThreadStorageClassSpec () const
 
bool isExternInLinkageSpec () const
 
void setExternInLinkageSpec (bool Value)
 
SourceLocation getStorageClassSpecLoc () const
 
SourceLocation getThreadStorageClassSpecLoc () const
 
void ClearStorageClassSpecs ()
 
void ClearTypeSpecType ()
 
TSW getTypeSpecWidth () const
 
TSC getTypeSpecComplex () const
 
TSS getTypeSpecSign () const
 
TST getTypeSpecType () const
 
bool isTypeAltiVecVector () const
 
bool isTypeAltiVecPixel () const
 
bool isTypeAltiVecBool () const
 
bool isTypeSpecOwned () const
 
bool isTypeRep () const
 
ParsedType getRepAsType () const
 
DeclgetRepAsDecl () const
 
ExprgetRepAsExpr () const
 
CXXScopeSpecgetTypeSpecScope ()
 
const CXXScopeSpecgetTypeSpecScope () const
 
const SourceRangegetSourceRange () const LLVM_READONLY
 
SourceLocation getLocStart () const LLVM_READONLY
 
SourceLocation getLocEnd () const LLVM_READONLY
 
SourceLocation getTypeSpecWidthLoc () const
 
SourceLocation getTypeSpecComplexLoc () const
 
SourceLocation getTypeSpecSignLoc () const
 
SourceLocation getTypeSpecTypeLoc () const
 
SourceLocation getAltiVecLoc () const
 
SourceLocation getTypeSpecTypeNameLoc () const
 
SourceRange getTypeofParensRange () const
 
void setTypeofParensRange (SourceRange range)
 
bool containsPlaceholderType () const
 
bool hasTagDefinition () const
 
unsigned getTypeQualifiers () const
 getTypeQualifiers - Return a set of TQs. More...
 
SourceLocation getConstSpecLoc () const
 
SourceLocation getRestrictSpecLoc () const
 
SourceLocation getVolatileSpecLoc () const
 
SourceLocation getAtomicSpecLoc () const
 
void ClearTypeQualifiers ()
 Clear out all of the type qualifiers. More...
 
bool isInlineSpecified () const
 
SourceLocation getInlineSpecLoc () const
 
bool isVirtualSpecified () const
 
SourceLocation getVirtualSpecLoc () const
 
bool isExplicitSpecified () const
 
SourceLocation getExplicitSpecLoc () const
 
bool isNoreturnSpecified () const
 
SourceLocation getNoreturnSpecLoc () const
 
void ClearFunctionSpecs ()
 
bool hasTypeSpecifier () const
 Return true if any type-specifier has been found. More...
 
unsigned getParsedSpecifiers () const
 Return a bitmask of which flavors of specifiers this DeclSpec includes. More...
 
bool isEmpty () const
 
void SetRangeStart (SourceLocation Loc)
 
void SetRangeEnd (SourceLocation Loc)
 
bool SetStorageClassSpec (Sema &S, SCS SC, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID, const PrintingPolicy &Policy)
 
bool SetStorageClassSpecThread (TSCS TSC, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
 
bool SetTypeSpecWidth (TSW W, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID, const PrintingPolicy &Policy)
 
bool SetTypeSpecComplex (TSC C, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
 
bool SetTypeSpecSign (TSS S, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
 
bool SetTypeSpecType (TST T, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID, const PrintingPolicy &Policy)
 
bool SetTypeSpecType (TST T, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID, ParsedType Rep, const PrintingPolicy &Policy)
 
bool SetTypeSpecType (TST T, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID, Decl *Rep, bool Owned, const PrintingPolicy &Policy)
 
bool SetTypeSpecType (TST T, SourceLocation TagKwLoc, SourceLocation TagNameLoc, const char *&PrevSpec, unsigned &DiagID, ParsedType Rep, const PrintingPolicy &Policy)
 
bool SetTypeSpecType (TST T, SourceLocation TagKwLoc, SourceLocation TagNameLoc, const char *&PrevSpec, unsigned &DiagID, Decl *Rep, bool Owned, const PrintingPolicy &Policy)
 
bool SetTypeSpecType (TST T, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID, Expr *Rep, const PrintingPolicy &policy)
 
bool SetTypeAltiVecVector (bool isAltiVecVector, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID, const PrintingPolicy &Policy)
 
bool SetTypeAltiVecPixel (bool isAltiVecPixel, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID, const PrintingPolicy &Policy)
 
bool SetTypeAltiVecBool (bool isAltiVecBool, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID, const PrintingPolicy &Policy)
 
bool SetTypeSpecError ()
 
void UpdateDeclRep (Decl *Rep)
 
void UpdateTypeRep (ParsedType Rep)
 
void UpdateExprRep (Expr *Rep)
 
bool SetTypeQual (TQ T, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID, const LangOptions &Lang)
 
bool setFunctionSpecInline (SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
 
bool setFunctionSpecForceInline (SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
 
bool setFunctionSpecVirtual (SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
 
bool setFunctionSpecExplicit (SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
 
bool setFunctionSpecNoreturn (SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
 
bool SetFriendSpec (SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
 
bool setModulePrivateSpec (SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
 
bool SetConstexprSpec (SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
 
bool SetConceptSpec (SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
 
bool isFriendSpecified () const
 
SourceLocation getFriendSpecLoc () const
 
bool isModulePrivateSpecified () const
 
SourceLocation getModulePrivateSpecLoc () const
 
bool isConstexprSpecified () const
 
SourceLocation getConstexprSpecLoc () const
 
bool isConceptSpecified () const
 
SourceLocation getConceptSpecLoc () const
 
void ClearConstexprSpec ()
 
void ClearConceptSpec ()
 
AttributePoolgetAttributePool () const
 
void addAttributes (AttributeList *AL)
 Concatenates two attribute lists. More...
 
bool hasAttributes () const
 
ParsedAttributesgetAttributes ()
 
const ParsedAttributesgetAttributes () const
 
void takeAttributesFrom (ParsedAttributes &attrs)
 
void Finish (DiagnosticsEngine &D, Preprocessor &PP, const PrintingPolicy &Policy)
 
const WrittenBuiltinSpecsgetWrittenBuiltinSpecs () const
 
ObjCDeclSpecgetObjCQualifiers () const
 
void setObjCQualifiers (ObjCDeclSpec *quals)
 
bool isMissingDeclaratorOk ()
 Checks if this DeclSpec can stand alone, without a Declarator. More...
 

Static Public Member Functions

static bool isDeclRep (TST T)
 
static const char * getSpecifierName (DeclSpec::TST T, const PrintingPolicy &Policy)
 Turn a type-specifier-type into a string like "_Bool" or "union". More...
 
static const char * getSpecifierName (DeclSpec::TQ Q)
 
static const char * getSpecifierName (DeclSpec::TSS S)
 
static const char * getSpecifierName (DeclSpec::TSC C)
 
static const char * getSpecifierName (DeclSpec::TSW W)
 
static const char * getSpecifierName (DeclSpec::SCS S)
 
static const char * getSpecifierName (DeclSpec::TSCS S)
 

Static Public Attributes

static const TSCS TSCS_unspecified = clang::TSCS_unspecified
 
static const TSCS TSCS___thread = clang::TSCS___thread
 
static const TSCS TSCS_thread_local = clang::TSCS_thread_local
 
static const TSCS TSCS__Thread_local = clang::TSCS__Thread_local
 
static const TSW TSW_unspecified = clang::TSW_unspecified
 
static const TSW TSW_short = clang::TSW_short
 
static const TSW TSW_long = clang::TSW_long
 
static const TSW TSW_longlong = clang::TSW_longlong
 
static const TSS TSS_unspecified = clang::TSS_unspecified
 
static const TSS TSS_signed = clang::TSS_signed
 
static const TSS TSS_unsigned = clang::TSS_unsigned
 
static const TST TST_unspecified = clang::TST_unspecified
 
static const TST TST_void = clang::TST_void
 
static const TST TST_char = clang::TST_char
 
static const TST TST_wchar = clang::TST_wchar
 
static const TST TST_char16 = clang::TST_char16
 
static const TST TST_char32 = clang::TST_char32
 
static const TST TST_int = clang::TST_int
 
static const TST TST_int128 = clang::TST_int128
 
static const TST TST_half = clang::TST_half
 
static const TST TST_float = clang::TST_float
 
static const TST TST_double = clang::TST_double
 
static const TST TST_bool = clang::TST_bool
 
static const TST TST_decimal32 = clang::TST_decimal32
 
static const TST TST_decimal64 = clang::TST_decimal64
 
static const TST TST_decimal128 = clang::TST_decimal128
 
static const TST TST_enum = clang::TST_enum
 
static const TST TST_union = clang::TST_union
 
static const TST TST_struct = clang::TST_struct
 
static const TST TST_interface = clang::TST_interface
 
static const TST TST_class = clang::TST_class
 
static const TST TST_typename = clang::TST_typename
 
static const TST TST_typeofType = clang::TST_typeofType
 
static const TST TST_typeofExpr = clang::TST_typeofExpr
 
static const TST TST_decltype = clang::TST_decltype
 
static const TST TST_decltype_auto = clang::TST_decltype_auto
 
static const TST TST_underlyingType = clang::TST_underlyingType
 
static const TST TST_auto = clang::TST_auto
 
static const TST TST_unknown_anytype = clang::TST_unknown_anytype
 
static const TST TST_atomic = clang::TST_atomic
 
static const TST TST_error = clang::TST_error
 

Detailed Description

Captures information about "declaration specifiers".

"Declaration specifiers" encompasses storage-class-specifiers, type-specifiers, type-qualifiers, and function-specifiers.

Definition at line 233 of file DeclSpec.h.

Member Typedef Documentation

Definition at line 250 of file DeclSpec.h.

Definition at line 270 of file DeclSpec.h.

Definition at line 276 of file DeclSpec.h.

Definition at line 257 of file DeclSpec.h.

Member Enumeration Documentation

ParsedSpecifiers - Flags to query which specifiers were applied. This is returned by getParsedSpecifiers.

Enumerator
PQ_None 
PQ_StorageClassSpecifier 
PQ_TypeSpecifier 
PQ_TypeQualifier 
PQ_FunctionSpecifier 

Definition at line 321 of file DeclSpec.h.

storage-class-specifier

Note
The order of these enumerators is important for diagnostics.
Enumerator
SCS_unspecified 
SCS_typedef 
SCS_extern 
SCS_static 
SCS_auto 
SCS_register 
SCS_private_extern 
SCS_mutable 

Definition at line 237 of file DeclSpec.h.

Enumerator
TQ_unspecified 
TQ_const 
TQ_restrict 
TQ_volatile 
TQ_atomic 

Definition at line 309 of file DeclSpec.h.

Enumerator
TSC_unspecified 
TSC_imaginary 
TSC_complex 

Definition at line 263 of file DeclSpec.h.

Constructor & Destructor Documentation

clang::DeclSpec::DeclSpec ( AttributeFactory attrFactory)
inline

Definition at line 415 of file DeclSpec.h.

Member Function Documentation

void clang::DeclSpec::addAttributes ( AttributeList AL)
inline

Concatenates two attribute lists.

The GCC attribute syntax allows for the following:

short __attribute__(( unused, deprecated ))
int __attribute__(( may_alias, aligned(16) )) var;

This declares 4 attributes using 2 lists. The following syntax is also allowed and equivalent to the previous declaration.

short __attribute__((unused)) __attribute__((deprecated))
int __attribute__((may_alias)) __attribute__((aligned(16))) var;

Definition at line 729 of file DeclSpec.h.

References clang::ParsedAttributes::addAll().

Referenced by addContextSensitiveTypeNullability(), and clang::Parser::ParseTypeName().

void clang::DeclSpec::ClearConceptSpec ( )
inline

Definition at line 703 of file DeclSpec.h.

void clang::DeclSpec::ClearConstexprSpec ( )
inline

Definition at line 698 of file DeclSpec.h.

Referenced by clang::Sema::ActOnCXXMemberDeclarator().

void clang::DeclSpec::ClearFunctionSpecs ( )
inline

Definition at line 565 of file DeclSpec.h.

void clang::DeclSpec::ClearStorageClassSpecs ( )
inline
void clang::DeclSpec::ClearTypeQualifiers ( )
inline

Clear out all of the type qualifiers.

Definition at line 540 of file DeclSpec.h.

Referenced by clang::Sema::BuildAnonymousStructOrUnion().

void clang::DeclSpec::ClearTypeSpecType ( )
inline

Definition at line 464 of file DeclSpec.h.

References TST_unspecified.

bool clang::DeclSpec::containsPlaceholderType ( ) const
inline
void DeclSpec::Finish ( DiagnosticsEngine D,
Preprocessor PP,
const PrintingPolicy Policy 
)

Finish - This does final analysis of the declspec, issuing diagnostics for things like "_Imaginary" (lacking an FP type). After calling this method, DeclSpec is guaranteed self-consistent, even if an error occurred.

Finish - This does final analysis of the declspec, rejecting things like "_Imaginary" (lacking an FP type). This returns a diagnostic to issue or diag::NUM_DIAGNOSTICS if there is no error. After calling this method, DeclSpec is guaranteed self-consistent, even if an error occurred.

Definition at line 928 of file DeclSpec.cpp.

References ClearStorageClassSpecs(), clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateRemoval(), Diag(), getExplicitSpecLoc(), clang::Preprocessor::getLangOpts(), clang::Preprocessor::getLocForEndOfToken(), clang::Preprocessor::getSourceManager(), getSpecifierName(), getStorageClassSpec(), getStorageClassSpecLoc(), clang::Preprocessor::getTargetInfo(), getThreadStorageClassSpec(), getThreadStorageClassSpecLoc(), getTypeSpecComplexLoc(), getVirtualSpecLoc(), clang::TargetInfo::hasFeature(), clang::SourceManager::isBeforeInTranslationUnit(), isDeclRep(), isExplicitSpecified(), isFriendSpecified(), clang::SourceLocation::isInvalid(), isInvalid(), isVirtualSpecified(), SCS_auto, SCS_extern, SCS_private_extern, SCS_static, SCS_unspecified, TSC_unspecified, TSCS_unspecified, TSS_unsigned, TSS_unspecified, TST_auto, TST_char, TST_char16, TST_char32, TST_decltype_auto, TST_double, TST_float, TST_int, TST_int128, TST_unspecified, TST_wchar, TSW_long, TSW_longlong, TSW_short, and TSW_unspecified.

SourceLocation clang::DeclSpec::getAltiVecLoc ( ) const
inline

Definition at line 504 of file DeclSpec.h.

SourceLocation clang::DeclSpec::getAtomicSpecLoc ( ) const
inline
AttributePool& clang::DeclSpec::getAttributePool ( ) const
inline

Definition at line 708 of file DeclSpec.h.

References clang::ParsedAttributes::getPool().

Referenced by takeDeclAttributes().

ParsedAttributes& clang::DeclSpec::getAttributes ( )
inline
const ParsedAttributes& clang::DeclSpec::getAttributes ( ) const
inline

Definition at line 736 of file DeclSpec.h.

SourceLocation clang::DeclSpec::getConceptSpecLoc ( ) const
inline

Definition at line 696 of file DeclSpec.h.

SourceLocation clang::DeclSpec::getConstexprSpecLoc ( ) const
inline
SourceLocation clang::DeclSpec::getConstSpecLoc ( ) const
inline
SourceLocation clang::DeclSpec::getExplicitSpecLoc ( ) const
inline
SourceLocation clang::DeclSpec::getFriendSpecLoc ( ) const
inline
SourceLocation clang::DeclSpec::getInlineSpecLoc ( ) const
inline
SourceLocation clang::DeclSpec::getLocEnd ( ) const
inline

Definition at line 498 of file DeclSpec.h.

References clang::SourceRange::getEnd().

Referenced by GetFullTypeForDeclarator().

SourceLocation clang::DeclSpec::getLocStart ( ) const
inline
SourceLocation clang::DeclSpec::getModulePrivateSpecLoc ( ) const
inline
SourceLocation clang::DeclSpec::getNoreturnSpecLoc ( ) const
inline
ObjCDeclSpec* clang::DeclSpec::getObjCQualifiers ( ) const
inline

Definition at line 752 of file DeclSpec.h.

unsigned DeclSpec::getParsedSpecifiers ( ) const

Return a bitmask of which flavors of specifiers this DeclSpec includes.

getParsedSpecifiers - Return a bitmask of which flavors of specifiers this declaration specifier includes.

Definition at line 362 of file DeclSpec.cpp.

References hasTypeSpecifier(), PQ_FunctionSpecifier, PQ_StorageClassSpecifier, PQ_TypeQualifier, PQ_TypeSpecifier, SCS_unspecified, TQ_unspecified, and TSCS_unspecified.

Referenced by clang::Sema::CodeCompleteDeclSpec(), and isEmpty().

Decl* clang::DeclSpec::getRepAsDecl ( ) const
inline
Expr* clang::DeclSpec::getRepAsExpr ( ) const
inline
ParsedType clang::DeclSpec::getRepAsType ( ) const
inline
SourceLocation clang::DeclSpec::getRestrictSpecLoc ( ) const
inline
const SourceRange& clang::DeclSpec::getSourceRange ( ) const
inline
const char * DeclSpec::getSpecifierName ( DeclSpec::TST  T,
const PrintingPolicy Policy 
)
static
const char * DeclSpec::getSpecifierName ( DeclSpec::TQ  Q)
static

Definition at line 483 of file DeclSpec.cpp.

References TQ_atomic, TQ_const, TQ_restrict, TQ_unspecified, and TQ_volatile.

const char * DeclSpec::getSpecifierName ( DeclSpec::TSS  S)
static

Definition at line 437 of file DeclSpec.cpp.

References TSS_signed, TSS_unsigned, and TSS_unspecified.

const char * DeclSpec::getSpecifierName ( DeclSpec::TSC  C)
static

Definition at line 427 of file DeclSpec.cpp.

References TSC_complex, TSC_imaginary, and TSC_unspecified.

const char * DeclSpec::getSpecifierName ( DeclSpec::TSW  W)
static

Definition at line 417 of file DeclSpec.cpp.

References TSW_long, TSW_longlong, TSW_short, and TSW_unspecified.

const char * DeclSpec::getSpecifierName ( DeclSpec::SCS  S)
static
const char * DeclSpec::getSpecifierName ( DeclSpec::TSCS  S)
static

Definition at line 407 of file DeclSpec.cpp.

References TSCS___thread, TSCS__Thread_local, TSCS_thread_local, and TSCS_unspecified.

SCS clang::DeclSpec::getStorageClassSpec ( ) const
inline
SourceLocation clang::DeclSpec::getStorageClassSpecLoc ( ) const
inline
TSCS clang::DeclSpec::getThreadStorageClassSpec ( ) const
inline
SourceLocation clang::DeclSpec::getThreadStorageClassSpecLoc ( ) const
inline
SourceRange clang::DeclSpec::getTypeofParensRange ( ) const
inline

Definition at line 511 of file DeclSpec.h.

unsigned clang::DeclSpec::getTypeQualifiers ( ) const
inline
TSC clang::DeclSpec::getTypeSpecComplex ( ) const
inline
SourceLocation clang::DeclSpec::getTypeSpecComplexLoc ( ) const
inline

Definition at line 501 of file DeclSpec.h.

Referenced by Finish().

CXXScopeSpec& clang::DeclSpec::getTypeSpecScope ( )
inline

Definition at line 493 of file DeclSpec.h.

Referenced by ConvertDeclSpecToType(), and clang::Sema::ParsedFreeStandingDeclSpec().

const CXXScopeSpec& clang::DeclSpec::getTypeSpecScope ( ) const
inline

Definition at line 494 of file DeclSpec.h.

TSS clang::DeclSpec::getTypeSpecSign ( ) const
inline
SourceLocation clang::DeclSpec::getTypeSpecSignLoc ( ) const
inline

Definition at line 502 of file DeclSpec.h.

Referenced by ConvertDeclSpecToType().

TST clang::DeclSpec::getTypeSpecType ( ) const
inline
SourceLocation clang::DeclSpec::getTypeSpecTypeLoc ( ) const
inline
SourceLocation clang::DeclSpec::getTypeSpecTypeNameLoc ( ) const
inline

Definition at line 506 of file DeclSpec.h.

References isDeclRep(), and TST_typename.

Referenced by ConvertDeclSpecToType().

TSW clang::DeclSpec::getTypeSpecWidth ( ) const
inline

Definition at line 471 of file DeclSpec.h.

Referenced by ConvertDeclSpecToType(), and hasTypeSpecifier().

SourceLocation clang::DeclSpec::getTypeSpecWidthLoc ( ) const
inline

Definition at line 500 of file DeclSpec.h.

Referenced by ConvertDeclSpecToType().

SourceLocation clang::DeclSpec::getVirtualSpecLoc ( ) const
inline
SourceLocation clang::DeclSpec::getVolatileSpecLoc ( ) const
inline
const WrittenBuiltinSpecs& clang::DeclSpec::getWrittenBuiltinSpecs ( ) const
inline

Definition at line 748 of file DeclSpec.h.

bool clang::DeclSpec::hasAttributes ( ) const
inline

Definition at line 733 of file DeclSpec.h.

References clang::ParsedAttributes::empty().

bool DeclSpec::hasTagDefinition ( ) const

Definition at line 353 of file DeclSpec.cpp.

References getRepAsDecl().

Referenced by GetFullTypeForDeclarator().

bool clang::DeclSpec::hasTypeSpecifier ( ) const
inline
bool clang::DeclSpec::isConceptSpecified ( ) const
inline

Definition at line 695 of file DeclSpec.h.

bool clang::DeclSpec::isConstexprSpecified ( ) const
inline
static bool clang::DeclSpec::isDeclRep ( TST  T)
inlinestatic
bool clang::DeclSpec::isEmpty ( ) const
inline

isEmpty - Return true if this declaration specifier is completely empty: no tokens were parsed in the production of it.

Definition at line 592 of file DeclSpec.h.

References getParsedSpecifiers(), and PQ_None.

Referenced by ConvertDeclSpecToType().

bool clang::DeclSpec::isExplicitSpecified ( ) const
inline
bool clang::DeclSpec::isExternInLinkageSpec ( ) const
inline
bool clang::DeclSpec::isFriendSpecified ( ) const
inline
bool clang::DeclSpec::isInlineSpecified ( ) const
inline
bool DeclSpec::isMissingDeclaratorOk ( )

Checks if this DeclSpec can stand alone, without a Declarator.

Only tag declspecs can stand alone.

Definition at line 1209 of file DeclSpec.cpp.

References getRepAsDecl(), getTypeSpecType(), isDeclRep(), and SCS_typedef.

Referenced by clang::Sema::ParsedFreeStandingDeclSpec().

bool clang::DeclSpec::isModulePrivateSpecified ( ) const
inline
bool clang::DeclSpec::isNoreturnSpecified ( ) const
inline
bool clang::DeclSpec::isTypeAltiVecBool ( ) const
inline

Definition at line 477 of file DeclSpec.h.

bool clang::DeclSpec::isTypeAltiVecPixel ( ) const
inline

Definition at line 476 of file DeclSpec.h.

bool clang::DeclSpec::isTypeAltiVecVector ( ) const
inline

Definition at line 475 of file DeclSpec.h.

Referenced by clang::Sema::CodeCompleteDeclSpec().

bool clang::DeclSpec::isTypeRep ( ) const
inline

Definition at line 479 of file DeclSpec.h.

References isTypeRep().

Referenced by getRepAsType(), isTypeRep(), SetTypeSpecType(), and UpdateTypeRep().

bool clang::DeclSpec::isTypeSpecOwned ( ) const
inline
bool clang::DeclSpec::isVirtualSpecified ( ) const
inline
bool DeclSpec::SetConceptSpec ( SourceLocation  Loc,
const char *&  PrevSpec,
unsigned DiagID 
)

Definition at line 896 of file DeclSpec.cpp.

bool DeclSpec::SetConstexprSpec ( SourceLocation  Loc,
const char *&  PrevSpec,
unsigned DiagID 
)

Definition at line 882 of file DeclSpec.cpp.

void clang::DeclSpec::setExternInLinkageSpec ( bool  Value)
inline

Definition at line 447 of file DeclSpec.h.

bool DeclSpec::SetFriendSpec ( SourceLocation  Loc,
const char *&  PrevSpec,
unsigned DiagID 
)

Definition at line 852 of file DeclSpec.cpp.

bool DeclSpec::setFunctionSpecExplicit ( SourceLocation  Loc,
const char *&  PrevSpec,
unsigned DiagID 
)

Definition at line 822 of file DeclSpec.cpp.

bool DeclSpec::setFunctionSpecForceInline ( SourceLocation  Loc,
const char *&  PrevSpec,
unsigned DiagID 
)

Definition at line 795 of file DeclSpec.cpp.

bool DeclSpec::setFunctionSpecInline ( SourceLocation  Loc,
const char *&  PrevSpec,
unsigned DiagID 
)

Definition at line 781 of file DeclSpec.cpp.

bool DeclSpec::setFunctionSpecNoreturn ( SourceLocation  Loc,
const char *&  PrevSpec,
unsigned DiagID 
)

Definition at line 837 of file DeclSpec.cpp.

bool DeclSpec::setFunctionSpecVirtual ( SourceLocation  Loc,
const char *&  PrevSpec,
unsigned DiagID 
)

Definition at line 807 of file DeclSpec.cpp.

bool DeclSpec::setModulePrivateSpec ( SourceLocation  Loc,
const char *&  PrevSpec,
unsigned DiagID 
)

Definition at line 870 of file DeclSpec.cpp.

References isModulePrivateSpecified().

void clang::DeclSpec::setObjCQualifiers ( ObjCDeclSpec quals)
inline

Definition at line 753 of file DeclSpec.h.

void clang::DeclSpec::SetRangeEnd ( SourceLocation  Loc)
inline
void clang::DeclSpec::SetRangeStart ( SourceLocation  Loc)
inline
bool DeclSpec::SetStorageClassSpec ( Sema S,
SCS  SC,
SourceLocation  Loc,
const char *&  PrevSpec,
unsigned DiagID,
const PrintingPolicy Policy 
)

These methods set the specified attribute of the DeclSpec and return false if there was no error. If an error occurs (for example, if we tried to set "auto" on a spec with "extern" already set), they return true and set PrevSpec and DiagID such that Diag(Loc, DiagID) << PrevSpec; will yield a useful result.

TODO: use a more general approach that still allows these diagnostics to be ignored when desired.

Definition at line 494 of file DeclSpec.cpp.

References BadSpecifier(), clang::Sema::getLangOpts(), clang::Sema::getOpenCLOptions(), getSpecifierName(), isInvalid(), SCS_auto, SCS_extern, SCS_private_extern, SCS_register, SCS_static, SCS_typedef, SCS_unspecified, SetTypeSpecType(), TST_auto, and TST_unspecified.

Referenced by clang::Sema::ActOnCXXMemberDeclarator(), and clang::Sema::BuildAnonymousStructOrUnion().

bool DeclSpec::SetStorageClassSpecThread ( TSCS  TSC,
SourceLocation  Loc,
const char *&  PrevSpec,
unsigned DiagID 
)

Definition at line 555 of file DeclSpec.cpp.

References BadSpecifier(), and TSCS_unspecified.

bool DeclSpec::SetTypeAltiVecBool ( bool  isAltiVecBool,
SourceLocation  Loc,
const char *&  PrevSpec,
unsigned DiagID,
const PrintingPolicy Policy 
)

Definition at line 733 of file DeclSpec.cpp.

References getSpecifierName(), and TST_unspecified.

bool DeclSpec::SetTypeAltiVecPixel ( bool  isAltiVecPixel,
SourceLocation  Loc,
const char *&  PrevSpec,
unsigned DiagID,
const PrintingPolicy Policy 
)

Definition at line 718 of file DeclSpec.cpp.

References getSpecifierName(), and TST_unspecified.

bool DeclSpec::SetTypeAltiVecVector ( bool  isAltiVecVector,
SourceLocation  Loc,
const char *&  PrevSpec,
unsigned DiagID,
const PrintingPolicy Policy 
)

Definition at line 705 of file DeclSpec.cpp.

References getSpecifierName(), and TST_unspecified.

void clang::DeclSpec::setTypeofParensRange ( SourceRange  range)
inline

Definition at line 512 of file DeclSpec.h.

bool DeclSpec::SetTypeQual ( TQ  T,
SourceLocation  Loc,
const char *&  PrevSpec,
unsigned DiagID,
const LangOptions Lang 
)
bool DeclSpec::SetTypeSpecComplex ( TSC  C,
SourceLocation  Loc,
const char *&  PrevSpec,
unsigned DiagID 
)

Definition at line 584 of file DeclSpec.cpp.

References BadSpecifier(), AttributeLangSupport::C, and TSC_unspecified.

bool DeclSpec::SetTypeSpecError ( )

Definition at line 748 of file DeclSpec.cpp.

References TST_error.

bool DeclSpec::SetTypeSpecSign ( TSS  S,
SourceLocation  Loc,
const char *&  PrevSpec,
unsigned DiagID 
)

Definition at line 594 of file DeclSpec.cpp.

References BadSpecifier(), S, and TSS_unspecified.

bool DeclSpec::SetTypeSpecType ( TST  T,
SourceLocation  Loc,
const char *&  PrevSpec,
unsigned DiagID,
const PrintingPolicy Policy 
)
bool DeclSpec::SetTypeSpecType ( TST  T,
SourceLocation  Loc,
const char *&  PrevSpec,
unsigned DiagID,
ParsedType  Rep,
const PrintingPolicy Policy 
)

Definition at line 604 of file DeclSpec.cpp.

References SetTypeSpecType().

bool DeclSpec::SetTypeSpecType ( TST  T,
SourceLocation  Loc,
const char *&  PrevSpec,
unsigned DiagID,
Decl Rep,
bool  Owned,
const PrintingPolicy Policy 
)

Definition at line 653 of file DeclSpec.cpp.

References SetTypeSpecType().

bool DeclSpec::SetTypeSpecType ( TST  T,
SourceLocation  TagKwLoc,
SourceLocation  TagNameLoc,
const char *&  PrevSpec,
unsigned DiagID,
ParsedType  Rep,
const PrintingPolicy Policy 
)

Definition at line 612 of file DeclSpec.cpp.

References getSpecifierName(), isTypeRep(), TST_unspecified, and TypeRep.

bool DeclSpec::SetTypeSpecType ( TST  T,
SourceLocation  TagKwLoc,
SourceLocation  TagNameLoc,
const char *&  PrevSpec,
unsigned DiagID,
Decl Rep,
bool  Owned,
const PrintingPolicy Policy 
)

Definition at line 661 of file DeclSpec.cpp.

References DeclRep, getSpecifierName(), isDeclRep(), and TST_unspecified.

bool DeclSpec::SetTypeSpecType ( TST  T,
SourceLocation  Loc,
const char *&  PrevSpec,
unsigned DiagID,
Expr Rep,
const PrintingPolicy policy 
)

Definition at line 633 of file DeclSpec.cpp.

References ExprRep, getSpecifierName(), and TST_unspecified.

bool DeclSpec::SetTypeSpecWidth ( TSW  W,
SourceLocation  Loc,
const char *&  PrevSpec,
unsigned DiagID,
const PrintingPolicy Policy 
)

These methods set the specified attribute of the DeclSpec, but return true and ignore the request if invalid (e.g. "extern" then "auto" is specified).

Definition at line 569 of file DeclSpec.cpp.

References BadSpecifier(), TSW_long, TSW_longlong, and TSW_unspecified.

void clang::DeclSpec::takeAttributesFrom ( ParsedAttributes attrs)
inline

Definition at line 738 of file DeclSpec.h.

References clang::ParsedAttributes::takeAllFrom().

void clang::DeclSpec::UpdateDeclRep ( Decl Rep)
inline

Definition at line 650 of file DeclSpec.h.

References DeclRep, and isDeclRep().

void clang::DeclSpec::UpdateExprRep ( Expr Rep)
inline

Definition at line 658 of file DeclSpec.h.

References ExprRep.

Referenced by RebuildDeclaratorInCurrentInstantiation().

void clang::DeclSpec::UpdateTypeRep ( ParsedType  Rep)
inline

Definition at line 654 of file DeclSpec.h.

References isTypeRep(), and TypeRep.

Referenced by RebuildDeclaratorInCurrentInstantiation().

Member Data Documentation

Decl* clang::DeclSpec::DeclRep

Definition at line 366 of file DeclSpec.h.

Referenced by getRepAsDecl(), SetTypeSpecType(), and UpdateDeclRep().

Expr* clang::DeclSpec::ExprRep

Definition at line 367 of file DeclSpec.h.

Referenced by getRepAsExpr(), SetTypeSpecType(), and UpdateExprRep().

const TSCS clang::DeclSpec::TSCS___thread = clang::TSCS___thread
static

Definition at line 252 of file DeclSpec.h.

Referenced by getSpecifierName().

const TSCS clang::DeclSpec::TSCS__Thread_local = clang::TSCS__Thread_local
static

Definition at line 254 of file DeclSpec.h.

Referenced by getSpecifierName().

const TSCS clang::DeclSpec::TSCS_thread_local = clang::TSCS_thread_local
static

Definition at line 253 of file DeclSpec.h.

Referenced by clang::Sema::ActOnVariableDeclarator(), and getSpecifierName().

const TSCS clang::DeclSpec::TSCS_unspecified = clang::TSCS_unspecified
static
const TSS clang::DeclSpec::TSS_signed = clang::TSS_signed
static

Definition at line 272 of file DeclSpec.h.

Referenced by ConvertDeclSpecToType(), and getSpecifierName().

const TSS clang::DeclSpec::TSS_unsigned = clang::TSS_unsigned
static

Definition at line 273 of file DeclSpec.h.

Referenced by ConvertDeclSpecToType(), Finish(), and getSpecifierName().

const TSS clang::DeclSpec::TSS_unspecified = clang::TSS_unspecified
static
const TST clang::DeclSpec::TST_atomic = clang::TST_atomic
static
const TST clang::DeclSpec::TST_auto = clang::TST_auto
static
const TST clang::DeclSpec::TST_bool = clang::TST_bool
static

Definition at line 288 of file DeclSpec.h.

Referenced by ConvertDeclSpecToType(), getSpecifierName(), and SetTypeSpecType().

const TST clang::DeclSpec::TST_char = clang::TST_char
static

Definition at line 279 of file DeclSpec.h.

Referenced by ConvertDeclSpecToType(), Finish(), and getSpecifierName().

const TST clang::DeclSpec::TST_char16 = clang::TST_char16
static

Definition at line 281 of file DeclSpec.h.

Referenced by ConvertDeclSpecToType(), Finish(), and getSpecifierName().

const TST clang::DeclSpec::TST_char32 = clang::TST_char32
static

Definition at line 282 of file DeclSpec.h.

Referenced by ConvertDeclSpecToType(), Finish(), and getSpecifierName().

const TST clang::DeclSpec::TST_class = clang::TST_class
static
const TST clang::DeclSpec::TST_decimal128 = clang::TST_decimal128
static

Definition at line 291 of file DeclSpec.h.

Referenced by ConvertDeclSpecToType(), and getSpecifierName().

const TST clang::DeclSpec::TST_decimal32 = clang::TST_decimal32
static

Definition at line 289 of file DeclSpec.h.

Referenced by ConvertDeclSpecToType(), and getSpecifierName().

const TST clang::DeclSpec::TST_decimal64 = clang::TST_decimal64
static

Definition at line 290 of file DeclSpec.h.

Referenced by ConvertDeclSpecToType(), and getSpecifierName().

const TST clang::DeclSpec::TST_decltype = clang::TST_decltype
static
const TST clang::DeclSpec::TST_decltype_auto = clang::TST_decltype_auto
static
const TST clang::DeclSpec::TST_double = clang::TST_double
static

Definition at line 287 of file DeclSpec.h.

Referenced by ConvertDeclSpecToType(), Finish(), and getSpecifierName().

const TST clang::DeclSpec::TST_enum = clang::TST_enum
static
const TST clang::DeclSpec::TST_error = clang::TST_error
static
const TST clang::DeclSpec::TST_float = clang::TST_float
static

Definition at line 286 of file DeclSpec.h.

Referenced by ConvertDeclSpecToType(), Finish(), and getSpecifierName().

const TST clang::DeclSpec::TST_half = clang::TST_half
static

Definition at line 285 of file DeclSpec.h.

Referenced by ConvertDeclSpecToType(), and getSpecifierName().

const TST clang::DeclSpec::TST_int = clang::TST_int
static
const TST clang::DeclSpec::TST_int128 = clang::TST_int128
static

Definition at line 284 of file DeclSpec.h.

Referenced by ConvertDeclSpecToType(), Finish(), and getSpecifierName().

const TST clang::DeclSpec::TST_interface = clang::TST_interface
static
const TST clang::DeclSpec::TST_struct = clang::TST_struct
static
const TST clang::DeclSpec::TST_typename = clang::TST_typename
static
const TST clang::DeclSpec::TST_typeofExpr = clang::TST_typeofExpr
static
const TST clang::DeclSpec::TST_typeofType = clang::TST_typeofType
static
const TST clang::DeclSpec::TST_underlyingType = clang::TST_underlyingType
static
const TST clang::DeclSpec::TST_union = clang::TST_union
static
const TST clang::DeclSpec::TST_unknown_anytype = clang::TST_unknown_anytype
static

Definition at line 304 of file DeclSpec.h.

Referenced by ConvertDeclSpecToType(), and getSpecifierName().

const TST clang::DeclSpec::TST_unspecified = clang::TST_unspecified
static
const TST clang::DeclSpec::TST_void = clang::TST_void
static

Definition at line 278 of file DeclSpec.h.

Referenced by ConvertDeclSpecToType(), and getSpecifierName().

const TST clang::DeclSpec::TST_wchar = clang::TST_wchar
static

Definition at line 280 of file DeclSpec.h.

Referenced by ConvertDeclSpecToType(), Finish(), and getSpecifierName().

const TSW clang::DeclSpec::TSW_long = clang::TSW_long
static

Definition at line 260 of file DeclSpec.h.

Referenced by ConvertDeclSpecToType(), Finish(), getSpecifierName(), and SetTypeSpecWidth().

const TSW clang::DeclSpec::TSW_longlong = clang::TSW_longlong
static

Definition at line 261 of file DeclSpec.h.

Referenced by ConvertDeclSpecToType(), Finish(), getSpecifierName(), and SetTypeSpecWidth().

const TSW clang::DeclSpec::TSW_short = clang::TSW_short
static

Definition at line 259 of file DeclSpec.h.

Referenced by ConvertDeclSpecToType(), Finish(), and getSpecifierName().

const TSW clang::DeclSpec::TSW_unspecified = clang::TSW_unspecified
static
UnionParsedType clang::DeclSpec::TypeRep

Definition at line 365 of file DeclSpec.h.

Referenced by getRepAsType(), SetTypeSpecType(), and UpdateTypeRep().


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