clang 22.0.0git
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 5530 of file Expr.h.

Constructor & Destructor Documentation

◆ Designator()

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

Definition at line 5601 of file Expr.h.

Member Function Documentation

◆ CreateArrayDesignator()

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

Creates an array designator.

Definition at line 5647 of file Expr.h.

References ArrayOrRangeInfo.

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

◆ CreateArrayRangeDesignator()

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

Creates a GNU array-range designator.

Definition at line 5657 of file Expr.h.

References ArrayOrRangeInfo.

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

◆ CreateFieldDesignator()

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

Creates a field designator.

Definition at line 5611 of file Expr.h.

References FieldInfo.

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

◆ getArrayIndex()

◆ 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 5680 of file Expr.h.

References ArrayOrRangeInfo, and isArrayRangeDesignator().

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

◆ getEndLoc()

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

Definition at line 5698 of file Expr.h.

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

Referenced by getSourceRange().

◆ getFieldDecl()

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

Definition at line 5621 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 5702 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 5628 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 5595 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 5592 of file Expr.h.

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


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