15 #ifndef LLVM_CLANG_SEMA_DESIGNATOR_H
16 #define LLVM_CLANG_SEMA_DESIGNATOR_H
19 #include "llvm/ADT/SmallVector.h"
45 struct FieldDesignatorInfo {
50 struct ArrayDesignatorInfo {
53 mutable unsigned RBracketLoc;
55 struct ArrayRangeDesignatorInfo {
57 unsigned LBracketLoc, EllipsisLoc;
58 mutable unsigned RBracketLoc;
188 Designators.push_back(D);
191 bool empty()
const {
return Designators.empty(); }
195 assert(Idx < Designators.size());
196 return Designators[Idx];
void ClearExprs(Sema &Actions)
DesignatorKind getKind() const
ArrayRangeDesignatorInfo ArrayRangeInfo
unsigned getRawEncoding() const
When a SourceLocation itself cannot be used, this returns an (opaque) 32-bit integer encoding for it...
SourceLocation getDotLoc() const
SourceLocation getLBracketLoc() const
FieldDesignatorInfo FieldInfo
static SourceLocation getFromRawEncoding(unsigned Encoding)
Turn a raw encoding of a SourceLocation object into a real SourceLocation.
ArrayDesignatorInfo ArrayInfo
void setRBracketLoc(SourceLocation RBracketLoc) const
bool isArrayDesignator() const
static Designator getField(const IdentifierInfo *II, SourceLocation DotLoc, SourceLocation NameLoc)
Sema - This implements semantic analysis and AST building for C.
SourceLocation getEllipsisLoc() const
void ClearExprs(Sema &Actions)
const IdentifierInfo * getField() const
void FreeExprs(Sema &Actions)
Encodes a location in the source. The SourceManager can decode this to get at the full include stack...
Expr * getArrayRangeStart() const
bool isFieldDesignator() const
bool isArrayRangeDesignator() const
const Designator & getDesignator(unsigned Idx) const
SourceLocation getRBracketLoc() const
Expr * getArrayIndex() const
SourceLocation getFieldLoc() const
void AddDesignator(Designator D)
AddDesignator - Add a designator to the end of this list.
Defines the clang::SourceLocation class and associated facilities.
Expr * getArrayRangeEnd() const
void FreeExprs(Sema &Actions)
static Designator getArray(Expr *Index, SourceLocation LBracketLoc)
static Designator getArrayRange(Expr *Start, Expr *End, SourceLocation LBracketLoc, SourceLocation EllipsisLoc)
unsigned getNumDesignators() const