clang API Documentation

Classes | Public Types | Public Member Functions | Static Public Member Functions
clang::Designator Class Reference

#include <Designator.h>

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

List of all members.

Classes

struct  ArrayDesignatorInfo
struct  ArrayRangeDesignatorInfo
struct  FieldDesignatorInfo

Public Types

enum  DesignatorKind { FieldDesignator, ArrayDesignator, ArrayRangeDesignator }

Public Member Functions

DesignatorKind getKind () const
bool isFieldDesignator () const
bool isArrayDesignator () const
bool isArrayRangeDesignator () const
const IdentifierInfogetField () const
SourceLocation getDotLoc () const
SourceLocation getFieldLoc () const
ExprgetArrayIndex () const
ExprgetArrayRangeStart () const
ExprgetArrayRangeEnd () const
SourceLocation getLBracketLoc () const
SourceLocation getRBracketLoc () const
SourceLocation getEllipsisLoc () const
void setRBracketLoc (SourceLocation RBracketLoc) const
void ClearExprs (Sema &Actions)
void FreeExprs (Sema &Actions)

Static Public Member Functions

static Designator getField (const IdentifierInfo *II, SourceLocation DotLoc, SourceLocation NameLoc)
static Designator getArray (Expr *Index, SourceLocation LBracketLoc)
static Designator getArrayRange (Expr *Start, Expr *End, SourceLocation LBracketLoc, SourceLocation EllipsisLoc)

Detailed Description

Designator - A designator in a C99 designated initializer.

This class is a discriminated union which holds the various different sorts of designators possible. A Designation is an array of these. An example of a designator are things like this: [8] .field [47] // C99 designation: 3 designators [8 ... 47] field: // GNU extensions: 2 designators These occur in initializers, e.g.: int a[10] = {2, 4, [8]=9, 10};

Definition at line 37 of file Designator.h.


Member Enumeration Documentation

Enumerator:
FieldDesignator 
ArrayDesignator 
ArrayRangeDesignator 

Definition at line 39 of file Designator.h.


Member Function Documentation

void clang::Designator::ClearExprs ( Sema Actions) [inline]

ClearExprs - Null out any expression references, which prevents them from being 'delete'd later.

Definition at line 171 of file Designator.h.

void clang::Designator::FreeExprs ( Sema Actions) [inline]

FreeExprs - Release any unclaimed memory for the expressions in this designator.

Definition at line 175 of file Designator.h.

static Designator clang::Designator::getArray ( Expr Index,
SourceLocation  LBracketLoc 
) [inline, static]

Definition at line 136 of file Designator.h.

References ArrayDesignator, ArrayInfo, and clang::SourceLocation::getRawEncoding().

Definition at line 89 of file Designator.h.

References ArrayInfo, and isArrayDesignator().

Referenced by clang::Sema::ActOnDesignatedInitializer().

static Designator clang::Designator::getArrayRange ( Expr Start,
Expr End,
SourceLocation  LBracketLoc,
SourceLocation  EllipsisLoc 
) [inline, static]

Definition at line 98 of file Designator.h.

References ArrayRangeInfo, and isArrayRangeDesignator().

Referenced by clang::Sema::ActOnDesignatedInitializer().

Definition at line 94 of file Designator.h.

References ArrayRangeInfo, and isArrayRangeDesignator().

Referenced by clang::Sema::ActOnDesignatedInitializer().

const IdentifierInfo* clang::Designator::getField ( ) const [inline]

Definition at line 74 of file Designator.h.

References FieldInfo, and isFieldDesignator().

Referenced by clang::Sema::ActOnDesignatedInitializer().

static Designator clang::Designator::getField ( const IdentifierInfo II,
SourceLocation  DotLoc,
SourceLocation  NameLoc 
) [inline, static]

Definition at line 126 of file Designator.h.

References FieldDesignator, FieldInfo, and clang::SourceLocation::getRawEncoding().

Definition at line 69 of file Designator.h.

Referenced by clang::Sema::ActOnDesignatedInitializer().

Definition at line 70 of file Designator.h.

References FieldDesignator.

Referenced by getDotLoc(), getField(), and getFieldLoc().

void clang::Designator::setRBracketLoc ( SourceLocation  RBracketLoc) const [inline]

Member Data Documentation

ArrayDesignatorInfo clang::Designator::ArrayInfo

Definition at line 63 of file Designator.h.

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

ArrayRangeDesignatorInfo clang::Designator::ArrayRangeInfo
FieldDesignatorInfo clang::Designator::FieldInfo

Definition at line 62 of file Designator.h.

Referenced by getDotLoc(), getField(), and getFieldLoc().


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