clang  14.0.0git
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 36 of file Designator.h.

Member Enumeration Documentation

◆ DesignatorKind

Enumerator
FieldDesignator 
ArrayDesignator 
ArrayRangeDesignator 

Definition at line 38 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 175 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 179 of file Designator.h.

◆ getArray()

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

Definition at line 138 of file Designator.h.

◆ getArrayIndex()

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

Definition at line 90 of file Designator.h.

References ArrayInfo, and isArrayDesignator().

◆ getArrayRange()

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

Definition at line 149 of file Designator.h.

References ArrayRangeDesignator, ArrayRangeInfo, and End.

◆ getArrayRangeEnd()

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

Definition at line 99 of file Designator.h.

References ArrayRangeInfo, and isArrayRangeDesignator().

◆ getArrayRangeStart()

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

Definition at line 95 of file Designator.h.

References ArrayRangeInfo, and isArrayRangeDesignator().

◆ getDotLoc()

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

Definition at line 80 of file Designator.h.

References FieldInfo, and isFieldDesignator().

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

◆ getEllipsisLoc()

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

Definition at line 122 of file Designator.h.

References ArrayRangeInfo, and isArrayRangeDesignator().

◆ getField() [1/2]

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

Definition at line 75 of file Designator.h.

References FieldInfo, and isFieldDesignator().

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

◆ getField() [2/2]

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

Definition at line 127 of file Designator.h.

References FieldDesignator, and FieldInfo.

◆ getFieldLoc()

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

Definition at line 85 of file Designator.h.

References FieldInfo, and isFieldDesignator().

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

◆ getKind()

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

Definition at line 70 of file Designator.h.

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

◆ getLBracketLoc()

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

Definition at line 104 of file Designator.h.

References ArrayInfo, ArrayRangeInfo, isArrayDesignator(), and isArrayRangeDesignator().

◆ getRBracketLoc()

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

Definition at line 113 of file Designator.h.

References ArrayInfo, ArrayRangeInfo, isArrayDesignator(), and isArrayRangeDesignator().

◆ isArrayDesignator()

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

◆ isArrayRangeDesignator()

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

◆ isFieldDesignator()

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

Definition at line 71 of file Designator.h.

References FieldDesignator.

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

◆ setRBracketLoc()

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

Definition at line 164 of file Designator.h.

References ArrayInfo, ArrayRangeInfo, isArrayDesignator(), and isArrayRangeDesignator().

Member Data Documentation

◆ ArrayInfo

ArrayDesignatorInfo clang::Designator::ArrayInfo

Definition at line 64 of file Designator.h.

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

◆ ArrayRangeInfo

ArrayRangeDesignatorInfo clang::Designator::ArrayRangeInfo

◆ FieldInfo

FieldDesignatorInfo clang::Designator::FieldInfo

Definition at line 63 of file Designator.h.

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


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