14#ifndef LLVM_CLANG_SEMA_DESIGNATOR_H
15#define LLVM_CLANG_SEMA_DESIGNATOR_H
18#include "llvm/ADT/SmallVector.h"
46 struct FieldDesignatorInfo {
47 const IdentifierInfo *II;
48 SourceLocation DotLoc;
49 SourceLocation NameLoc;
51 struct ArrayDesignatorInfo {
53 SourceLocation LBracketLoc;
54 mutable SourceLocation RBracketLoc;
56 struct ArrayRangeDesignatorInfo {
58 SourceLocation LBracketLoc, EllipsisLoc;
59 mutable SourceLocation RBracketLoc;
192 Designators.push_back(D);
195 bool empty()
const {
return Designators.empty(); }
199 assert(Idx < Designators.size());
200 return Designators[Idx];
Defines the clang::SourceLocation class and associated facilities.
Designation - Represent a full designation, which is a sequence of designators.
void ClearExprs(Sema &Actions)
ClearExprs - Null out any expression references, which prevents them from being 'delete'd later.
void FreeExprs(Sema &Actions)
FreeExprs - Release any unclaimed memory for the expressions in this designation.
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
const IdentifierInfo * getField() const
Expr * getArrayRangeStart() const
bool isArrayDesignator() const
SourceLocation getLBracketLoc() const
void FreeExprs(Sema &Actions)
FreeExprs - Release any unclaimed memory for the expressions in this designator.
void setRBracketLoc(SourceLocation RBracketLoc) const
bool isArrayRangeDesignator() const
bool isFieldDesignator() const
SourceLocation getRBracketLoc() const
ArrayRangeDesignatorInfo ArrayRangeInfo
SourceLocation getEllipsisLoc() const
void ClearExprs(Sema &Actions)
ClearExprs - Null out any expression references, which prevents them from being 'delete'd later.
static Designator getArrayRange(Expr *Start, Expr *End, SourceLocation LBracketLoc, SourceLocation EllipsisLoc)
DesignatorKind getKind() const
ArrayDesignatorInfo ArrayInfo
Expr * getArrayRangeEnd() const
static Designator getArray(Expr *Index, SourceLocation LBracketLoc)
FieldDesignatorInfo FieldInfo
static Designator getField(const IdentifierInfo *II, SourceLocation DotLoc, SourceLocation NameLoc)
Expr * getArrayIndex() const
This represents one expression.
One of these records is kept for each identifier that is lexed.
Sema - This implements semantic analysis and AST building for C.
Encodes a location in the source.