14 #ifndef LLVM_CLANG_AST_STMT_H 15 #define LLVM_CLANG_AST_STMT_H 23 #include "llvm/ADT/ArrayRef.h" 24 #include "llvm/ADT/PointerIntPair.h" 25 #include "llvm/ADT/StringRef.h" 26 #include "llvm/ADT/iterator.h" 27 #include "llvm/ADT/iterator_range.h" 28 #include "llvm/Support/Casting.h" 29 #include "llvm/Support/Compiler.h" 30 #include "llvm/Support/ErrorHandling.h" 39 class FoldingSetNodeID;
53 struct PrintingPolicy;
66 class alignas(void *)
Stmt {
70 #define STMT(CLASS, PARENT) CLASS##Class, 71 #define STMT_RANGE(BASE, FIRST, LAST) \ 72 first##BASE##Constant=FIRST##Class, last##BASE##Constant=LAST##Class, 73 #define LAST_STMT_RANGE(BASE, FIRST, LAST) \ 74 first##BASE##Constant=FIRST##Class, last##BASE##Constant=LAST##Class 75 #define ABSTRACT_STMT(STMT) 76 #include "clang/AST/StmtNodes.inc" 84 void *
operator new(
size_t bytes) noexcept {
85 llvm_unreachable(
"Stmts cannot be allocated with regular 'new'.");
88 void operator delete(
void *data) noexcept {
89 llvm_unreachable(
"Stmts cannot be released with regular 'delete'.");
98 enum { NumStmtBits = 8 };
103 unsigned : NumStmtBits;
105 unsigned NumStmts : 32 - NumStmtBits;
111 unsigned : NumStmtBits;
113 unsigned IsConstexpr : 1;
119 friend class BlockDeclRefExpr;
140 unsigned : NumStmtBits;
142 unsigned ValueKind : 2;
143 unsigned ObjectKind : 3;
144 unsigned TypeDependent : 1;
145 unsigned ValueDependent : 1;
146 unsigned InstantiationDependent : 1;
147 unsigned ContainsUnexpandedParameterPack : 1;
149 enum { NumExprBits = 17 };
154 unsigned : NumExprBits;
171 unsigned : NumExprBits;
173 unsigned Semantics : 3;
174 unsigned IsExact : 1;
180 unsigned : NumExprBits;
190 unsigned : NumExprBits;
192 unsigned HasQualifier : 1;
193 unsigned HasTemplateKWAndArgsInfo : 1;
194 unsigned HasFoundDecl : 1;
195 unsigned HadMultipleCandidates : 1;
196 unsigned RefersToEnclosingVariableOrCapture : 1;
203 unsigned : NumExprBits;
206 unsigned PartOfExplicitCast : 1;
207 unsigned BasePathIsEmpty : 1;
213 unsigned : NumExprBits;
215 unsigned NumPreArgs : 1;
222 unsigned : NumExprBits;
225 unsigned CleanupsHaveSideEffects : 1;
227 unsigned NumObjects : 32 - 1 - NumExprBits;
234 unsigned : NumExprBits;
238 unsigned NumSubExprs : 8;
239 unsigned ResultIndex : 32 - 8 - NumExprBits;
245 unsigned : NumExprBits;
249 unsigned IsUnique : 1;
255 unsigned : NumExprBits;
257 unsigned ShouldCopy : 1;
263 unsigned : NumExprBits;
267 unsigned HadArrayRangeDesignator : 1;
275 unsigned : NumExprBits;
285 unsigned NumArgs : 32 - 8 - 1 - NumExprBits;
291 unsigned : NumExprBits;
293 unsigned IsImplicit : 1;
320 unsigned alignment = 8);
323 unsigned alignment = 8) {
324 return operator new(
bytes, *C, alignment);
327 void *
operator new(
size_t bytes,
void *mem) noexcept {
return mem; }
329 void operator delete(
void *,
const ASTContext &, unsigned) noexcept {}
330 void operator delete(
void *,
const ASTContext *, unsigned) noexcept {}
331 void operator delete(
void *,
size_t) noexcept {}
332 void operator delete(
void *,
void *) noexcept {}
346 : llvm::iterator_adaptor_base<ExprIterator, Stmt **,
347 std::random_access_iterator_tag, Expr *> {
352 assert((*I)->getStmtClass() >= firstExprConstant &&
353 (*I)->getStmtClass() <= lastExprConstant);
354 return *
reinterpret_cast<Expr **
>(I);
360 : llvm::iterator_adaptor_base<ConstExprIterator, const Stmt *const *,
361 std::random_access_iterator_tag,
367 assert((*I)->getStmtClass() >= firstExprConstant &&
368 (*I)->getStmtClass() <= lastExprConstant);
369 return *
reinterpret_cast<const Expr *
const *
>(I);
375 static bool StatisticsEnabled;
383 static_assert(
sizeof(*
this) ==
sizeof(
void *),
384 "changing bitfields changed sizeof(Stmt)");
385 static_assert(
sizeof(*
this) %
alignof(
void *) == 0,
386 "Insufficient alignment!");
387 StmtBits.sClass = SC;
388 if (StatisticsEnabled) Stmt::addStmtClass(SC);
392 return static_cast<StmtClass>(StmtBits.sClass);
395 const char *getStmtClassName()
const;
407 static void addStmtClass(
const StmtClass s);
408 static void EnableStatistics();
409 static void PrintStats();
416 void dump(raw_ostream &OS)
const;
419 void dumpColor()
const;
423 void dumpPretty(
const ASTContext &Context)
const;
426 const ASTContext *Context =
nullptr)
const;
430 void viewAST()
const;
434 Stmt *IgnoreImplicit();
436 return const_cast<Stmt *
>(
this)->IgnoreImplicit();
441 Stmt *IgnoreContainers(
bool IgnoreCaptured =
false);
443 return const_cast<Stmt *
>(
this)->IgnoreContainers(IgnoreCaptured);
446 const Stmt *stripLabelLikeStatements()
const;
448 return const_cast<Stmt*
>(
449 const_cast<const Stmt*
>(
this)->stripLabelLikeStatements());
486 void Profile(llvm::FoldingSetNodeID &
ID,
const ASTContext &Context,
487 bool Canonical)
const;
496 void ProcessODRHash(llvm::FoldingSetNodeID &ID,
ODRHash& Hash)
const;
509 :
Stmt(DeclStmtClass), DG(dg), StartLoc(startLoc), EndLoc(endLoc) {}
583 bool HasLeadingEmptyMacro =
false;
590 :
Stmt(NullStmtClass), SemiLoc(L),
591 HasLeadingEmptyMacro(hasLeadingEmptyMacro) {}
634 :
Stmt(CompoundStmtClass), LBraceLoc(Loc), RBraceLoc(Loc) {
635 CompoundStmtBits.NumStmts = 0;
641 bool body_empty()
const {
return CompoundStmtBits.NumStmts == 0; }
642 unsigned size()
const {
return CompoundStmtBits.NumStmts; }
653 return !body_empty() ? body_begin()[size() - 1] :
nullptr;
657 assert(!body_empty() &&
"setLastStmt");
658 body_begin()[size() - 1] = S;
669 return getTrailingObjects<Stmt *>();
675 return !body_empty() ? body_begin()[0] :
nullptr;
679 return !body_empty() ? body_begin()[size() - 1] :
nullptr;
693 std::reverse_iterator<const_body_iterator>;
733 :
Stmt(SC), KeywordLoc(KWLoc), ColonLoc(ColonLoc) {}
751 return const_cast<SwitchCase*
>(
this)->getSubStmt();
767 enum { LHS, RHS, SUBSTMT, END_EXPR };
768 Stmt* SubExprs[END_EXPR];
774 :
SwitchCase(CaseStmtClass, caseLoc, colonLoc) {
775 SubExprs[SUBSTMT] =
nullptr;
776 SubExprs[LHS] =
reinterpret_cast<Stmt*
>(lhs);
777 SubExprs[RHS] =
reinterpret_cast<Stmt*
>(rhs);
778 EllipsisLoc = ellipsisLoc;
796 return reinterpret_cast<const Expr*
>(SubExprs[LHS]);
800 return reinterpret_cast<const Expr*
>(SubExprs[RHS]);
816 while (
const auto *CS2 = dyn_cast<CaseStmt>(CS->
getSubStmt()))
828 return child_range(&SubExprs[0], &SubExprs[END_EXPR]);
837 SwitchCase(DefaultStmtClass, DL, CL), SubStmt(substmt) {}
868 if (
const auto *CS = dyn_cast<CaseStmt>(
this))
869 return CS->getLocEnd();
870 return cast<DefaultStmt>(
this)->getLocEnd();
882 :
Stmt(LabelStmtClass), IdentLoc(IL), TheDecl(D), SubStmt(substmt) {
885 "LabelStmt too big");
929 :
Stmt(AttributedStmtClass), SubStmt(SubStmt), AttrLoc(Loc),
930 NumAttrs(Attrs.size()) {
931 std::copy(Attrs.begin(), Attrs.end(), getAttrArrayPtr());
935 :
Stmt(AttributedStmtClass, Empty), NumAttrs(NumAttrs) {
936 std::fill_n(getAttrArrayPtr(), NumAttrs,
nullptr);
939 const Attr *
const *getAttrArrayPtr()
const {
940 return getTrailingObjects<const Attr *>();
942 const Attr **getAttrArrayPtr() {
return getTrailingObjects<const Attr *>(); }
953 return llvm::makeArrayRef(getAttrArrayPtr(), NumAttrs);
975 enum { INIT, VAR, COND, THEN, ELSE, END_EXPR };
976 Stmt* SubExprs[END_EXPR];
985 Stmt *elsev =
nullptr);
998 VarDecl *getConditionVariable()
const;
1004 return reinterpret_cast<DeclStmt*
>(SubExprs[VAR]);
1029 bool isObjCAvailabilityCheck()
const;
1045 return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
1056 enum { INIT, VAR, COND, BODY, END_EXPR };
1057 Stmt* SubExprs[END_EXPR];
1063 llvm::PointerIntPair<SwitchCase *, 1, bool> FirstCase;
1080 VarDecl *getConditionVariable()
const;
1086 return reinterpret_cast<DeclStmt*
>(SubExprs[VAR]);
1115 &&
"case/default already added to a switch");
1117 FirstCase.setPointer(SC);
1138 return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
1149 enum { VAR, COND, BODY, END_EXPR };
1150 Stmt* SubExprs[END_EXPR];
1167 VarDecl *getConditionVariable()
const;
1173 return reinterpret_cast<DeclStmt*
>(SubExprs[VAR]);
1200 return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
1207 enum { BODY, COND, END_EXPR };
1208 Stmt* SubExprs[END_EXPR];
1215 :
Stmt(DoStmtClass), DoLoc(DL), WhileLoc(WL), RParenLoc(RP) {
1216 SubExprs[COND] =
reinterpret_cast<Stmt*
>(cond);
1217 SubExprs[BODY] = body;
1249 return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
1258 enum { INIT, CONDVAR, COND, INC, BODY, END_EXPR };
1259 Stmt* SubExprs[END_EXPR];
1280 VarDecl *getConditionVariable()
const;
1286 return reinterpret_cast<DeclStmt*
>(SubExprs[CONDVAR]);
1324 return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
1336 :
Stmt(GotoStmtClass), Label(label), GotoLoc(GL), LabelLoc(LL) {}
1373 :
Stmt(IndirectGotoStmtClass), GotoLoc(gotoLoc), StarLoc(starLoc),
1374 Target((
Stmt*)target) {}
1378 :
Stmt(IndirectGotoStmtClass, Empty) {}
1444 "BreakStmt too large");
1485 :
Stmt(ReturnStmtClass), RetLoc(RL), RetExpr((
Stmt *)E),
1486 NRVOCandidate(NRVOCandidate) {}
1491 const Expr *getRetValue()
const;
1492 Expr *getRetValue();
1511 return RetExpr ? RetExpr->
getLocEnd() : RetLoc;
1520 if (RetExpr)
return child_range(&RetExpr, &RetExpr+1);
1547 unsigned numoutputs,
unsigned numinputs,
unsigned numclobbers)
1548 :
Stmt (SC), AsmLoc(asmloc), IsSimple(issimple), IsVolatile(isvolatile),
1549 NumOutputs(numoutputs), NumInputs(numinputs),
1550 NumClobbers(numclobbers) {}
1573 std::string generateAsmString(
const ASTContext &
C)
const;
1582 StringRef getOutputConstraint(
unsigned i)
const;
1588 return getOutputConstraint(i)[0] ==
'+';
1591 const Expr *getOutputExpr(
unsigned i)
const;
1595 unsigned getNumPlusOperands()
const;
1603 StringRef getInputConstraint(
unsigned i)
const;
1605 const Expr *getInputExpr(
unsigned i)
const;
1610 StringRef getClobber(
unsigned i)
const;
1625 return &Exprs[0] + NumOutputs;
1629 return &Exprs[0] + NumOutputs + NumInputs;
1635 return &Exprs[0] + NumOutputs;
1639 return &Exprs[0] + NumOutputs + NumInputs;
1658 return &Exprs[0] + NumOutputs;
1670 return &Exprs[0] + NumOutputs;
1678 return child_range(&Exprs[0], &Exprs[0] + NumOutputs + NumInputs);
1696 bool isvolatile,
unsigned numoutputs,
unsigned numinputs,
1735 : MyKind(Operand), Str(S), OperandNo(OpNo),
1744 assert(isOperand());
1749 assert(isOperand() &&
"Range is currently used only for Operands.");
1764 const ASTContext &C,
unsigned &DiagOffs)
const;
1767 std::string generateAsmString(
const ASTContext &C)
const;
1775 return II->getName();
1780 StringRef getOutputConstraint(
unsigned i)
const;
1783 return Constraints[i];
1786 return Constraints[i];
1789 Expr *getOutputExpr(
unsigned i);
1792 return const_cast<GCCAsmStmt*
>(
this)->getOutputExpr(i);
1798 return Names[i + NumOutputs];
1803 return II->getName();
1808 StringRef getInputConstraint(
unsigned i)
const;
1811 return Constraints[i + NumOutputs];
1814 return Constraints[i + NumOutputs];
1817 Expr *getInputExpr(
unsigned i);
1818 void setInputExpr(
unsigned i,
Expr *E);
1821 return const_cast<GCCAsmStmt*
>(
this)->getInputExpr(i);
1825 void setOutputsAndInputsAndClobbers(
const ASTContext &C,
1829 unsigned NumOutputs,
1832 unsigned NumClobbers);
1840 int getNamedOperand(StringRef SymbolicName)
const;
1842 StringRef getClobber(
unsigned i)
const;
1866 unsigned NumAsmToks = 0;
1868 Token *AsmToks =
nullptr;
1869 StringRef *Constraints =
nullptr;
1870 StringRef *Clobbers =
nullptr;
1897 std::string generateAsmString(
const ASTContext &
C)
const;
1902 assert(i < NumOutputs);
1903 return Constraints[i];
1906 Expr *getOutputExpr(
unsigned i);
1909 return const_cast<MSAsmStmt*
>(
this)->getOutputExpr(i);
1915 assert(i < NumInputs);
1916 return Constraints[i + NumOutputs];
1919 Expr *getInputExpr(
unsigned i);
1920 void setInputExpr(
unsigned i,
Expr *E);
1923 return const_cast<MSAsmStmt*
>(
this)->getInputExpr(i);
1929 return llvm::makeArrayRef(Constraints, NumInputs + NumOutputs);
1933 return llvm::makeArrayRef(Clobbers, NumClobbers);
1937 return llvm::makeArrayRef(reinterpret_cast<Expr**>(Exprs),
1938 NumInputs + NumOutputs);
1941 StringRef
getClobber(
unsigned i)
const {
return getClobbers()[i]; }
1958 return child_range(&Exprs[0], &Exprs[NumInputs + NumOutputs]);
1969 enum { FILTER_EXPR,
BLOCK };
1988 return reinterpret_cast<Expr*
>(Children[FILTER_EXPR]);
1992 return cast<CompoundStmt>(Children[
BLOCK]);
2045 enum { TRY = 0, HANDLER = 1 };
2069 return cast<CompoundStmt>(Children[TRY]);
2093 :
Stmt(SEHLeaveStmtClass), LeaveLoc(LL) {}
2139 llvm::PointerIntPair<VarDecl *, 2, VariableCaptureKind> VarAndKind;
2170 return getCaptureKind() == VCK_ByCopy;
2176 return getCaptureKind() == VCK_VLAType;
2182 VarDecl *getCapturedVar()
const;
2187 unsigned NumCaptures;
2191 llvm::PointerIntPair<CapturedDecl *, 2, CapturedRegionKind> CapDeclAndKind;
2203 Stmt **getStoredStmts() {
return reinterpret_cast<Stmt **
>(
this + 1); }
2205 Stmt *
const *getStoredStmts()
const {
2206 return reinterpret_cast<Stmt *
const *
>(
this + 1);
2209 Capture *getStoredCaptures()
const;
2211 void setCapturedStmt(
Stmt *S) { getStoredStmts()[NumCaptures] = S; }
2223 unsigned NumCaptures);
2247 assert(D &&
"null RecordDecl");
2252 bool capturesVariable(
const VarDecl *Var)
const;
2274 return getStoredCaptures() + NumCaptures;
2288 llvm::iterator_range<const_capture_init_iterator>;
2300 return reinterpret_cast<Expr **
>(getStoredStmts());
2304 return reinterpret_cast<Expr *
const *
>(getStoredStmts());
2310 return capture_init_begin() + NumCaptures;
2314 return capture_init_begin() + NumCaptures;
2319 return getCapturedStmt()->getLocStart();
2324 return getCapturedStmt()->getLocEnd();
2328 return getCapturedStmt()->getSourceRange();
2340 #endif // LLVM_CLANG_AST_STMT_H SourceLocation getRParenLoc() const
child_iterator child_begin()
SourceLocation getEndLoc() const LLVM_READONLY
ObjCIndirectCopyRestoreExpr - Represents the passing of a function argument by indirect copy-restore ...
GotoStmt(EmptyShell Empty)
Build an empty goto statement.
SourceLocation getRBracLoc() const
IdentifierInfo * getInputIdentifier(unsigned i) const
DoStmt(Stmt *body, Expr *cond, SourceLocation DL, SourceLocation WL, SourceLocation RP)
static bool classof(const Stmt *T)
SourceLocation getRParenLoc() const
This represents a GCC inline-assembly statement extension.
const Stmt * getElse() const
unsigned getNumInputs() const
CompoundStmt * getBlock() const
SourceLocation getForLoc() const
const Stmt * getBody() const
capture_init_iterator capture_init_begin()
Retrieve the first initialization argument.
capture_const_range captures() const
SourceLocation getEndLoc() const LLVM_READONLY
const_child_iterator child_end() const
SourceLocation getLocEnd() const LLVM_READONLY
ConstExprIterator(const Stmt *const *I)
DefaultStmt(SourceLocation DL, SourceLocation CL, Stmt *substmt)
SourceLocation getEllipsisLoc() const
void setNRVOCandidate(const VarDecl *Var)
static bool classof(const Stmt *T)
__SIZE_TYPE__ size_t
The unsigned integer type of the result of the sizeof operator.
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
DominatorTree GraphTraits specialization so the DominatorTree can be iterable by generic graph iterat...
const_reverse_body_iterator body_rbegin() const
outputs_iterator end_outputs()
const DeclStmt * getConditionVariableDeclStmt() const
If this ForStmt has a condition variable, return the faux DeclStmt associated with the creation of th...
IndirectGotoStmt(EmptyShell Empty)
Build an empty indirect goto statement.
std::reverse_iterator< const_body_iterator > const_reverse_body_iterator
Stmt - This represents one statement.
IfStmt - This represents an if/then/else.
AsmStmt(StmtClass SC, EmptyShell Empty)
Build an empty inline-assembly statement.
bool capturesThis() const
Determine whether this capture handles the C++ 'this' pointer.
SourceLocation getLocStart() const LLVM_READONLY
unsigned getNumOutputs() const
SourceLocation getLocEnd() const LLVM_READONLY
llvm::iterator_range< body_iterator > body_range
ContinueStmt(EmptyShell Empty)
Build an empty continue statement.
const StringLiteral * getAsmString() const
void setRParenLoc(SourceLocation L)
void setContinueLoc(SourceLocation L)
Decl - This represents one declaration (or definition), e.g.
void setDeclGroup(DeclGroupRef DGR)
bool hasLeadingEmptyMacro() const
FloatingLiteralBitfields FloatingLiteralBits
SourceLocation getBeginLoc() const LLVM_READONLY
NullStmt(EmptyShell Empty)
Build an empty null statement.
SourceLocation getBeginLoc() const LLVM_READONLY
const Expr * getOutputExpr(unsigned i) const
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getIdentLoc() const
Represents an attribute applied to a statement.
const Expr * getOutputExpr(unsigned i) const
SourceLocation getLocStart() const LLVM_READONLY
llvm::iterator_range< child_iterator > child_range
const RecordDecl * getCapturedRecordDecl() const
Retrieve the record declaration for captured variables.
DeclRefExprBitfields DeclRefExprBits
Represents a call to a C++ constructor.
SourceLocation getBeginLoc() const LLVM_READONLY
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
void setSwitchCaseList(SwitchCase *SC)
Set the case list for this switch statement.
NullStmt(SourceLocation L, bool hasLeadingEmptyMacro=false)
SourceLocation getBeginLoc() const LLVM_READONLY
void setStartLoc(SourceLocation L)
SourceLocation getGotoLoc() const
void setForLoc(SourceLocation L)
SourceLocation getLocStart() const LLVM_READONLY
WhileStmt(EmptyShell Empty)
Build an empty while statement.
const_child_iterator child_begin() const
SourceLocation getLocEnd() const LLVM_READONLY
Represents a variable declaration or definition.
const VarDecl * getNRVOCandidate() const
Retrieve the variable that might be used for the named return value optimization. ...
SourceLocation getLParenLoc() const
static bool classof(const Stmt *T)
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getBeginLoc() const LLVM_READONLY
void setAsmLoc(SourceLocation L)
const_outputs_iterator begin_outputs() const
const Expr * getCond() const
SourceLocation getIfLoc() const
Describes how types, statements, expressions, and declarations should be printed. ...
SourceLocation getLocStart() const LLVM_READONLY
capture_iterator capture_begin()
Retrieve an iterator pointing to the first capture.
static StringRef bytes(const std::vector< T, Allocator > &v)
Represents an expression – generally a full-expression – that introduces cleanups to be run at the ...
llvm::iterator_range< decl_iterator > decl_range
StringRef getInputName(unsigned i) const
std::string getName(ArrayRef< StringRef > Parts) const
Get the platform-specific name separator.
void setBody(Stmt *S, SourceLocation SL)
SourceLocation getLocStart() const LLVM_READONLY
Stmt(StmtClass SC, EmptyShell)
Construct an empty statement.
CoawaitExprBitfields CoawaitBits
static bool classof(const Stmt *T)
LabelStmt - Represents a label, which has a substatement.
Represents a struct/union/class.
Represents a C99 designated initializer expression.
const Expr * getTarget() const
inputs_iterator begin_inputs()
SourceLocation getColonLoc() const
One of these records is kept for each identifier that is lexed.
const_outputs_iterator end_outputs() const
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
DeclGroupRef::const_iterator const_decl_iterator
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getLocStart() const LLVM_READONLY
const_body_iterator body_begin() const
SourceLocation getEndLoc() const
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getBeginLoc() const LLVM_READONLY
LabelStmt(SourceLocation IL, LabelDecl *D, Stmt *substmt)
CharSourceRange getRange() const
CharacterLiteralBitfields CharacterLiteralBits
ArrayRef< Expr * > getAllExprs() const
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getEndLoc() const
Token - This structure provides full information about a lexed token.
ObjCIndirectCopyRestoreExprBitfields ObjCIndirectCopyRestoreExprBits
void setReturnLoc(SourceLocation L)
llvm::iterator_range< const_inputs_iterator > inputs_const_range
MSAsmStmt(EmptyShell Empty)
Build an empty MS-style inline-assembly statement.
SourceLocation getLocEnd() const LLVM_READONLY
const DeclGroupRef getDeclGroup() const
bool isAllEnumCasesCovered() const
Returns true if the SwitchStmt is a switch of an enum value and all cases have been explicitly covere...
static bool classof(const Stmt *T)
ObjCArrayLiteral - used for objective-c array containers; as in: @["Hello", NSApp, [NSNumber numberWithInt:42]];.
SwitchCase(StmtClass SC, SourceLocation KWLoc, SourceLocation ColonLoc)
const Stmt * getSubStmt() const
void addSwitchCase(SwitchCase *SC)
SourceLocation getEndLoc() const LLVM_READONLY
static bool classof(const Stmt *T)
IndirectGotoStmt - This represents an indirect goto.
Describes an C or C++ initializer list.
SwitchCase(StmtClass SC, EmptyShell)
Expr *const * const_capture_init_iterator
Const iterator that walks over the capture initialization arguments.
GCCAsmStmt(EmptyShell Empty)
Build an empty inline-assembly statement.
ForStmt - This represents a 'for (init;cond;inc)' stmt.
outputs_iterator begin_outputs()
SourceLocation getEndLoc() const LLVM_READONLY
static void dump(llvm::raw_ostream &OS, StringRef FunctionName, ArrayRef< CounterExpression > Expressions, ArrayRef< CounterMappingRegion > Regions)
LabelDecl * getDecl() const
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
SourceLocation getLBracLoc() const
SourceLocation getLocEnd() const LLVM_READONLY
void setEndLoc(SourceLocation L)
DeclStmt(EmptyShell Empty)
Build an empty declaration statement.
llvm::iterator_range< const_outputs_iterator > outputs_const_range
SourceLocation getLocStart() const LLVM_READONLY
const StringLiteral * getInputConstraintLiteral(unsigned i) const
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getEndLoc() const LLVM_READONLY
void setAsmString(StringLiteral *E)
static bool classof(const Stmt *T)
AsmStmt(StmtClass SC, SourceLocation asmloc, bool issimple, bool isvolatile, unsigned numoutputs, unsigned numinputs, unsigned numclobbers)
const Stmt * getInit() const
SourceLocation getLocStart() const LLVM_READONLY
const Expr * getInc() const
SourceLocation getContinueLoc() const
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
SourceLocation getLocEnd() const LLVM_READONLY
StringLiteral * getClobberStringLiteral(unsigned i)
StringRef getOutputName(unsigned i) const
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getLocEnd() const LLVM_READONLY
bool isOutputPlusConstraint(unsigned i) const
isOutputPlusConstraint - Return true if the specified output constraint is a "+" constraint (which is...
const Expr * getCond() const
SourceLocation getTryLoc() const
void setEndLoc(SourceLocation L)
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Represents the body of a CapturedStmt, and serves as its DeclContext.
const Expr * getLHS() const
const_body_iterator body_end() const
Iterator for iterating over Stmt * arrays that contain only Expr *.
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getLocStart() const LLVM_READONLY
const_decl_iterator decl_begin() const
StringLiteral * getAsmString()
Const iterator for iterating over Stmt * arrays that contain only Expr *.
SourceLocation getEndLoc() const LLVM_READONLY
void setColonLoc(SourceLocation L)
llvm::iterator_range< const_child_iterator > const_child_range
void setBreakLoc(SourceLocation L)
CompoundStmt - This represents a group of statements like { stmt stmt }.
SourceLocation getLocEnd() const LLVM_READONLY
Describes the capture of either a variable, or 'this', or variable-length array type.
Stmt * stripLabelLikeStatements()
SourceLocation getLocStart() const LLVM_READONLY
static bool classof(const Stmt *T)
const_inputs_iterator begin_inputs() const
SourceLocation getBeginLoc() const LLVM_READONLY
void setSemiLoc(SourceLocation L)
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getLocStart() const LLVM_READONLY
bool IsVolatile
If true, treat this inline assembly as having side effects.
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand...
static bool classof(const Stmt *T)
static bool classof(const Stmt *T)
SourceLocation getEndLoc() const LLVM_READONLY
unsigned getOperandNo() const
const DeclStmt * getConditionVariableDeclStmt() const
If this IfStmt has a condition variable, return the faux DeclStmt associated with the creation of tha...
SourceLocation getLabelLoc() const
llvm::iterator_range< const_capture_iterator > capture_const_range
void setLeaveLoc(SourceLocation L)
const Stmt * getSubStmt() const
const Stmt * getSubStmt() const
void setRParenLoc(SourceLocation L)
SourceLocation getFinallyLoc() const
GotoStmt(LabelDecl *label, SourceLocation GL, SourceLocation LL)
Expr - This represents one expression.
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation getElseLoc() const
void setWhileLoc(SourceLocation L)
Represents a character-granular source range.
SourceLocation getLocStart() const LLVM_READONLY
inputs_const_range inputs() const
llvm::iterator_range< const_capture_init_iterator > const_capture_init_range
ArrayRef< StringRef > getClobbers() const
InitListExprBitfields InitListExprBits
static bool classof(const Stmt *T)
StringRef getClobber(unsigned i) const
SourceLocation getDefaultLoc() const
void setLParenLoc(SourceLocation L)
const StringLiteral * getClobberStringLiteral(unsigned i) const
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getWhileLoc() const
SourceLocation getLocEnd() const LLVM_READONLY
const Stmt * getThen() const
AsmStringPiece - this is part of a decomposed asm string specification (for use with the AnalyzeAsmSt...
const Expr * getInputExpr(unsigned i) const
SourceLocation getEndLoc() const LLVM_READONLY
const Stmt * getCapturedStmt() const
SourceLocation KeywordLoc
void setRetValue(Expr *E)
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
void setColonLoc(SourceLocation L)
SourceLocation getEndLoc() const LLVM_READONLY
ExprWithCleanupsBitfields ExprWithCleanupsBits
std::reverse_iterator< body_iterator > reverse_body_iterator
static bool classof(const Stmt *T)
CompoundStmtBitfields CompoundStmtBits
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
capture_init_range capture_inits()
SourceLocation getLocEnd() const LLVM_READONLY
static OMPLinearClause * CreateEmpty(const ASTContext &C, unsigned NumVars)
Creates an empty clause with the place for NumVars variables.
AsmStringPiece(const std::string &S)
ForStmt(EmptyShell Empty)
Build an empty for statement.
SourceLocation getSwitchLoc() const
StringLiteral * getOutputConstraintLiteral(unsigned i)
LabelDecl * getLabel() const
ReturnStmt - This represents a return, optionally of an expression: return; return 4;...
An expression that sends a message to the given Objective-C object or class.
This represents a Microsoft inline-assembly statement extension.
void setColonLoc(SourceLocation L)
SourceLocation getDoLoc() const
SwitchCase * getSwitchCaseList()
llvm::iterator_range< const_decl_iterator > decl_const_range
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getLocEnd() const LLVM_READONLY
static bool classof(const Stmt *T)
Stmt *const * const_body_iterator
SourceLocation getLocEnd() const LLVM_READONLY
const_inputs_iterator end_inputs() const
const Expr * getCond() const
DoStmt - This represents a 'do/while' stmt.
AsmStmt is the base class for GCCAsmStmt and MSAsmStmt.
std::reverse_iterator< decl_iterator > reverse_decl_iterator
const Stmt * IgnoreContainers(bool IgnoreCaptured=false) const
SourceLocation getEndLoc() const
OpaqueValueExprBitfields OpaqueValueExprBits
decl_const_range decls() const
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class...
void setDecl(LabelDecl *D)
static bool classof(const Stmt *T)
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr...
This captures a statement into a function.
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
SourceLocation getLocEnd() const LLVM_READONLY
void setGotoLoc(SourceLocation L)
CaseStmt(Expr *lhs, Expr *rhs, SourceLocation caseLoc, SourceLocation ellipsisLoc, SourceLocation colonLoc)
Encodes a location in the source.
StringRef getOutputConstraint(unsigned i) const
PseudoObjectExprBitfields PseudoObjectExprBits
IfStmtBitfields IfStmtBits
SourceLocation getBeginLoc() const LLVM_READONLY
SEHLeaveStmt(EmptyShell Empty)
Build an empty __leave statement.
const SwitchCase * getSwitchCaseList() const
void setDoLoc(SourceLocation L)
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
void setLastStmt(Stmt *S)
ArrayRef< const Attr * > getAttrs() const
void setConstexpr(bool C)
SourceLocation getExceptLoc() const
const_capture_iterator capture_begin() const
SourceLocation getLocStart() const LLVM_READONLY
void setIdentLoc(SourceLocation L)
const_child_range children() const
DeclStmt - Adaptor class for mixing declarations with statements and expressions. ...
Represents the declaration of a label.
bool capturesVariable() const
Determine whether this capture handles a variable (by reference).
reverse_body_iterator body_rend()
SourceLocation getLBraceLoc() const
const std::string & getString() const
CaseStmt(EmptyShell Empty)
Build an empty switch case statement.
void setAllEnumCasesCovered()
Set a flag in the SwitchStmt indicating that if the 'switch (X)' is a switch over an enum value then ...
SourceLocation getLocStart() const LLVM_READONLY
CompoundStmt(SourceLocation Loc)
reference operator*() const
static bool classof(const Stmt *T)
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load, __atomic_store, and __atomic_compare_exchange_*, for the similarly-named C++11 instructions, and __c11 variants for <stdatomic.h>, and corresponding __opencl_atomic_* for OpenCL 2.0.
SourceLocation getBeginLoc() const LLVM_READONLY
decl_iterator decl_begin()
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getGotoLoc() const
reverse_decl_iterator decl_rbegin()
SEHLeaveStmt(SourceLocation LL)
const StringLiteral * getOutputConstraintLiteral(unsigned i) const
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Stmt * getCapturedStmt()
Retrieve the statement being captured.
const Stmt * body_front() const
unsigned capture_size() const
Retrieve the number of captures, including 'this'.
const Stmt * getBody() const
SourceLocation getLocEnd() const LLVM_READONLY
void setCaseLoc(SourceLocation L)
SourceLocation getEndLoc() const
LabelStmt(EmptyShell Empty)
const_capture_init_range capture_inits() const
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getKeywordLoc() const
SourceLocation getStarLoc() const
const DeclStmt * getConditionVariableDeclStmt() const
If this WhileStmt has a condition variable, return the faux DeclStmt associated with the creation of ...
void setCapturedRecordDecl(RecordDecl *D)
Set the record declaration for captured variables.
A placeholder type used to construct an empty shell of a type, that will be filled in later (e...
A qualified reference to a name whose declaration cannot yet be resolved.
SourceLocation getLocStart() const LLVM_READONLY
IfStmt(EmptyShell Empty)
Build an empty if/then/else statement.
const_child_range children() const
void setGotoLoc(SourceLocation L)
NullStmt - This is the null statement ";": C99 6.8.3p3.
StringRef getInputConstraint(unsigned i) const
Dataflow Directional Tag Classes.
SourceLocation getLocStart() const LLVM_READONLY
bool isValid() const
Return true if this is a valid SourceLocation object.
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getLocEnd() const LLVM_READONLY
IdentifierInfo * getOutputIdentifier(unsigned i) const
SourceLocation getStartLoc() const LLVM_READONLY
SourceLocation getBeginLoc() const LLVM_READONLY
llvm::iterator_range< outputs_iterator > outputs_range
const Stmt * body_back() const
Reads an AST files chain containing the contents of a translation unit.
SourceLocation getEndLoc() const LLVM_READONLY
static bool classof(const Stmt *T)
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getBeginLoc() const LLVM_READONLY
DoStmt(EmptyShell Empty)
Build an empty do-while statement.
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getLocEnd() const LLVM_READONLY
Stmt * getHandler() const
SourceLocation getSemiLoc() const
SourceLocation getEndLoc() const LLVM_READONLY
StmtClass getStmtClass() const
reference operator*() const
SwitchCase * getNextSwitchCase()
bool isSingleDecl() const
static bool classof(const Stmt *T)
SourceLocation getEndLoc() const LLVM_READONLY
void setEllipsisLoc(SourceLocation L)
const Decl * getSingleDecl() const
SourceLocation getLocEnd() const LLVM_READONLY
ReturnStmt(SourceLocation RL, Expr *E, const VarDecl *NRVOCandidate)
static bool classof(const Stmt *T)
BreakStmt(EmptyShell Empty)
Build an empty break statement.
SourceLocation getBeginLoc() const LLVM_READONLY
const Stmt * getSubStmt() const
SourceLocation getLocEnd() const LLVM_READONLY
bool isSingleDecl() const
isSingleDecl - This method returns true if this DeclStmt refers to a single Decl. ...
body_iterator body_begin()
static bool classof(const Stmt *T)
IndirectGotoStmt(SourceLocation gotoLoc, SourceLocation starLoc, Expr *target)
const Stmt * getBody() const
llvm::iterator_range< const_body_iterator > body_const_range
Represents a __leave statement.
bool capturesVariableByCopy() const
Determine whether this capture handles a variable by copy.
SwitchStmt - This represents a 'switch' stmt.
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getLeaveLoc() const
const_capture_init_iterator capture_init_end() const
static bool classof(const Stmt *T)
DefaultStmt(EmptyShell Empty)
Build an empty default statement.
reverse_decl_iterator decl_rend()
StringLiteral * getInputConstraintLiteral(unsigned i)
DeclGroupRef getDeclGroup()
Represents a 'co_await' expression.
const Expr * getInputExpr(unsigned i) const
TypeTraitExprBitfields TypeTraitExprBits
void setSwitchLoc(SourceLocation L)
const Stmt * IgnoreImplicit() const
static bool classof(const Stmt *T)
SourceLocation getLocEnd() const LLVM_READONLY
AsmStringPiece(unsigned OpNo, const std::string &S, SourceLocation Begin, SourceLocation End)
bool IsSimple
True if the assembly statement does not have any input or output operands.
static bool classof(const Stmt *T)
SourceLocation getLocStart() const LLVM_READONLY
StringRef getAsmString() const
ArrayRef< StringRef > getAllConstraints() const
SourceLocation getEndLoc() const LLVM_READONLY
UnaryExprOrTypeTraitExprBitfields UnaryExprOrTypeTraitExprBits
SourceLocation getColonLoc() const
SourceLocation getBeginLoc() const LLVM_READONLY
unsigned getNumClobbers() const
ReturnStmt(SourceLocation RL)
SourceLocation getRParenLoc() const
void setStarLoc(SourceLocation L)
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
SourceLocation getAsmLoc() const
GotoStmt - This represents a direct goto.
Decl *const * const_iterator
const SwitchCase * getNextSwitchCase() const
SourceLocation getBeginLoc() const LLVM_READONLY
SwitchStmt(EmptyShell Empty)
Build a empty switch statement.
static bool classof(const Stmt *T)
llvm::iterator_range< capture_iterator > capture_range
SourceLocation getWhileLoc() const
Defines the clang::SourceLocation class and associated facilities.
llvm::iterator_range< inputs_iterator > inputs_range
ContinueStmt - This represents a continue.
const_decl_iterator decl_end() const
const Expr * getRHS() const
reverse_body_iterator body_rbegin()
void setLBraceLoc(SourceLocation L)
Expr * getFilterExpr() const
void setElseLoc(SourceLocation L)
SourceLocation getAttrLoc() const
ContinueStmt(SourceLocation CL)
SourceLocation getBeginLoc() const LLVM_READONLY
const Stmt * getInit() const
OpenMPLinearClauseKind getModifier() const
Return modifier.
SourceLocation getLocStart() const LLVM_READONLY
WhileStmt - This represents a 'while' stmt.
llvm::iterator_range< capture_init_iterator > capture_init_range
void setIfLoc(SourceLocation L)
static bool classof(const Stmt *T)
const Stmt * getSubStmt() const
void setDefaultLoc(SourceLocation L)
SourceLocation getBreakLoc() const
SourceLocation getCaseLoc() const
capture_iterator capture_end() const
Retrieve an iterator pointing past the end of the sequence of captures.
VariableCaptureKind
The different capture forms: by 'this', by reference, capture for variable-length array type etc...
StringLiteral - This represents a string literal expression, e.g.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
static bool classof(const Stmt *T)
SourceLocation getEndLoc() const LLVM_READONLY
void setRParenLoc(SourceLocation L)
SourceLocation getLocEnd() const LLVM_READONLY
void setNextSwitchCase(SwitchCase *SC)
void initialize(TemplateInstantiationCallbackPtrs &Callbacks, const Sema &TheSema)
body_const_range body() const
A reference to a declared variable, function, enum, etc.
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getColonLoc() const
void setLabel(LabelDecl *D)
static bool classof(const Stmt *T)
BreakStmt - This represents a break.
const Stmt * getInit() const
void setSubStmt(Stmt *SS)
CallExprBitfields CallExprBits
CapturedRegionKind
The different kinds of captured statement.
const Stmt * getBody() const
CastExprBitfields CastExprBits
DeclStmt(DeclGroupRef dg, SourceLocation startLoc, SourceLocation endLoc)
const Expr * getCond() const
SourceLocation getLocStart() const LLVM_READONLY
A trivial tuple used to represent a source range.
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type, member-designator).
const_reverse_body_iterator body_rend() const
SourceLocation getEndLoc() const LLVM_READONLY
const Expr * getCond() const
capture_init_iterator capture_init_end()
Retrieve the iterator pointing one past the last initialization argument.
SourceLocation ColonLoc
Location of ':'.
void setWhileLoc(SourceLocation L)
This class handles loading and caching of source files into memory.
BreakStmt(SourceLocation BL)
CompoundStmt * getTryBlock() const
CompoundStmt * getBlock() const
void setKeywordLoc(SourceLocation L)
SourceLocation getReturnLoc() const
ReturnStmt(EmptyShell Empty)
Build an empty return expression.
bool capturesVariableArrayType() const
Determine whether this capture handles a variable-length array type.
Attr - This represents one attribute.
SourceLocation getLocEnd() const LLVM_READONLY
void setLabelLoc(SourceLocation L)
static OMPLinearClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc, SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef< Expr *> VL, ArrayRef< Expr *> PL, ArrayRef< Expr *> IL, Expr *Step, Expr *CalcStep, Stmt *PreInit, Expr *PostUpdate)
Creates clause with a list of variables VL and a linear step Step.
child_iterator child_end()
#define BLOCK(DERIVED, BASE)
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getEndLoc() const
const_capture_init_iterator capture_init_begin() const
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getLocation() const
Retrieve the source location at which the variable or 'this' was first used.
const DeclStmt * getConditionVariableDeclStmt() const
If this SwitchStmt has a condition variable, return the faux DeclStmt associated with the creation of...
inputs_iterator end_inputs()
outputs_const_range outputs() const
const LabelDecl * getConstantTarget() const