clang API Documentation

Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes
clang::DeclSpec Class Reference

#include <DeclSpec.h>

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

List of all members.

Public Types

enum  SCS {
  SCS_unspecified = 0, SCS_typedef, SCS_extern, SCS_static,
  SCS_auto, SCS_register, SCS_private_extern, SCS_mutable
}
enum  TSC { TSC_unspecified, TSC_imaginary, TSC_complex }
enum  TQ { TQ_unspecified = 0, TQ_const = 1, TQ_restrict = 2, TQ_volatile = 4 }
enum  ParsedSpecifiers {
  PQ_None = 0, PQ_StorageClassSpecifier = 1, PQ_TypeSpecifier = 2, PQ_TypeQualifier = 4,
  PQ_FunctionSpecifier = 8
}
typedef TypeSpecifierWidth TSW
typedef TypeSpecifierSign TSS
typedef TypeSpecifierType TST
typedef Decl *const * ProtocolQualifierListTy

Public Member Functions

 DeclSpec (AttributeFactory &attrFactory)
 ~DeclSpec ()
SCS getStorageClassSpec () const
bool isThreadSpecified () const
bool isExternInLinkageSpec () const
void setExternInLinkageSpec (bool Value)
SourceLocation getStorageClassSpecLoc () const
SourceLocation getThreadSpecLoc () const
void ClearStorageClassSpecs ()
TSW getTypeSpecWidth () const
TSC getTypeSpecComplex () const
TSS getTypeSpecSign () const
TST getTypeSpecType () const
bool isTypeAltiVecVector () const
bool isTypeAltiVecPixel () const
bool isTypeAltiVecBool () const
bool isTypeSpecOwned () 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)
unsigned getTypeQualifiers () const
 getTypeQualifiers - Return a set of TQs.
SourceLocation getConstSpecLoc () const
SourceLocation getRestrictSpecLoc () const
SourceLocation getVolatileSpecLoc () const
void ClearTypeQualifiers ()
 Clear out all of the type qualifiers.
bool isInlineSpecified () const
SourceLocation getInlineSpecLoc () const
bool isVirtualSpecified () const
SourceLocation getVirtualSpecLoc () const
bool isExplicitSpecified () const
SourceLocation getExplicitSpecLoc () const
void ClearFunctionSpecs ()
bool hasTypeSpecifier () const
 hasTypeSpecifier - Return true if any type-specifier has been found.
unsigned getParsedSpecifiers () const
SCS getStorageClassSpecAsWritten () const
bool isEmpty () const
void SetRangeStart (SourceLocation Loc)
void SetRangeEnd (SourceLocation Loc)
bool SetStorageClassSpec (Sema &S, SCS SC, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
bool SetStorageClassSpecThread (SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
bool SetTypeSpecWidth (TSW W, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
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)
bool SetTypeSpecType (TST T, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID, ParsedType Rep)
bool SetTypeSpecType (TST T, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID, Decl *Rep, bool Owned)
bool SetTypeSpecType (TST T, SourceLocation TagKwLoc, SourceLocation TagNameLoc, const char *&PrevSpec, unsigned &DiagID, ParsedType Rep)
bool SetTypeSpecType (TST T, SourceLocation TagKwLoc, SourceLocation TagNameLoc, const char *&PrevSpec, unsigned &DiagID, Decl *Rep, bool Owned)
bool SetTypeSpecType (TST T, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID, Expr *Rep)
bool SetTypeAltiVecVector (bool isAltiVecVector, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
bool SetTypeAltiVecPixel (bool isAltiVecPixel, SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
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 SetFunctionSpecVirtual (SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID)
bool SetFunctionSpecExplicit (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 isFriendSpecified () const
SourceLocation getFriendSpecLoc () const
bool isModulePrivateSpecified () const
SourceLocation getModulePrivateSpecLoc () const
bool isConstexprSpecified () const
SourceLocation getConstexprSpecLoc () const
void ClearConstexprSpec ()
AttributePoolgetAttributePool () const
void addAttributes (AttributeList *AL)
void setAttributes (AttributeList *AL)
bool hasAttributes () const
ParsedAttributesgetAttributes ()
const ParsedAttributesgetAttributes () const
ParsedAttributes takeAttributes ()
void takeAttributesFrom (ParsedAttributes &attrs)
ProtocolQualifierListTy getProtocolQualifiers () const
SourceLocationgetProtocolLocs () const
unsigned getNumProtocolQualifiers () const
SourceLocation getProtocolLAngleLoc () const
void setProtocolQualifiers (Decl *const *Protos, unsigned NP, SourceLocation *ProtoLocs, SourceLocation LAngleLoc)
void Finish (DiagnosticsEngine &D, Preprocessor &PP)
const WrittenBuiltinSpecsgetWrittenBuiltinSpecs () const
ObjCDeclSpecgetObjCQualifiers () const
void setObjCQualifiers (ObjCDeclSpec *quals)
bool isMissingDeclaratorOk ()

Static Public Member Functions

static const char * getSpecifierName (DeclSpec::TST T)
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 Public Attributes

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_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_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

DeclSpec - This class captures information about "declaration specifiers", which encompasses storage-class-specifiers, type-specifiers, type-qualifiers, and function-specifiers.

Definition at line 205 of file DeclSpec.h.


Member Typedef Documentation

Definition at line 662 of file DeclSpec.h.

Definition at line 234 of file DeclSpec.h.

Definition at line 240 of file DeclSpec.h.

Definition at line 221 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 280 of file DeclSpec.h.

Enumerator:
SCS_unspecified 
SCS_typedef 
SCS_extern 
SCS_static 
SCS_auto 
SCS_register 
SCS_private_extern 
SCS_mutable 

Definition at line 209 of file DeclSpec.h.

Enumerator:
TQ_unspecified 
TQ_const 
TQ_restrict 
TQ_volatile 

Definition at line 271 of file DeclSpec.h.

Enumerator:
TSC_unspecified 
TSC_imaginary 
TSC_complex 

Definition at line 227 of file DeclSpec.h.


Constructor & Destructor Documentation

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

Definition at line 378 of file DeclSpec.h.

clang::DeclSpec::~DeclSpec ( ) [inline]

Definition at line 404 of file DeclSpec.h.


Member Function Documentation

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

AddAttributes - contatenates 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 639 of file DeclSpec.h.

References clang::ParsedAttributes::addAll().

void clang::DeclSpec::ClearConstexprSpec ( ) [inline]

Definition at line 618 of file DeclSpec.h.

void clang::DeclSpec::ClearFunctionSpecs ( ) [inline]

Definition at line 504 of file DeclSpec.h.

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

Clear out all of the type qualifiers.

Definition at line 487 of file DeclSpec.h.

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

void DeclSpec::Finish ( DiagnosticsEngine D,
Preprocessor PP 
)

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 775 of file DeclSpec.cpp.

References ClearStorageClassSpecs(), clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateRemoval(), Diag(), clang::Preprocessor::getLangOpts(), clang::Preprocessor::getLocForEndOfToken(), clang::SourceLocation::getLocWithOffset(), getSpecifierName(), getStorageClassSpec(), getStorageClassSpecLoc(), getTypeSpecComplexLoc(), isFriendSpecified(), SCS_auto, SCS_unspecified, TSC_unspecified, TSS_unsigned, TSS_unspecified, TST_auto, TST_char, TST_char16, TST_char32, 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 459 of file DeclSpec.h.

AttributePool& clang::DeclSpec::getAttributePool ( ) const [inline]

Definition at line 623 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 649 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 453 of file DeclSpec.h.

References clang::SourceRange::getEnd().

SourceLocation clang::DeclSpec::getLocStart ( ) const [inline]
SourceLocation clang::DeclSpec::getModulePrivateSpecLoc ( ) const [inline]
unsigned clang::DeclSpec::getNumProtocolQualifiers ( ) const [inline]

Definition at line 667 of file DeclSpec.h.

Referenced by ConvertDeclSpecToType().

ObjCDeclSpec* clang::DeclSpec::getObjCQualifiers ( ) const [inline]

Definition at line 684 of file DeclSpec.h.

unsigned DeclSpec::getParsedSpecifiers ( ) const

getParsedSpecifiers - 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 305 of file DeclSpec.cpp.

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

Referenced by isEmpty().

SourceLocation clang::DeclSpec::getProtocolLAngleLoc ( ) const [inline]

Definition at line 670 of file DeclSpec.h.

SourceLocation* clang::DeclSpec::getProtocolLocs ( ) const [inline]

Definition at line 666 of file DeclSpec.h.

ProtocolQualifierListTy clang::DeclSpec::getProtocolQualifiers ( ) const [inline]

Definition at line 663 of file DeclSpec.h.

Referenced by ConvertDeclSpecToType().

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) [static]
const char * DeclSpec::getSpecifierName ( DeclSpec::TQ  Q) [static]

Definition at line 408 of file DeclSpec.cpp.

References TQ_const, TQ_restrict, TQ_unspecified, and TQ_volatile.

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

Definition at line 365 of file DeclSpec.cpp.

References TSS_signed, TSS_unsigned, and TSS_unspecified.

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

Definition at line 355 of file DeclSpec.cpp.

References TSC_complex, TSC_imaginary, and TSC_unspecified.

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

Definition at line 345 of file DeclSpec.cpp.

References TSW_long, TSW_longlong, TSW_short, and TSW_unspecified.

const char * DeclSpec::getSpecifierName ( DeclSpec::SCS  S) [static]
SCS clang::DeclSpec::getStorageClassSpec ( ) const [inline]
SCS clang::DeclSpec::getStorageClassSpecAsWritten ( ) const [inline]
SourceLocation clang::DeclSpec::getStorageClassSpecLoc ( ) const [inline]
SourceLocation clang::DeclSpec::getThreadSpecLoc ( ) const [inline]
SourceRange clang::DeclSpec::getTypeofParensRange ( ) const [inline]

Definition at line 466 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 456 of file DeclSpec.h.

Referenced by Finish().

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

Definition at line 448 of file DeclSpec.h.

Referenced by ConvertDeclSpecToType().

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

Definition at line 449 of file DeclSpec.h.

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

Definition at line 457 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 461 of file DeclSpec.h.

References TST_typename.

Referenced by ConvertDeclSpecToType().

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

Definition at line 428 of file DeclSpec.h.

Referenced by ConvertDeclSpecToType(), and hasTypeSpecifier().

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

Definition at line 455 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 680 of file DeclSpec.h.

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

Definition at line 646 of file DeclSpec.h.

References clang::ParsedAttributes::empty().

bool clang::DeclSpec::hasTypeSpecifier ( ) const [inline]
bool clang::DeclSpec::isConstexprSpecified ( ) const [inline]
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 532 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 ( )

isMissingDeclaratorOk - This checks if this DeclSpec can stand alone, without a Declarator. Only tag declspecs can stand alone.

Definition at line 932 of file DeclSpec.cpp.

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

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

bool clang::DeclSpec::isModulePrivateSpecified ( ) const [inline]
bool clang::DeclSpec::isThreadSpecified ( ) const [inline]
bool clang::DeclSpec::isTypeAltiVecBool ( ) const [inline]

Definition at line 434 of file DeclSpec.h.

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

Definition at line 433 of file DeclSpec.h.

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

Definition at line 432 of file DeclSpec.h.

bool clang::DeclSpec::isTypeSpecOwned ( ) const [inline]
bool clang::DeclSpec::isVirtualSpecified ( ) const [inline]
void clang::DeclSpec::setAttributes ( AttributeList AL) [inline]

Definition at line 642 of file DeclSpec.h.

References clang::ParsedAttributes::set().

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

Definition at line 725 of file DeclSpec.cpp.

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

Definition at line 412 of file DeclSpec.h.

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

Definition at line 700 of file DeclSpec.cpp.

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

Definition at line 692 of file DeclSpec.cpp.

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

Definition at line 676 of file DeclSpec.cpp.

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

Definition at line 684 of file DeclSpec.cpp.

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

Definition at line 713 of file DeclSpec.cpp.

References isModulePrivateSpecified().

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

Definition at line 685 of file DeclSpec.h.

void DeclSpec::setProtocolQualifiers ( Decl *const *  Protos,
unsigned  NP,
SourceLocation ProtoLocs,
SourceLocation  LAngleLoc 
)

Definition at line 733 of file DeclSpec.cpp.

void clang::DeclSpec::SetRangeEnd ( SourceLocation  Loc) [inline]

Definition at line 537 of file DeclSpec.h.

References clang::SourceRange::setEnd().

void clang::DeclSpec::SetRangeStart ( SourceLocation  Loc) [inline]

Definition at line 536 of file DeclSpec.h.

References clang::SourceRange::setBegin().

bool DeclSpec::SetStorageClassSpec ( Sema S,
SCS  SC,
SourceLocation  Loc,
const char *&  PrevSpec,
unsigned &  DiagID 
)

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 418 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::BuildAnonymousStructOrUnion().

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

Definition at line 470 of file DeclSpec.cpp.

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

Definition at line 638 of file DeclSpec.cpp.

References getSpecifierName(), and TST_unspecified.

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

Definition at line 626 of file DeclSpec.cpp.

References getSpecifierName(), and TST_unspecified.

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

Definition at line 467 of file DeclSpec.h.

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

Definition at line 660 of file DeclSpec.cpp.

References BadSpecifier(), TQ_const, TQ_restrict, and TQ_volatile.

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

Definition at line 506 of file DeclSpec.cpp.

References BadSpecifier(), and TSC_unspecified.

bool DeclSpec::SetTypeSpecError ( )

Definition at line 652 of file DeclSpec.cpp.

References TST_error.

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

Definition at line 516 of file DeclSpec.cpp.

References BadSpecifier(), S, and TSS_unspecified.

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

Definition at line 526 of file DeclSpec.cpp.

References SetTypeSpecType().

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

Definition at line 572 of file DeclSpec.cpp.

References SetTypeSpecType().

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

Definition at line 533 of file DeclSpec.cpp.

References getSpecifierName(), TST_unspecified, and TypeRep.

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

Definition at line 579 of file DeclSpec.cpp.

References DeclRep, getSpecifierName(), and TST_unspecified.

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

Definition at line 553 of file DeclSpec.cpp.

References ExprRep, getSpecifierName(), and TST_unspecified.

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

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 486 of file DeclSpec.cpp.

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

ParsedAttributes clang::DeclSpec::takeAttributes ( ) [inline]

TakeAttributes - Return the current attribute list and remove them from the DeclSpec so that it doesn't own them.

Definition at line 653 of file DeclSpec.h.

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

Definition at line 658 of file DeclSpec.h.

References clang::ParsedAttributes::takeAllFrom().

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

Definition at line 579 of file DeclSpec.h.

References DeclRep.

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

Definition at line 587 of file DeclSpec.h.

References ExprRep.

Referenced by RebuildDeclaratorInCurrentInstantiation().

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

Definition at line 583 of file DeclSpec.h.

References TypeRep.

Referenced by RebuildDeclaratorInCurrentInstantiation().


Member Data Documentation

Definition at line 322 of file DeclSpec.h.

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

Definition at line 323 of file DeclSpec.h.

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

const TSS clang::DeclSpec::TSS_signed = clang::TSS_signed [static]

Definition at line 236 of file DeclSpec.h.

Referenced by ConvertDeclSpecToType(), and getSpecifierName().

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

Definition at line 237 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 252 of file DeclSpec.h.

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

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

Definition at line 243 of file DeclSpec.h.

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

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

Definition at line 245 of file DeclSpec.h.

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

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

Definition at line 246 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 255 of file DeclSpec.h.

Referenced by ConvertDeclSpecToType(), and getSpecifierName().

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

Definition at line 253 of file DeclSpec.h.

Referenced by ConvertDeclSpecToType(), and getSpecifierName().

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

Definition at line 254 of file DeclSpec.h.

Referenced by ConvertDeclSpecToType(), and getSpecifierName().

const TST clang::DeclSpec::TST_decltype = clang::TST_decltype [static]
const TST clang::DeclSpec::TST_double = clang::TST_double [static]

Definition at line 251 of file DeclSpec.h.

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

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 250 of file DeclSpec.h.

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

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

Definition at line 249 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 248 of file DeclSpec.h.

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

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 266 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 242 of file DeclSpec.h.

Referenced by ConvertDeclSpecToType(), and getSpecifierName().

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

Definition at line 244 of file DeclSpec.h.

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

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

Definition at line 224 of file DeclSpec.h.

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

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

Definition at line 225 of file DeclSpec.h.

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

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

Definition at line 223 of file DeclSpec.h.

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

const TSW clang::DeclSpec::TSW_unspecified = clang::TSW_unspecified [static]

Definition at line 321 of file DeclSpec.h.

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


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