clang 19.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.

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

Constructor & Destructor Documentation

◆ Designator()

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

Definition at line 5206 of file Expr.h.

Member Function Documentation

◆ CreateArrayDesignator()

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

Creates an array designator.

Definition at line 5252 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 

Creates a GNU array-range designator.

Definition at line 5262 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 

Creates a field designator.

Definition at line 5216 of file Expr.h.

References FieldInfo.

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

◆ getArrayIndex()

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

◆ getBeginLoc()

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

◆ getDotLoc()

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

◆ getEllipsisLoc()

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

Definition at line 5285 of file Expr.h.

References ArrayOrRangeInfo, and isArrayRangeDesignator().

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

◆ getEndLoc()

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

Definition at line 5303 of file Expr.h.

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

Referenced by getSourceRange().

◆ getFieldDecl()

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

Definition at line 5226 of file Expr.h.

References FieldInfo, and isFieldDesignator().

Referenced by getFieldName().

◆ getFieldLoc()

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

◆ getFieldName()

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

◆ getLBracketLoc()

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

◆ getRBracketLoc()

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

◆ getSourceRange()

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

Definition at line 5307 of file Expr.h.

References getBeginLoc(), and getEndLoc().

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

◆ isArrayDesignator()

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

◆ isArrayRangeDesignator()

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

◆ isFieldDesignator()

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

◆ setFieldDecl()

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

Definition at line 5233 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 5200 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 5197 of file Expr.h.

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

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