clang  6.0.0svn
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
clang::Designator Class Reference

Designator - A designator in a C99 designated initializer. More...

#include "clang/Sema/Designator.h"

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

Public Types

enum  DesignatorKind { FieldDesignator, ArrayDesignator, ArrayRangeDesignator }
 

Public Member Functions

DesignatorKind getKind () const
 
bool isFieldDesignator () const
 
bool isArrayDesignator () const
 
bool isArrayRangeDesignator () const
 
const IdentifierInfogetField () const
 
SourceLocation getDotLoc () const
 
SourceLocation getFieldLoc () const
 
ExprgetArrayIndex () const
 
ExprgetArrayRangeStart () const
 
ExprgetArrayRangeEnd () const
 
SourceLocation getLBracketLoc () const
 
SourceLocation getRBracketLoc () const
 
SourceLocation getEllipsisLoc () const
 
void setRBracketLoc (SourceLocation RBracketLoc) const
 
void ClearExprs (Sema &Actions)
 ClearExprs - Null out any expression references, which prevents them from being 'delete'd later. More...
 
void FreeExprs (Sema &Actions)
 FreeExprs - Release any unclaimed memory for the expressions in this designator. More...
 

Static Public Member Functions

static Designator getField (const IdentifierInfo *II, SourceLocation DotLoc, SourceLocation NameLoc)
 
static Designator getArray (Expr *Index, SourceLocation LBracketLoc)
 
static Designator getArrayRange (Expr *Start, Expr *End, SourceLocation LBracketLoc, SourceLocation EllipsisLoc)
 

Detailed Description

Designator - A designator in a C99 designated initializer.

This class is a discriminated union which holds the various different sorts of designators possible. A Designation is an array of these. An example of a designator are things like this: [8] .field [47] // C99 designation: 3 designators [8 ... 47] field: // GNU extensions: 2 designators These occur in initializers, e.g.: int a[10] = {2, 4, [8]=9, 10};

Definition at line 37 of file Designator.h.

Member Enumeration Documentation

◆ DesignatorKind

Enumerator
FieldDesignator 
ArrayDesignator 
ArrayRangeDesignator 

Definition at line 39 of file Designator.h.

Member Function Documentation

◆ ClearExprs()

void clang::Designator::ClearExprs ( Sema Actions)
inline

ClearExprs - Null out any expression references, which prevents them from being 'delete'd later.

Definition at line 171 of file Designator.h.

◆ FreeExprs()

void clang::Designator::FreeExprs ( Sema Actions)
inline

FreeExprs - Release any unclaimed memory for the expressions in this designator.

Definition at line 175 of file Designator.h.

◆ getArray()

static Designator clang::Designator::getArray ( Expr Index,
SourceLocation  LBracketLoc 
)
inlinestatic

◆ getArrayIndex()

Expr* clang::Designator::getArrayIndex ( ) const
inline

Definition at line 89 of file Designator.h.

References ArrayInfo, and isArrayDesignator().

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

◆ getArrayRange()

static Designator clang::Designator::getArrayRange ( Expr Start,
Expr End,
SourceLocation  LBracketLoc,
SourceLocation  EllipsisLoc 
)
inlinestatic

◆ getArrayRangeEnd()

Expr* clang::Designator::getArrayRangeEnd ( ) const
inline

Definition at line 98 of file Designator.h.

References ArrayRangeInfo, and isArrayRangeDesignator().

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

◆ getArrayRangeStart()

Expr* clang::Designator::getArrayRangeStart ( ) const
inline

Definition at line 94 of file Designator.h.

References ArrayRangeInfo, and isArrayRangeDesignator().

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

◆ getDotLoc()

SourceLocation clang::Designator::getDotLoc ( ) const
inline

◆ getEllipsisLoc()

SourceLocation clang::Designator::getEllipsisLoc ( ) const
inline

◆ getField() [1/2]

const IdentifierInfo* clang::Designator::getField ( ) const
inline

◆ getField() [2/2]

static Designator clang::Designator::getField ( const IdentifierInfo II,
SourceLocation  DotLoc,
SourceLocation  NameLoc 
)
inlinestatic

Definition at line 126 of file Designator.h.

References FieldDesignator, FieldInfo, and clang::SourceLocation::getRawEncoding().

◆ getFieldLoc()

SourceLocation clang::Designator::getFieldLoc ( ) const
inline

◆ getKind()

DesignatorKind clang::Designator::getKind ( ) const
inline

Definition at line 69 of file Designator.h.

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

◆ getLBracketLoc()

SourceLocation clang::Designator::getLBracketLoc ( ) const
inline

◆ getRBracketLoc()

SourceLocation clang::Designator::getRBracketLoc ( ) const
inline

◆ isArrayDesignator()

bool clang::Designator::isArrayDesignator ( ) const
inline

◆ isArrayRangeDesignator()

bool clang::Designator::isArrayRangeDesignator ( ) const
inline

◆ isFieldDesignator()

bool clang::Designator::isFieldDesignator ( ) const
inline

Definition at line 70 of file Designator.h.

References FieldDesignator.

Referenced by getDotLoc(), getField(), and getFieldLoc().

◆ setRBracketLoc()

void clang::Designator::setRBracketLoc ( SourceLocation  RBracketLoc) const
inline

Member Data Documentation

◆ ArrayInfo

ArrayDesignatorInfo clang::Designator::ArrayInfo

Definition at line 63 of file Designator.h.

Referenced by getArray(), getArrayIndex(), getLBracketLoc(), getRBracketLoc(), and setRBracketLoc().

◆ ArrayRangeInfo

ArrayRangeDesignatorInfo clang::Designator::ArrayRangeInfo

◆ FieldInfo

FieldDesignatorInfo clang::Designator::FieldInfo

Definition at line 62 of file Designator.h.

Referenced by getDotLoc(), getField(), and getFieldLoc().


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