clang 20.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 5327 of file Expr.h.

Constructor & Destructor Documentation

◆ Designator()

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

Definition at line 5398 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 5444 of file Expr.h.

References D.

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

References D.

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

References D.

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

◆ getArrayIndex()

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

Definition at line 5465 of file Expr.h.

References ArrayOrRangeInfo, isArrayDesignator(), and isArrayRangeDesignator().

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

References ArrayOrRangeInfo, and isArrayRangeDesignator().

◆ getEndLoc()

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

Definition at line 5495 of file Expr.h.

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

Referenced by getSourceRange().

◆ getFieldDecl()

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

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

Definition at line 5471 of file Expr.h.

References ArrayOrRangeInfo, isArrayDesignator(), and isArrayRangeDesignator().

Referenced by getBeginLoc().

◆ getRBracketLoc()

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

Definition at line 5483 of file Expr.h.

References ArrayOrRangeInfo, isArrayDesignator(), and isArrayRangeDesignator().

Referenced by getEndLoc().

◆ getSourceRange()

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

Definition at line 5499 of file Expr.h.

References getBeginLoc(), and getEndLoc().

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

◆ isArrayDesignator()

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

Definition at line 5401 of file Expr.h.

References Kind.

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

◆ isArrayRangeDesignator()

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

Definition at line 5402 of file Expr.h.

References Kind.

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

◆ isFieldDesignator()

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

Definition at line 5400 of file Expr.h.

References Kind.

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

◆ setFieldDecl()

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

Definition at line 5425 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 5392 of file Expr.h.

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

◆ FieldInfo

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

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

Definition at line 5389 of file Expr.h.

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


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