clang 18.0.0git
Classes | Public Member Functions | Static Public Member Functions | List of all members
clang::DesignatedInitExpr::Designator Class Reference

Represents a single C99 designator. More...

#include "clang/AST/Expr.h"

Public Member Functions

 Designator ()
 
bool isFieldDesignator () const
 
bool isArrayDesignator () const
 
bool isArrayRangeDesignator () const
 
const IdentifierInfogetFieldName () const
 
FieldDeclgetFieldDecl () const
 
void setFieldDecl (FieldDecl *FD)
 
SourceLocation getDotLoc () const
 
SourceLocation getFieldLoc () const
 
unsigned getArrayIndex () const
 
SourceLocation getLBracketLoc () const
 
SourceLocation getEllipsisLoc () const
 
SourceLocation getRBracketLoc () const
 
SourceLocation getBeginLoc () const LLVM_READONLY
 
SourceLocation getEndLoc () const LLVM_READONLY
 
SourceRange getSourceRange () const LLVM_READONLY
 

Static Public Member Functions

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

Detailed Description

Represents a single C99 designator.

Todo:
This class is infuriatingly similar to clang::Designator, but minor differences (storing indices vs. storing pointers) keep us from reusing it. Try harder, later, to rectify these differences.

Definition at line 5130 of file Expr.h.

Constructor & Destructor Documentation

◆ Designator()

clang::DesignatedInitExpr::Designator::Designator ( )
inline

Definition at line 5201 of file Expr.h.

Member Function Documentation

◆ CreateArrayDesignator()

static Designator clang::DesignatedInitExpr::Designator::CreateArrayDesignator ( unsigned  Index,
SourceLocation  LBracketLoc,
SourceLocation  RBracketLoc 
)
inlinestatic

Creates an array designator.

Definition at line 5247 of file Expr.h.

References ArrayOrRangeInfo.

Referenced by clang::ASTNodeImporter::import().

◆ CreateArrayRangeDesignator()

static Designator clang::DesignatedInitExpr::Designator::CreateArrayRangeDesignator ( unsigned  Index,
SourceLocation  LBracketLoc,
SourceLocation  EllipsisLoc,
SourceLocation  RBracketLoc 
)
inlinestatic

Creates a GNU array-range designator.

Definition at line 5257 of file Expr.h.

References ArrayOrRangeInfo.

Referenced by clang::ASTNodeImporter::import().

◆ CreateFieldDesignator()

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

Creates a field designator.

Definition at line 5211 of file Expr.h.

References FieldInfo.

Referenced by clang::ASTNodeImporter::import().

◆ getArrayIndex()

unsigned clang::DesignatedInitExpr::Designator::getArrayIndex ( ) const
inline

◆ getBeginLoc()

SourceLocation clang::DesignatedInitExpr::Designator::getBeginLoc ( ) const
inline

◆ getDotLoc()

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

◆ getEllipsisLoc()

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

Definition at line 5280 of file Expr.h.

References ArrayOrRangeInfo, and isArrayRangeDesignator().

Referenced by clang::ASTNodeImporter::import().

◆ getEndLoc()

SourceLocation clang::DesignatedInitExpr::Designator::getEndLoc ( ) const
inline

Definition at line 5298 of file Expr.h.

References getFieldLoc(), getRBracketLoc(), and isFieldDesignator().

Referenced by getSourceRange().

◆ getFieldDecl()

FieldDecl * clang::DesignatedInitExpr::Designator::getFieldDecl ( ) const
inline

Definition at line 5221 of file Expr.h.

References FieldInfo, and isFieldDesignator().

Referenced by getFieldName().

◆ getFieldLoc()

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

◆ getFieldName()

const IdentifierInfo * DesignatedInitExpr::Designator::getFieldName ( ) const

◆ getLBracketLoc()

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

◆ getRBracketLoc()

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

◆ getSourceRange()

SourceRange clang::DesignatedInitExpr::Designator::getSourceRange ( ) const
inline

Definition at line 5302 of file Expr.h.

References getBeginLoc(), and getEndLoc().

Referenced by clang::DesignatedInitExpr::getDesignatorsSourceRange().

◆ isArrayDesignator()

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

◆ isArrayRangeDesignator()

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

◆ isFieldDesignator()

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

◆ setFieldDecl()

void clang::DesignatedInitExpr::Designator::setFieldDecl ( FieldDecl FD)
inline

Definition at line 5228 of file Expr.h.

References FieldInfo, and isFieldDesignator().

Member Data Documentation

◆ ArrayOrRangeInfo

struct ArrayOrRangeDesignatorInfo clang::DesignatedInitExpr::Designator::ArrayOrRangeInfo

An array or GNU array-range designator, e.g., "[9]" or "[10..15]".

Definition at line 5195 of file Expr.h.

Referenced by CreateArrayDesignator(), CreateArrayRangeDesignator(), getArrayIndex(), getEllipsisLoc(), getLBracketLoc(), and getRBracketLoc().

◆ FieldInfo

struct FieldDesignatorInfo clang::DesignatedInitExpr::Designator::FieldInfo

A field designator, e.g., ".x".

Definition at line 5192 of file Expr.h.

Referenced by CreateFieldDesignator(), getDotLoc(), getFieldDecl(), getFieldLoc(), getFieldName(), and setFieldDecl().


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