14#ifndef LLVM_CLANG_SEMA_DESIGNATOR_H
15#define LLVM_CLANG_SEMA_DESIGNATOR_H
18#include "llvm/ADT/SmallVector.h"
40 struct FieldDesignatorInfo {
52 : FieldName(FieldName), DotLoc(DotLoc), FieldLoc(FieldLoc) {}
56 struct ArrayDesignatorInfo {
66 : Index(Index), LBracketLoc(LBracketLoc) {}
70 struct ArrayRangeDesignatorInfo {
85 : Start(Start), End(End), LBracketLoc(LBracketLoc),
86 EllipsisLoc(EllipsisLoc) {}
104 Designator(DesignatorKind Kind) : Kind(Kind) {}
119 new (&
D.FieldInfo) FieldDesignatorInfo(FieldName, DotLoc, FieldLoc);
145 new (&
D.ArrayInfo) ArrayDesignatorInfo(Index, LBracketLoc);
176 new (&
D.ArrayRangeInfo)
177 ArrayRangeDesignatorInfo(Start, End, LBracketLoc, EllipsisLoc);
216 bool empty()
const {
return Designators.empty(); }
220 assert(Idx < Designators.size());
221 return Designators[Idx];
Defines the clang::SourceLocation class and associated facilities.
Designation - Represent a full designation, which is a sequence of designators.
const Designator & getDesignator(unsigned Idx) const
unsigned getNumDesignators() const
void AddDesignator(Designator D)
AddDesignator - Add a designator to the end of this list.
Designator - A designator in a C99 designated initializer.
SourceLocation getFieldLoc() const
SourceLocation getDotLoc() const
Expr * getArrayRangeStart() const
bool isArrayDesignator() const
static Designator CreateArrayRangeDesignator(Expr *Start, Expr *End, SourceLocation LBracketLoc, SourceLocation EllipsisLoc)
Creates a GNU array-range designator.
SourceLocation getLBracketLoc() const
static Designator CreateArrayDesignator(Expr *Index, SourceLocation LBracketLoc)
Creates an array designator.
void setRBracketLoc(SourceLocation RBracketLoc) const
bool isArrayRangeDesignator() const
bool isFieldDesignator() const
SourceLocation getRBracketLoc() const
ArrayRangeDesignatorInfo ArrayRangeInfo
SourceLocation getEllipsisLoc() const
ArrayDesignatorInfo ArrayInfo
Expr * getArrayRangeEnd() const
const IdentifierInfo * getFieldDecl() const
FieldDesignatorInfo FieldInfo
Expr * getArrayIndex() const
static Designator CreateFieldDesignator(const IdentifierInfo *FieldName, SourceLocation DotLoc, SourceLocation FieldLoc)
Creates a field designator.
This represents one expression.
One of these records is kept for each identifier that is lexed.
Encodes a location in the source.
The JSON file list parser is used to communicate input to InstallAPI.