clang  3.9.0
Public Types | Public Member Functions | Friends | List of all members
clang::Declarator Class Reference

Information about one declarator, including the parsed type information and the identifier. More...

#include <DeclSpec.h>

Inheritance diagram for clang::Declarator:
[legend]

Public Types

enum  TheContext {
  FileContext, PrototypeContext, ObjCResultContext, ObjCParameterContext,
  KNRTypeListContext, TypeNameContext, MemberContext, BlockContext,
  ForContext, InitStmtContext, ConditionContext, TemplateParamContext,
  CXXNewContext, CXXCatchContext, ObjCCatchContext, BlockLiteralContext,
  LambdaExprContext, LambdaExprParameterContext, ConversionIdContext, TrailingReturnContext,
  TemplateTypeArgContext, AliasDeclContext, AliasTemplateContext
}
 
typedef SmallVectorImpl
< DeclaratorChunk >
::const_iterator 
type_object_iterator
 
typedef llvm::iterator_range
< type_object_iterator
type_object_range
 

Public Member Functions

 Declarator (const DeclSpec &ds, TheContext C)
 
 ~Declarator ()
 
const DeclSpecgetDeclSpec () const
 getDeclSpec - Return the declaration-specifier that this declarator was declared with. More...
 
DeclSpecgetMutableDeclSpec ()
 getMutableDeclSpec - Return a non-const version of the DeclSpec. More...
 
AttributePoolgetAttributePool () const
 
const CXXScopeSpecgetCXXScopeSpec () const
 getCXXScopeSpec - Return the C++ scope specifier (global scope or nested-name-specifier) that is part of the declarator-id. More...
 
CXXScopeSpecgetCXXScopeSpec ()
 
UnqualifiedIdgetName ()
 Retrieve the name specified by this declarator. More...
 
TheContext getContext () const
 
bool isPrototypeContext () const
 
SourceRange getSourceRange () const LLVM_READONLY
 Get the source range that spans this declarator. More...
 
SourceLocation getLocStart () const LLVM_READONLY
 
SourceLocation getLocEnd () const LLVM_READONLY
 
void SetSourceRange (SourceRange R)
 
void SetRangeBegin (SourceLocation Loc)
 SetRangeBegin - Set the start of the source range to Loc, unless it's invalid. More...
 
void SetRangeEnd (SourceLocation Loc)
 SetRangeEnd - Set the end of the source range to Loc, unless it's invalid. More...
 
void ExtendWithDeclSpec (const DeclSpec &DS)
 ExtendWithDeclSpec - Extend the declarator source range to include the given declspec, unless its location is invalid. More...
 
void clear ()
 Reset the contents of this Declarator. More...
 
bool mayOmitIdentifier () const
 mayOmitIdentifier - Return true if the identifier is either optional or not allowed. More...
 
bool mayHaveIdentifier () const
 mayHaveIdentifier - Return true if the identifier is either optional or required. More...
 
bool diagnoseIdentifier () const
 diagnoseIdentifier - Return true if the identifier is prohibited and should be diagnosed (because it cannot be anything else). More...
 
bool mayBeFollowedByCXXDirectInit () const
 mayBeFollowedByCXXDirectInit - Return true if the declarator can be followed by a C++ direct initializer, e.g. More...
 
bool isPastIdentifier () const
 isPastIdentifier - Return true if we have parsed beyond the point where the More...
 
bool hasName () const
 hasName - Whether this declarator has a name, which might be an identifier (accessible via getIdentifier()) or some kind of special C++ name (constructor, destructor, etc.). More...
 
IdentifierInfogetIdentifier () const
 
SourceLocation getIdentifierLoc () const
 
void SetIdentifier (IdentifierInfo *Id, SourceLocation IdLoc)
 Set the name of this declarator to be the given identifier. More...
 
void AddTypeInfo (const DeclaratorChunk &TI, ParsedAttributes &attrs, SourceLocation EndLoc)
 AddTypeInfo - Add a chunk to this declarator. More...
 
void AddInnermostTypeInfo (const DeclaratorChunk &TI)
 Add a new innermost chunk to this declarator. More...
 
unsigned getNumTypeObjects () const
 Return the number of types applied to this declarator. More...
 
const DeclaratorChunkgetTypeObject (unsigned i) const
 Return the specified TypeInfo from this declarator. More...
 
DeclaratorChunkgetTypeObject (unsigned i)
 
type_object_range type_objects () const
 Returns the range of type objects, from the identifier outwards. More...
 
void DropFirstTypeObject ()
 
const DeclaratorChunkgetInnermostNonParenChunk () const
 Return the innermost (closest to the declarator) chunk of this declarator that is not a parens chunk, or null if there are no non-parens chunks. More...
 
const DeclaratorChunkgetOutermostNonParenChunk () const
 Return the outermost (furthest from the declarator) chunk of this declarator that is not a parens chunk, or null if there are no non-parens chunks. More...
 
bool isArrayOfUnknownBound () const
 isArrayOfUnknownBound - This method returns true if the declarator is a declarator for an array of unknown bound (looking through parentheses). More...
 
bool isFunctionDeclarator (unsigned &idx) const
 isFunctionDeclarator - This method returns true if the declarator is a function declarator (looking through parentheses). More...
 
bool isFunctionDeclarator () const
 isFunctionDeclarator - Once this declarator is fully parsed and formed, this method returns true if the identifier is a function declarator (looking through parentheses). More...
 
DeclaratorChunk::FunctionTypeInfogetFunctionTypeInfo ()
 getFunctionTypeInfo - Retrieves the function type info object (looking through parentheses). More...
 
const
DeclaratorChunk::FunctionTypeInfo
getFunctionTypeInfo () const
 getFunctionTypeInfo - Retrieves the function type info object (looking through parentheses). More...
 
bool isDeclarationOfFunction () const
 Determine whether the declaration that will be produced from this declaration will be a function. More...
 
bool isFunctionDeclarationContext () const
 Return true if this declaration appears in a context where a function declarator would be a function declaration. More...
 
bool isFunctionDeclaratorAFunctionDeclaration () const
 Return true if a function declarator at this position would be a function declaration. More...
 
void takeAttributes (ParsedAttributes &attrs, SourceLocation lastLoc)
 takeAttributes - Takes attributes from the given parsed-attributes set and add them to this declarator. More...
 
const AttributeListgetAttributes () const
 
AttributeListgetAttributes ()
 
AttributeList *& getAttrListRef ()
 
bool hasAttributes () const
 hasAttributes - do we contain any attributes? More...
 
void getCXX11AttributeRanges (SmallVectorImpl< SourceRange > &Ranges)
 Return a source range list of C++11 attributes associated with the declarator. More...
 
void setAsmLabel (Expr *E)
 
ExprgetAsmLabel () const
 
void setExtension (bool Val=true)
 
bool getExtension () const
 
void setObjCIvar (bool Val=true)
 
bool isObjCIvar () const
 
void setObjCWeakProperty (bool Val=true)
 
bool isObjCWeakProperty () const
 
void setInvalidType (bool Val=true)
 
bool isInvalidType () const
 
void setGroupingParens (bool flag)
 
bool hasGroupingParens () const
 
bool isFirstDeclarator () const
 
SourceLocation getCommaLoc () const
 
void setCommaLoc (SourceLocation CL)
 
bool hasEllipsis () const
 
SourceLocation getEllipsisLoc () const
 
void setEllipsisLoc (SourceLocation EL)
 
void setFunctionDefinitionKind (FunctionDefinitionKind Val)
 
bool isFunctionDefinition () const
 
FunctionDefinitionKind getFunctionDefinitionKind () const
 
bool isFirstDeclarationOfMember ()
 Returns true if this declares a real member and not a friend. More...
 
bool isStaticMember ()
 Returns true if this declares a static member. More...
 
bool isCtorOrDtor ()
 Returns true if this declares a constructor or a destructor. More...
 
void setRedeclaration (bool Val)
 
bool isRedeclaration () const
 

Friends

struct DeclaratorChunk
 

Detailed Description

Information about one declarator, including the parsed type information and the identifier.

When the declarator is fully formed, this is turned into the appropriate Decl object.

Declarators come in two types: normal declarators and abstract declarators. Abstract declarators are used when parsing types, and don't have an identifier. Normal declarators do have ID's.

Instances of this class should be a transient object that lives on the stack, not objects that are allocated in large quantities on the heap.

Definition at line 1624 of file DeclSpec.h.

Member Typedef Documentation

Definition at line 2017 of file DeclSpec.h.

Definition at line 2018 of file DeclSpec.h.

Member Enumeration Documentation

Enumerator
FileContext 
PrototypeContext 
ObjCResultContext 
ObjCParameterContext 
KNRTypeListContext 
TypeNameContext 
MemberContext 
BlockContext 
ForContext 
InitStmtContext 
ConditionContext 
TemplateParamContext 
CXXNewContext 
CXXCatchContext 
ObjCCatchContext 
BlockLiteralContext 
LambdaExprContext 
LambdaExprParameterContext 
ConversionIdContext 
TrailingReturnContext 
TemplateTypeArgContext 
AliasDeclContext 
AliasTemplateContext 

Definition at line 1626 of file DeclSpec.h.

Constructor & Destructor Documentation

clang::Declarator::Declarator ( const DeclSpec ds,
TheContext  C 
)
inline

Definition at line 1714 of file DeclSpec.h.

clang::Declarator::~Declarator ( )
inline

Definition at line 1724 of file DeclSpec.h.

References clear().

Member Function Documentation

void clang::Declarator::AddInnermostTypeInfo ( const DeclaratorChunk TI)
inline

Add a new innermost chunk to this declarator.

Definition at line 1999 of file DeclSpec.h.

Referenced by maybeSynthesizeBlockSignature().

void clang::Declarator::AddTypeInfo ( const DeclaratorChunk TI,
ParsedAttributes attrs,
SourceLocation  EndLoc 
)
inline
void clang::Declarator::clear ( )
inline
bool clang::Declarator::diagnoseIdentifier ( ) const
inline
void clang::Declarator::DropFirstTypeObject ( )
inline

Definition at line 2025 of file DeclSpec.h.

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

void clang::Declarator::ExtendWithDeclSpec ( const DeclSpec DS)
inline

ExtendWithDeclSpec - Extend the declarator source range to include the given declspec, unless its location is invalid.

Adopts the range start if the current range start is invalid.

Definition at line 1779 of file DeclSpec.h.

References clang::SourceRange::getBegin(), clang::SourceRange::getEnd(), clang::DeclSpec::getSourceRange(), clang::SourceLocation::isInvalid(), clang::SourceRange::setBegin(), and clang::SourceRange::setEnd().

Expr* clang::Declarator::getAsmLabel ( ) const
inline
AttributePool& clang::Declarator::getAttributePool ( ) const
inline
const AttributeList* clang::Declarator::getAttributes ( ) const
inline
AttributeList* clang::Declarator::getAttributes ( )
inline

Definition at line 2185 of file DeclSpec.h.

References clang::ParsedAttributes::getList().

AttributeList*& clang::Declarator::getAttrListRef ( )
inline
SourceLocation clang::Declarator::getCommaLoc ( ) const
inline

Definition at line 2230 of file DeclSpec.h.

Referenced by warnAboutAmbiguousFunction().

TheContext clang::Declarator::getContext ( ) const
inline
void clang::Declarator::getCXX11AttributeRanges ( SmallVectorImpl< SourceRange > &  Ranges)
inline

Return a source range list of C++11 attributes associated with the declarator.

Definition at line 2200 of file DeclSpec.h.

References clang::ParsedAttributes::getList(), clang::AttributeList::getNext(), clang::AttributeList::getRange(), and clang::AttributeList::isCXX11Attribute().

const CXXScopeSpec& clang::Declarator::getCXXScopeSpec ( ) const
inline
CXXScopeSpec& clang::Declarator::getCXXScopeSpec ( )
inline

Definition at line 1745 of file DeclSpec.h.

const DeclSpec& clang::Declarator::getDeclSpec ( ) const
inline

getDeclSpec - Return the declaration-specifier that this declarator was declared with.

Definition at line 1729 of file DeclSpec.h.

Referenced by clang::Sema::ActOnCXXConditionDeclaration(), clang::Sema::ActOnCXXMemberDeclarator(), clang::Sema::ActOnCXXNew(), clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnIvar(), clang::Sema::ActOnObjCExceptionDecl(), clang::Sema::ActOnParamDeclarator(), clang::Sema::ActOnTypedefDeclarator(), clang::Sema::ActOnVariableDeclarator(), clang::Sema::canDelayFunctionBody(), clang::Sema::CheckConstructorDeclarator(), clang::Sema::CheckConversionDeclarator(), clang::Sema::CheckDestructorDeclarator(), clang::Sema::CheckFieldDecl(), checkOmittedBlockReturnType(), clang::Sema::checkUnusedDeclAttributes(), clang::Sema::containsUnexpandedParameterPacks(), ConvertDeclSpecToType(), CreateNewFunctionDecl(), diagnoseRedundantReturnTypeQualifiers(), getCCForDeclaratorChunk(), clang::ParsingDeclarator::getDeclSpec(), GetDeclSpecTypeForDeclarator(), GetFullTypeForDeclarator(), getFunctionStorageClass(), clang::Sema::GetTypeSourceInfoForDeclarator(), clang::Sema::HandleDeclarator(), clang::Sema::HandleField(), clang::Sema::HandleMSProperty(), hasAttributes(), hasParsedAttr(), isFirstDeclarationOfMember(), isFunctionDeclarationContext(), isOmittedBlockReturnType(), isStaticMember(), mayBeFollowedByCXXDirectInit(), clang::Sema::ParseTypedefDecl(), clang::Sema::ProcessDeclAttributes(), processTypeAttrs(), takeDeclAttributes(), and warnAboutAmbiguousFunction().

SourceLocation clang::Declarator::getEllipsisLoc ( ) const
inline
bool clang::Declarator::getExtension ( ) const
inline

Definition at line 2213 of file DeclSpec.h.

FunctionDefinitionKind clang::Declarator::getFunctionDefinitionKind ( ) const
inline
DeclaratorChunk::FunctionTypeInfo& clang::Declarator::getFunctionTypeInfo ( )
inline
const DeclaratorChunk::FunctionTypeInfo& clang::Declarator::getFunctionTypeInfo ( ) const
inline

getFunctionTypeInfo - Retrieves the function type info object (looking through parentheses).

Definition at line 2106 of file DeclSpec.h.

References getFunctionTypeInfo().

IdentifierInfo* clang::Declarator::getIdentifier ( ) const
inline
SourceLocation clang::Declarator::getIdentifierLoc ( ) const
inline
const DeclaratorChunk* clang::Declarator::getInnermostNonParenChunk ( ) const
inline

Return the innermost (closest to the declarator) chunk of this declarator that is not a parens chunk, or null if there are no non-parens chunks.

Definition at line 2034 of file DeclSpec.h.

Referenced by GetFullTypeForDeclarator(), and isArrayOfUnknownBound().

SourceLocation clang::Declarator::getLocEnd ( ) const
inline

Definition at line 1762 of file DeclSpec.h.

References clang::SourceRange::getEnd().

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

SourceLocation clang::Declarator::getLocStart ( ) const
inline
DeclSpec& clang::Declarator::getMutableDeclSpec ( )
inline

getMutableDeclSpec - Return a non-const version of the DeclSpec.

This should be used with extreme care: declspecs can often be shared between multiple declarators, so mutating the DeclSpec affects all of the Declarators. This should only be done when the declspec is known to not be shared or when in error recovery etc.

Definition at line 1736 of file DeclSpec.h.

Referenced by clang::Sema::ActOnCXXMemberDeclarator(), clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnObjCExceptionDecl(), clang::Sema::ActOnParamDeclarator(), addContextSensitiveTypeNullability(), checkOmittedBlockReturnType(), distributeObjCPointerTypeAttrFromDeclarator(), GetFullTypeForDeclarator(), and RebuildDeclaratorInCurrentInstantiation().

UnqualifiedId& clang::Declarator::getName ( )
inline
unsigned clang::Declarator::getNumTypeObjects ( ) const
inline
const DeclaratorChunk* clang::Declarator::getOutermostNonParenChunk ( ) const
inline

Return the outermost (furthest from the declarator) chunk of this declarator that is not a parens chunk, or null if there are no non-parens chunks.

Definition at line 2045 of file DeclSpec.h.

SourceRange clang::Declarator::getSourceRange ( ) const
inline
const DeclaratorChunk& clang::Declarator::getTypeObject ( unsigned  i) const
inline
DeclaratorChunk& clang::Declarator::getTypeObject ( unsigned  i)
inline

Definition at line 2012 of file DeclSpec.h.

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

hasAttributes - do we contain any attributes?

Definition at line 2190 of file DeclSpec.h.

References getAttributes(), getDeclSpec(), getNumTypeObjects(), and getTypeObject().

bool clang::Declarator::hasEllipsis ( ) const
inline
bool clang::Declarator::hasGroupingParens ( ) const
inline

Definition at line 2227 of file DeclSpec.h.

Referenced by mayBeFollowedByCXXDirectInit().

bool clang::Declarator::hasName ( ) const
inline

hasName - Whether this declarator has a name, which might be an identifier (accessible via getIdentifier()) or some kind of special C++ name (constructor, destructor, etc.).

Definition at line 1968 of file DeclSpec.h.

References clang::UnqualifiedId::IK_Identifier, and clang::Name.

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

bool clang::Declarator::isArrayOfUnknownBound ( ) const
inline

isArrayOfUnknownBound - This method returns true if the declarator is a declarator for an array of unknown bound (looking through parentheses).

Definition at line 2056 of file DeclSpec.h.

References clang::DeclaratorChunk::Arr, clang::DeclaratorChunk::Array, getInnermostNonParenChunk(), clang::DeclaratorChunk::Kind, and clang::DeclaratorChunk::ArrayTypeInfo::NumElts.

bool Declarator::isCtorOrDtor ( )

Returns true if this declares a constructor or a destructor.

Definition at line 349 of file DeclSpec.cpp.

References getKind(), clang::UnqualifiedId::getKind(), getName(), clang::UnqualifiedId::IK_ConstructorName, and clang::UnqualifiedId::IK_DestructorName.

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

bool Declarator::isDeclarationOfFunction ( ) const

Determine whether the declaration that will be produced from this declaration will be a function.

A declaration can declare a function even if the declarator itself isn't a function declarator, if the type specifier refers to a function type. This routine checks for both cases.

Definition at line 261 of file DeclSpec.cpp.

References clang::DeclaratorChunk::Array, clang::DeclaratorChunk::BlockPointer, E, clang::DeclaratorChunk::Function, clang::OpaquePtr< PtrTy >::get(), clang::DeclSpec::getRepAsExpr(), clang::DeclSpec::getRepAsType(), clang::DeclSpec::getTypeSpecType(), clang::Type::isFunctionType(), clang::QualType::isNull(), clang::DeclaratorChunk::MemberPointer, clang::DeclaratorChunk::Paren, clang::DeclaratorChunk::Pipe, clang::DeclaratorChunk::Pointer, clang::DeclaratorChunk::Reference, clang::TST_atomic, clang::TST_auto, clang::TST_auto_type, clang::TST_bool, clang::TST_char, clang::TST_char16, clang::TST_char32, clang::TST_class, clang::TST_decimal128, clang::TST_decimal32, clang::TST_decimal64, clang::TST_decltype, clang::TST_decltype_auto, clang::TST_double, clang::TST_enum, clang::TST_error, clang::TST_float, clang::TST_float128, clang::TST_half, clang::TST_int, clang::TST_int128, clang::TST_interface, clang::TST_struct, clang::TST_typename, clang::TST_typeofExpr, clang::TST_typeofType, clang::TST_underlyingType, clang::TST_union, clang::TST_unknown_anytype, clang::TST_unspecified, clang::TST_void, and clang::TST_wchar.

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

bool clang::Declarator::isFirstDeclarationOfMember ( )
inline

Returns true if this declares a real member and not a friend.

Definition at line 2250 of file DeclSpec.h.

References getContext(), getDeclSpec(), clang::DeclSpec::isFriendSpecified(), and MemberContext.

Referenced by clang::Sema::ActOnFunctionDeclarator(), and getCCForDeclaratorChunk().

bool clang::Declarator::isFirstDeclarator ( ) const
inline

Definition at line 2229 of file DeclSpec.h.

References clang::SourceLocation::isValid().

Referenced by warnAboutAmbiguousFunction().

bool clang::Declarator::isFunctionDeclarationContext ( ) const
inline
bool clang::Declarator::isFunctionDeclarator ( unsigned idx) const
inline
bool clang::Declarator::isFunctionDeclarator ( ) const
inline

isFunctionDeclarator - Once this declarator is fully parsed and formed, this method returns true if the identifier is a function declarator (looking through parentheses).

Definition at line 2090 of file DeclSpec.h.

Referenced by getFunctionTypeInfo().

bool clang::Declarator::isFunctionDeclaratorAFunctionDeclaration ( ) const
inline

Return true if a function declarator at this position would be a function declaration.

Definition at line 2157 of file DeclSpec.h.

References getNumTypeObjects(), getTypeObject(), I, isFunctionDeclarationContext(), and clang::DeclaratorChunk::Paren.

bool clang::Declarator::isFunctionDefinition ( ) const
inline
bool clang::Declarator::isInvalidType ( ) const
inline
bool clang::Declarator::isObjCIvar ( ) const
inline

Definition at line 2216 of file DeclSpec.h.

bool clang::Declarator::isObjCWeakProperty ( ) const
inline

Definition at line 2219 of file DeclSpec.h.

bool clang::Declarator::isPastIdentifier ( ) const
inline

isPastIdentifier - Return true if we have parsed beyond the point where the

Definition at line 1963 of file DeclSpec.h.

References clang::Name.

bool clang::Declarator::isPrototypeContext ( ) const
inline
bool clang::Declarator::isRedeclaration ( ) const
inline
bool Declarator::isStaticMember ( )

Returns true if this declares a static member.

This cannot be called on a declarator outside of a MemberContext because we won't know until redeclaration time if the decl is static.

Definition at line 341 of file DeclSpec.cpp.

References getContext(), getDeclSpec(), getName(), clang::DeclSpec::getStorageClassSpec(), clang::UnqualifiedId::IK_OperatorFunctionId, clang::CXXMethodDecl::isStaticOverloadedOperator(), clang::UnqualifiedId::Kind, MemberContext, and clang::DeclSpec::SCS_static.

Referenced by clang::Sema::ActOnFunctionDeclarator(), and getCCForDeclaratorChunk().

bool clang::Declarator::mayBeFollowedByCXXDirectInit ( ) const
inline
bool clang::Declarator::mayHaveIdentifier ( ) const
inline
bool clang::Declarator::mayOmitIdentifier ( ) const
inline
void clang::Declarator::setAsmLabel ( Expr E)
inline

Definition at line 2209 of file DeclSpec.h.

References E.

void clang::Declarator::setCommaLoc ( SourceLocation  CL)
inline

Definition at line 2231 of file DeclSpec.h.

void clang::Declarator::setEllipsisLoc ( SourceLocation  EL)
inline

Definition at line 2235 of file DeclSpec.h.

Referenced by GetFullTypeForDeclarator().

void clang::Declarator::setExtension ( bool  Val = true)
inline

Definition at line 2212 of file DeclSpec.h.

void clang::Declarator::setFunctionDefinitionKind ( FunctionDefinitionKind  Val)
inline
void clang::Declarator::setGroupingParens ( bool  flag)
inline

Definition at line 2226 of file DeclSpec.h.

void clang::Declarator::SetIdentifier ( IdentifierInfo Id,
SourceLocation  IdLoc 
)
inline

Set the name of this declarator to be the given identifier.

Definition at line 1981 of file DeclSpec.h.

References clang::Name.

Referenced by clang::Sema::ActOnCXXForRangeIdentifier(), clang::Sema::ActOnFinishKNRParamDeclarations(), clang::Sema::ActOnParamDeclarator(), and clang::Sema::ImplicitlyDefineFunction().

void clang::Declarator::setInvalidType ( bool  Val = true)
inline
void clang::Declarator::setObjCIvar ( bool  Val = true)
inline

Definition at line 2215 of file DeclSpec.h.

void clang::Declarator::setObjCWeakProperty ( bool  Val = true)
inline

Definition at line 2218 of file DeclSpec.h.

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

void clang::Declarator::SetRangeBegin ( SourceLocation  Loc)
inline

SetRangeBegin - Set the start of the source range to Loc, unless it's invalid.

Definition at line 1767 of file DeclSpec.h.

References clang::SourceLocation::isInvalid(), and clang::SourceRange::setBegin().

void clang::Declarator::SetRangeEnd ( SourceLocation  Loc)
inline

SetRangeEnd - Set the end of the source range to Loc, unless it's invalid.

Definition at line 1772 of file DeclSpec.h.

References clang::SourceLocation::isInvalid(), and clang::SourceRange::setEnd().

Referenced by AddTypeInfo(), and takeAttributes().

void clang::Declarator::setRedeclaration ( bool  Val)
inline
void clang::Declarator::SetSourceRange ( SourceRange  R)
inline

Definition at line 1764 of file DeclSpec.h.

void clang::Declarator::takeAttributes ( ParsedAttributes attrs,
SourceLocation  lastLoc 
)
inline

takeAttributes - Takes attributes from the given parsed-attributes set and add them to this declarator.

These examples both add 3 attributes to "var": short int var attribute((aligned(16),common,deprecated)); short int x, attribute((aligned(16)) var attribute((common,deprecated));

Also extends the range of the declarator.

Definition at line 2177 of file DeclSpec.h.

References clang::SourceLocation::isInvalid(), SetRangeEnd(), and clang::ParsedAttributes::takeAllFrom().

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

type_object_range clang::Declarator::type_objects ( ) const
inline

Returns the range of type objects, from the identifier outwards.

Definition at line 2021 of file DeclSpec.h.

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

Friends And Related Function Documentation

friend struct DeclaratorChunk
friend

Definition at line 1711 of file DeclSpec.h.


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