clang 10.0.0git

Public Member Functions | Friends | List of all members
clang::DesignatedInitExpr::Designator Class Reference

Represents a single C99 designator. More...

`#include "clang/AST/Expr.h"`

Collaboration diagram for clang::DesignatedInitExpr::Designator:
[legend]

## Public Member Functions
| Designator ()
| Designator (const IdentifierInfo *FieldName, SourceLocation DotLoc, SourceLocation FieldLoc)
| Initializes a field designator. More...
| Designator (unsigned Index, SourceLocation LBracketLoc, SourceLocation RBracketLoc)
| Initializes an array designator. More...
| Designator (unsigned Index, SourceLocation LBracketLoc, SourceLocation EllipsisLoc, SourceLocation RBracketLoc)
| Initializes a GNU array-range designator. More...
bool | isFieldDesignator () const
bool | isArrayDesignator () const
bool | isArrayRangeDesignator () const
IdentifierInfo * | getFieldName () const
FieldDecl * | getField () const
void | setField (FieldDecl *FD)
SourceLocation | getDotLoc () const
SourceLocation | getFieldLoc () const
SourceLocation | getLBracketLoc () const
SourceLocation | getRBracketLoc () const
SourceLocation | getEllipsisLoc () const
unsigned | getFirstExprIndex () const
SourceLocation | getBeginLoc () const LLVM_READONLY
SourceLocation | getEndLoc () const LLVM_READONLY
SourceRange | getSourceRange () const LLVM_READONLY

## Friends
class | DesignatedInitExpr

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

## Constructor & Destructor Documentation

## ◆ Designator() [1/4]

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

Definition at line 4731 of file Expr.h.

## ◆ Designator() [2/4]

clang::DesignatedInitExpr::Designator::Designator | ( | const IdentifierInfo * | FieldName,
|  | SourceLocation | DotLoc,
|  | SourceLocation | FieldLoc
| ) |  |
| inline

Initializes a field designator.

Definition at line 4734 of file Expr.h.

References clang::SubobjectAdjustment::Field, and clang::SourceLocation::getRawEncoding().

## ◆ Designator() [3/4]

clang::DesignatedInitExpr::Designator::Designator | ( | unsigned | Index,
|  | SourceLocation | LBracketLoc,
|  | SourceLocation | RBracketLoc
| ) |  |
| inline

Initializes an array designator.

Definition at line 4743 of file Expr.h.

## ◆ Designator() [4/4]

clang::DesignatedInitExpr::Designator::Designator | ( | unsigned | Index,
|  | SourceLocation | LBracketLoc,
|  | SourceLocation | EllipsisLoc,
|  | SourceLocation | RBracketLoc
| ) |  |
| inline

Initializes a GNU array-range designator.

Definition at line 4753 of file Expr.h.

## Member Function Documentation

## ◆ getBeginLoc()

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

Definition at line 4815 of file Expr.h.

References clang::SourceLocation::isInvalid().

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

## ◆ getDotLoc()

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

Definition at line 4781 of file Expr.h.

References clang::SubobjectAdjustment::Field, and clang::SourceLocation::getFromRawEncoding().

Referenced by ExpandAnonymousFieldDesignator(), and clang::ASTNodeImporter::import().

## ◆ getEllipsisLoc()

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

Definition at line 4803 of file Expr.h.

References clang::DesignatedInitExpr::ArrayOrRangeDesignator::EllipsisLoc, and clang::SourceLocation::getFromRawEncoding().

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

## ◆ getEndLoc()

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

Definition at line 4821 of file Expr.h.

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

## ◆ getField()

FieldDecl* clang::DesignatedInitExpr::Designator::getField | ( |  | ) | const
| inline

Definition at line 4768 of file Expr.h.

References clang::SubobjectAdjustment::Field.

## ◆ getFieldLoc()

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

Definition at line 4786 of file Expr.h.

References clang::SubobjectAdjustment::Field, and clang::SourceLocation::getFromRawEncoding().

Referenced by ExpandAnonymousFieldDesignator(), and clang::ASTNodeImporter::import().

## ◆ getFieldName()

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

Definition at line 4279 of file Expr.cpp.

References clang::C, clang::Stmt::child_begin(), clang::Expr::containsUnexpandedParameterPack(), clang::Expr::Expr(), clang::Expr::getObjectKind(), clang::Expr::getValueKind(), clang::Expr::isInstantiationDependent(), clang::Expr::isTypeDependent(), and clang::Expr::isValueDependent().

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

## ◆ getFirstExprIndex()

unsigned clang::DesignatedInitExpr::Designator::getFirstExprIndex | ( |  | ) | const
| inline

Definition at line 4809 of file Expr.h.

References clang::DesignatedInitExpr::ArrayOrRangeDesignator::Index.

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

## ◆ getLBracketLoc()

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

Definition at line 4791 of file Expr.h.

References clang::SourceLocation::getFromRawEncoding(), and clang::DesignatedInitExpr::ArrayOrRangeDesignator::LBracketLoc.

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

## ◆ getRBracketLoc()

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

Definition at line 4797 of file Expr.h.

References clang::SourceLocation::getFromRawEncoding(), and clang::DesignatedInitExpr::ArrayOrRangeDesignator::RBracketLoc.

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

## ◆ getSourceRange()

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

Definition at line 4824 of file Expr.h.

References clang::Create(), and clang::CreateEmpty().

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

## ◆ isArrayDesignator()

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

Definition at line 4763 of file Expr.h.

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

## ◆ isArrayRangeDesignator()

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

Definition at line 4764 of file Expr.h.

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

## ◆ isFieldDesignator()

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

Definition at line 4762 of file Expr.h.

Referenced by clang::DesignatedInitExpr::getBeginLoc(), and clang::ASTNodeImporter::import().

## ◆ setField()

void clang::DesignatedInitExpr::Designator::setField | ( | FieldDecl * | FD | ) |
| inline

Definition at line 4776 of file Expr.h.

References clang::SubobjectAdjustment::Field.

## Friends And Related Function Documentation

## ◆ DesignatedInitExpr

friend class DesignatedInitExpr
| friend

Definition at line 4728 of file Expr.h.

## Member Data Documentation

## ◆ ArrayOrRange

struct ArrayOrRangeDesignator clang::DesignatedInitExpr::Designator::ArrayOrRange

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

Definition at line 4726 of file Expr.h.

Referenced by clang::DesignatedInitExpr::getArrayIndex(), clang::DesignatedInitExpr::getArrayRangeEnd(), clang::DesignatedInitExpr::getArrayRangeStart(), and clang::DesignatedInitExpr::getBeginLoc().

## ◆ Field

struct FieldDesignator clang::DesignatedInitExpr::Designator::Field

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

Definition at line 4724 of file Expr.h.

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

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

- include/clang/AST/Expr.h
- lib/AST/Expr.cpp