clang 20.0.0git
Classes | 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"

Public Member Functions

bool isFieldDesignator () const
 
bool isArrayDesignator () const
 
bool isArrayRangeDesignator () const
 
const IdentifierInfogetFieldDecl () const
 
SourceLocation getDotLoc () const
 
SourceLocation getFieldLoc () const
 
ExprgetArrayIndex () const
 
SourceLocation getLBracketLoc () const
 
SourceLocation getRBracketLoc () const
 
ExprgetArrayRangeStart () const
 
ExprgetArrayRangeEnd () const
 
SourceLocation getEllipsisLoc () const
 
void setRBracketLoc (SourceLocation RBracketLoc) const
 

Static Public Member Functions

static Designator CreateFieldDesignator (const IdentifierInfo *FieldName, SourceLocation DotLoc, SourceLocation FieldLoc)
 Creates a field designator.
 
static Designator CreateArrayDesignator (Expr *Index, SourceLocation LBracketLoc)
 Creates an array designator.
 
static Designator CreateArrayRangeDesignator (Expr *Start, Expr *End, SourceLocation LBracketLoc, SourceLocation EllipsisLoc)
 Creates a GNU array-range designator.
 

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 38 of file Designator.h.

Member Function Documentation

◆ CreateArrayDesignator()

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

Creates an array designator.

Definition at line 142 of file Designator.h.

References D.

◆ CreateArrayRangeDesignator()

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

Creates a GNU array-range designator.

Definition at line 172 of file Designator.h.

References D.

◆ CreateFieldDesignator()

static Designator clang::Designator::CreateFieldDesignator ( const IdentifierInfo FieldName,
SourceLocation  DotLoc,
SourceLocation  FieldLoc 
)
inlinestatic

Creates a field designator.

Definition at line 115 of file Designator.h.

References D.

Referenced by ExpandAnonymousFieldDesignator().

◆ getArrayIndex()

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

Definition at line 149 of file Designator.h.

References ArrayInfo, and isArrayDesignator().

◆ getArrayRangeEnd()

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

Definition at line 186 of file Designator.h.

References ArrayRangeInfo, and isArrayRangeDesignator().

◆ getArrayRangeStart()

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

Definition at line 181 of file Designator.h.

References ArrayRangeInfo, and isArrayRangeDesignator().

◆ getDotLoc()

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

Definition at line 128 of file Designator.h.

References FieldInfo, and isFieldDesignator().

◆ getEllipsisLoc()

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

Definition at line 191 of file Designator.h.

References ArrayRangeInfo, and isArrayRangeDesignator().

◆ getFieldDecl()

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

Definition at line 123 of file Designator.h.

References FieldInfo, and isFieldDesignator().

◆ getFieldLoc()

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

Definition at line 133 of file Designator.h.

References FieldInfo, and isFieldDesignator().

◆ getLBracketLoc()

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

Definition at line 154 of file Designator.h.

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

◆ getRBracketLoc()

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

Definition at line 161 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 107 of file Designator.h.

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

◆ setRBracketLoc()

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

Definition at line 196 of file Designator.h.

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

Member Data Documentation

◆ ArrayInfo

ArrayDesignatorInfo clang::Designator::ArrayInfo

Definition at line 100 of file Designator.h.

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

◆ ArrayRangeInfo

ArrayRangeDesignatorInfo clang::Designator::ArrayRangeInfo

◆ FieldInfo

FieldDesignatorInfo clang::Designator::FieldInfo

Definition at line 99 of file Designator.h.

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


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