summaryrefslogtreecommitdiff
path: root/include/clang/AST/Stmt.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/AST/Stmt.h')
-rw-r--r--include/clang/AST/Stmt.h198
1 files changed, 106 insertions, 92 deletions
diff --git a/include/clang/AST/Stmt.h b/include/clang/AST/Stmt.h
index b27dbfacf6a64..91dbcb71a600c 100644
--- a/include/clang/AST/Stmt.h
+++ b/include/clang/AST/Stmt.h
@@ -92,7 +92,7 @@ protected:
class StmtBitfields {
friend class Stmt;
- /// \brief The statement class.
+ /// The statement class.
unsigned sClass : 8;
};
enum { NumStmtBits = 8 };
@@ -198,11 +198,13 @@ protected:
class CastExprBitfields {
friend class CastExpr;
+ friend class ImplicitCastExpr;
unsigned : NumExprBits;
unsigned Kind : 6;
- unsigned BasePathSize : 32 - 6 - NumExprBits;
+ unsigned PartOfExplicitCast : 1; // Only set for ImplicitCastExpr.
+ unsigned BasePathSize : 32 - 6 - 1 - NumExprBits;
};
class CallExprBitfields {
@@ -237,6 +239,16 @@ protected:
unsigned ResultIndex : 32 - 8 - NumExprBits;
};
+ class OpaqueValueExprBitfields {
+ friend class OpaqueValueExpr;
+
+ unsigned : NumExprBits;
+
+ /// The OVE is a unique semantic reference to its source expressio if this
+ /// bit is set to true.
+ unsigned IsUnique : 1;
+ };
+
class ObjCIndirectCopyRestoreExprBitfields {
friend class ObjCIndirectCopyRestoreExpr;
@@ -262,14 +274,14 @@ protected:
unsigned : NumExprBits;
- /// \brief The kind of type trait, which is a value of a TypeTrait enumerator.
+ /// The kind of type trait, which is a value of a TypeTrait enumerator.
unsigned Kind : 8;
- /// \brief If this expression is not value-dependent, this indicates whether
+ /// If this expression is not value-dependent, this indicates whether
/// the trait evaluated true or false.
unsigned Value : 1;
- /// \brief The number of arguments to this type trait.
+ /// The number of arguments to this type trait.
unsigned NumArgs : 32 - 8 - 1 - NumExprBits;
};
@@ -294,6 +306,7 @@ protected:
CallExprBitfields CallExprBits;
ExprWithCleanupsBitfields ExprWithCleanupsBits;
PseudoObjectExprBitfields PseudoObjectExprBits;
+ OpaqueValueExprBitfields OpaqueValueExprBits;
ObjCIndirectCopyRestoreExprBitfields ObjCIndirectCopyRestoreExprBits;
InitListExprBitfields InitListExprBits;
TypeTraitExprBitfields TypeTraitExprBits;
@@ -319,7 +332,7 @@ public:
void operator delete(void *, void *) noexcept {}
public:
- /// \brief A placeholder type used to construct an empty shell of a
+ /// A placeholder type used to construct an empty shell of a
/// type, that will be filled in later (e.g., by some
/// de-serialization).
struct EmptyShell {};
@@ -358,11 +371,11 @@ protected:
};
private:
- /// \brief Whether statistic collection is enabled.
+ /// Whether statistic collection is enabled.
static bool StatisticsEnabled;
protected:
- /// \brief Construct an empty statement.
+ /// Construct an empty statement.
explicit Stmt(StmtClass SC, EmptyShell) : Stmt(SC) {}
public:
@@ -393,7 +406,7 @@ public:
static void EnableStatistics();
static void PrintStats();
- /// \brief Dumps the specified AST fragment and all subtrees to
+ /// Dumps the specified AST fragment and all subtrees to
/// \c llvm::errs().
void dump() const;
void dump(SourceManager &SM) const;
@@ -421,7 +434,7 @@ public:
return const_cast<Stmt *>(this)->IgnoreImplicit();
}
- /// \brief Skip no-op (attributed, compound) container stmts and skip captured
+ /// Skip no-op (attributed, compound) container stmts and skip captured
/// stmt at the top, if \a IgnoreCaptured is true.
Stmt *IgnoreContainers(bool IgnoreCaptured = false);
const Stmt *IgnoreContainers(bool IgnoreCaptured = false) const {
@@ -444,6 +457,7 @@ public:
using const_child_range = llvm::iterator_range<const_child_iterator>;
child_range children();
+
const_child_range children() const {
auto Children = const_cast<Stmt *>(this)->children();
return const_child_range(Children.begin(), Children.end());
@@ -455,7 +469,7 @@ public:
const_child_iterator child_begin() const { return children().begin(); }
const_child_iterator child_end() const { return children().end(); }
- /// \brief Produce a unique representation of the given statement.
+ /// Produce a unique representation of the given statement.
///
/// \param ID once the profiling operation is complete, will contain
/// the unique representation of the given statement.
@@ -470,7 +484,7 @@ public:
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context,
bool Canonical) const;
- /// \brief Calculate a unique representation for a statement that is
+ /// Calculate a unique representation for a statement that is
/// stable across compiler invocations.
///
/// \param ID profile information will be stored in ID.
@@ -492,7 +506,7 @@ public:
DeclStmt(DeclGroupRef dg, SourceLocation startLoc, SourceLocation endLoc)
: Stmt(DeclStmtClass), DG(dg), StartLoc(startLoc), EndLoc(endLoc) {}
- /// \brief Build an empty declaration statement.
+ /// Build an empty declaration statement.
explicit DeclStmt(EmptyShell Empty) : Stmt(DeclStmtClass, Empty) {}
/// isSingleDecl - This method returns true if this DeclStmt refers
@@ -532,9 +546,11 @@ public:
using decl_const_range = llvm::iterator_range<const_decl_iterator>;
decl_range decls() { return decl_range(decl_begin(), decl_end()); }
+
decl_const_range decls() const {
return decl_const_range(decl_begin(), decl_end());
}
+
decl_iterator decl_begin() { return DG.begin(); }
decl_iterator decl_end() { return DG.end(); }
const_decl_iterator decl_begin() const { return DG.begin(); }
@@ -556,7 +572,7 @@ public:
class NullStmt : public Stmt {
SourceLocation SemiLoc;
- /// \brief True if the null statement was preceded by an empty macro, e.g:
+ /// True if the null statement was preceded by an empty macro, e.g:
/// @code
/// #define CALL(x)
/// CALL(0);
@@ -571,7 +587,7 @@ public:
: Stmt(NullStmtClass), SemiLoc(L),
HasLeadingEmptyMacro(hasLeadingEmptyMacro) {}
- /// \brief Build an empty null statement.
+ /// Build an empty null statement.
explicit NullStmt(EmptyShell Empty) : Stmt(NullStmtClass, Empty) {}
SourceLocation getSemiLoc() const { return SemiLoc; }
@@ -608,13 +624,13 @@ public:
static CompoundStmt *Create(const ASTContext &C, ArrayRef<Stmt *> Stmts,
SourceLocation LB, SourceLocation RB);
- // \brief Build an empty compound statement with a location.
+ // Build an empty compound statement with a location.
explicit CompoundStmt(SourceLocation Loc)
: Stmt(CompoundStmtClass), LBraceLoc(Loc), RBraceLoc(Loc) {
CompoundStmtBits.NumStmts = 0;
}
- // \brief Build an empty compound statement.
+ // Build an empty compound statement.
static CompoundStmt *CreateEmpty(const ASTContext &C, unsigned NumStmts);
bool body_empty() const { return CompoundStmtBits.NumStmts == 0; }
@@ -627,6 +643,7 @@ public:
body_iterator body_begin() { return getTrailingObjects<Stmt *>(); }
body_iterator body_end() { return body_begin() + size(); }
Stmt *body_front() { return !body_empty() ? body_begin()[0] : nullptr; }
+
Stmt *body_back() {
return !body_empty() ? body_begin()[size() - 1] : nullptr;
}
@@ -646,6 +663,7 @@ public:
const_body_iterator body_begin() const {
return getTrailingObjects<Stmt *>();
}
+
const_body_iterator body_end() const { return body_begin() + size(); }
const Stmt *body_front() const {
@@ -751,7 +769,7 @@ public:
EllipsisLoc = ellipsisLoc;
}
- /// \brief Build an empty switch case statement.
+ /// Build an empty switch case statement.
explicit CaseStmt(EmptyShell Empty) : SwitchCase(CaseStmtClass, Empty) {}
SourceLocation getCaseLoc() const { return KeywordLoc; }
@@ -784,7 +802,7 @@ public:
SourceLocation getLocEnd() const LLVM_READONLY {
// Handle deeply nested case statements with iteration instead of recursion.
const CaseStmt *CS = this;
- while (const CaseStmt *CS2 = dyn_cast<CaseStmt>(CS->getSubStmt()))
+ while (const auto *CS2 = dyn_cast<CaseStmt>(CS->getSubStmt()))
CS = CS2;
return CS->getSubStmt()->getLocEnd();
@@ -807,7 +825,7 @@ public:
DefaultStmt(SourceLocation DL, SourceLocation CL, Stmt *substmt) :
SwitchCase(DefaultStmtClass, DL, CL), SubStmt(substmt) {}
- /// \brief Build an empty default statement.
+ /// Build an empty default statement.
explicit DefaultStmt(EmptyShell Empty)
: SwitchCase(DefaultStmtClass, Empty) {}
@@ -832,7 +850,7 @@ public:
};
inline SourceLocation SwitchCase::getLocEnd() const {
- if (const CaseStmt *CS = dyn_cast<CaseStmt>(this))
+ if (const auto *CS = dyn_cast<CaseStmt>(this))
return CS->getLocEnd();
return cast<DefaultStmt>(this)->getLocEnd();
}
@@ -852,7 +870,7 @@ public:
"LabelStmt too big");
}
- // \brief Build an empty label statement.
+ // Build an empty label statement.
explicit LabelStmt(EmptyShell Empty) : Stmt(LabelStmtClass, Empty) {}
SourceLocation getIdentLoc() const { return IdentLoc; }
@@ -874,7 +892,7 @@ public:
}
};
-/// \brief Represents an attribute applied to a statement.
+/// Represents an attribute applied to a statement.
///
/// Represents an attribute applied to a statement. For example:
/// [[omp::for(...)]] for (...) { ... }
@@ -895,7 +913,7 @@ class AttributedStmt final
}
explicit AttributedStmt(EmptyShell Empty, unsigned NumAttrs)
- : Stmt(AttributedStmtClass, Empty), NumAttrs(NumAttrs) {
+ : Stmt(AttributedStmtClass, Empty), NumAttrs(NumAttrs) {
std::fill_n(getAttrArrayPtr(), NumAttrs, nullptr);
}
@@ -908,7 +926,7 @@ public:
static AttributedStmt *Create(const ASTContext &C, SourceLocation Loc,
ArrayRef<const Attr*> Attrs, Stmt *SubStmt);
- // \brief Build an empty attributed statement.
+ // Build an empty attributed statement.
static AttributedStmt *CreateEmpty(const ASTContext &C, unsigned NumAttrs);
SourceLocation getAttrLoc() const { return AttrLoc; }
@@ -943,10 +961,10 @@ public:
Stmt *then, SourceLocation EL = SourceLocation(),
Stmt *elsev = nullptr);
- /// \brief Build an empty if/then/else statement
+ /// Build an empty if/then/else statement
explicit IfStmt(EmptyShell Empty) : Stmt(IfStmtClass, Empty) {}
- /// \brief Retrieve the variable declared in this "if" statement, if any.
+ /// Retrieve the variable declared in this "if" statement, if any.
///
/// In the following example, "x" is the condition variable.
/// \code
@@ -1022,10 +1040,10 @@ class SwitchStmt : public Stmt {
public:
SwitchStmt(const ASTContext &C, Stmt *Init, VarDecl *Var, Expr *cond);
- /// \brief Build a empty switch statement.
+ /// Build a empty switch statement.
explicit SwitchStmt(EmptyShell Empty) : Stmt(SwitchStmtClass, Empty) {}
- /// \brief Retrieve the variable declared in this "switch" statement, if any.
+ /// Retrieve the variable declared in this "switch" statement, if any.
///
/// In the following example, "x" is the condition variable.
/// \code
@@ -1056,7 +1074,7 @@ public:
void setBody(Stmt *S) { SubExprs[BODY] = S; }
SwitchCase *getSwitchCaseList() { return FirstCase.getPointer(); }
- /// \brief Set the case list for this switch statement.
+ /// Set the case list for this switch statement.
void setSwitchCaseList(SwitchCase *SC) { FirstCase.setPointer(SC); }
SourceLocation getSwitchLoc() const { return SwitchLoc; }
@@ -1108,10 +1126,10 @@ public:
WhileStmt(const ASTContext &C, VarDecl *Var, Expr *cond, Stmt *body,
SourceLocation WL);
- /// \brief Build an empty while statement.
+ /// Build an empty while statement.
explicit WhileStmt(EmptyShell Empty) : Stmt(WhileStmtClass, Empty) {}
- /// \brief Retrieve the variable declared in this "while" statement, if any.
+ /// Retrieve the variable declared in this "while" statement, if any.
///
/// In the following example, "x" is the condition variable.
/// \code
@@ -1170,7 +1188,7 @@ public:
SubExprs[BODY] = body;
}
- /// \brief Build an empty do-while statement.
+ /// Build an empty do-while statement.
explicit DoStmt(EmptyShell Empty) : Stmt(DoStmtClass, Empty) {}
Expr *getCond() { return reinterpret_cast<Expr*>(SubExprs[COND]); }
@@ -1215,12 +1233,12 @@ public:
Expr *Inc, Stmt *Body, SourceLocation FL, SourceLocation LP,
SourceLocation RP);
- /// \brief Build an empty for statement.
+ /// Build an empty for statement.
explicit ForStmt(EmptyShell Empty) : Stmt(ForStmtClass, Empty) {}
Stmt *getInit() { return SubExprs[INIT]; }
- /// \brief Retrieve the variable declared in this "for" statement, if any.
+ /// Retrieve the variable declared in this "for" statement, if any.
///
/// In the following example, "y" is the condition variable.
/// \code
@@ -1284,7 +1302,7 @@ public:
GotoStmt(LabelDecl *label, SourceLocation GL, SourceLocation LL)
: Stmt(GotoStmtClass), Label(label), GotoLoc(GL), LabelLoc(LL) {}
- /// \brief Build an empty goto statement.
+ /// Build an empty goto statement.
explicit GotoStmt(EmptyShell Empty) : Stmt(GotoStmtClass, Empty) {}
LabelDecl *getLabel() const { return Label; }
@@ -1320,7 +1338,7 @@ public:
: Stmt(IndirectGotoStmtClass), GotoLoc(gotoLoc), StarLoc(starLoc),
Target((Stmt*)target) {}
- /// \brief Build an empty indirect goto statement.
+ /// Build an empty indirect goto statement.
explicit IndirectGotoStmt(EmptyShell Empty)
: Stmt(IndirectGotoStmtClass, Empty) {}
@@ -1358,7 +1376,7 @@ class ContinueStmt : public Stmt {
public:
ContinueStmt(SourceLocation CL) : Stmt(ContinueStmtClass), ContinueLoc(CL) {}
- /// \brief Build an empty continue statement.
+ /// Build an empty continue statement.
explicit ContinueStmt(EmptyShell Empty) : Stmt(ContinueStmtClass, Empty) {}
SourceLocation getContinueLoc() const { return ContinueLoc; }
@@ -1387,7 +1405,7 @@ public:
"BreakStmt too large");
}
- /// \brief Build an empty break statement.
+ /// Build an empty break statement.
explicit BreakStmt(EmptyShell Empty) : Stmt(BreakStmtClass, Empty) {}
SourceLocation getBreakLoc() const { return BreakLoc; }
@@ -1426,7 +1444,7 @@ public:
: Stmt(ReturnStmtClass), RetLoc(RL), RetExpr((Stmt *)E),
NRVOCandidate(NRVOCandidate) {}
- /// \brief Build an empty return expression.
+ /// Build an empty return expression.
explicit ReturnStmt(EmptyShell Empty) : Stmt(ReturnStmtClass, Empty) {}
const Expr *getRetValue() const;
@@ -1436,7 +1454,7 @@ public:
SourceLocation getReturnLoc() const { return RetLoc; }
void setReturnLoc(SourceLocation L) { RetLoc = L; }
- /// \brief Retrieve the variable that might be used for the named return
+ /// Retrieve the variable that might be used for the named return
/// value optimization.
///
/// The optimization itself can only be performed if the variable is
@@ -1468,11 +1486,11 @@ protected:
SourceLocation AsmLoc;
- /// \brief True if the assembly statement does not have any input or output
+ /// True if the assembly statement does not have any input or output
/// operands.
bool IsSimple;
- /// \brief If true, treat this inline assembly as having side effects.
+ /// If true, treat this inline assembly as having side effects.
/// This assembly statement should not be optimized, deleted or moved.
bool IsVolatile;
@@ -1489,7 +1507,7 @@ protected:
NumClobbers(numclobbers) {}
public:
- /// \brief Build an empty inline-assembly statement.
+ /// Build an empty inline-assembly statement.
explicit AsmStmt(StmtClass SC, EmptyShell Empty) : Stmt(SC, Empty) {}
SourceLocation getAsmLoc() const { return AsmLoc; }
@@ -1501,8 +1519,8 @@ public:
bool isVolatile() const { return IsVolatile; }
void setVolatile(bool V) { IsVolatile = V; }
- SourceLocation getLocStart() const LLVM_READONLY { return SourceLocation(); }
- SourceLocation getLocEnd() const LLVM_READONLY { return SourceLocation(); }
+ SourceLocation getLocStart() const LLVM_READONLY { return {}; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return {}; }
//===--- Asm String Analysis ---===//
@@ -1635,7 +1653,7 @@ public:
StringLiteral *asmstr, unsigned numclobbers,
StringLiteral **clobbers, SourceLocation rparenloc);
- /// \brief Build an empty inline-assembly statement.
+ /// Build an empty inline-assembly statement.
explicit GCCAsmStmt(EmptyShell Empty) : AsmStmt(GCCAsmStmtClass, Empty) {}
SourceLocation getRParenLoc() const { return RParenLoc; }
@@ -1675,9 +1693,7 @@ public:
bool isString() const { return MyKind == String; }
bool isOperand() const { return MyKind == Operand; }
- const std::string &getString() const {
- return Str;
- }
+ const std::string &getString() const { return Str; }
unsigned getOperandNo() const {
assert(isOperand());
@@ -1707,15 +1723,13 @@ public:
//===--- Output operands ---===//
- IdentifierInfo *getOutputIdentifier(unsigned i) const {
- return Names[i];
- }
+ IdentifierInfo *getOutputIdentifier(unsigned i) const { return Names[i]; }
StringRef getOutputName(unsigned i) const {
if (IdentifierInfo *II = getOutputIdentifier(i))
return II->getName();
- return StringRef();
+ return {};
}
StringRef getOutputConstraint(unsigned i) const;
@@ -1743,7 +1757,7 @@ public:
if (IdentifierInfo *II = getInputIdentifier(i))
return II->getName();
- return StringRef();
+ return {};
}
StringRef getInputConstraint(unsigned i) const;
@@ -1816,7 +1830,7 @@ public:
ArrayRef<Expr*> exprs, StringRef asmstr,
ArrayRef<StringRef> clobbers, SourceLocation endloc);
- /// \brief Build an empty MS-style inline-assembly statement.
+ /// Build an empty MS-style inline-assembly statement.
explicit MSAsmStmt(EmptyShell Empty) : AsmStmt(MSAsmStmtClass, Empty) {}
SourceLocation getLBraceLoc() const { return LBraceLoc; }
@@ -1930,7 +1944,7 @@ public:
}
child_range children() {
- return child_range(Children,Children+2);
+ return child_range(Children, Children+2);
}
static bool classof(const Stmt *T) {
@@ -2011,7 +2025,7 @@ public:
SEHFinallyStmt *getFinallyHandler() const;
child_range children() {
- return child_range(Children,Children+2);
+ return child_range(Children, Children+2);
}
static bool classof(const Stmt *T) {
@@ -2027,7 +2041,7 @@ public:
explicit SEHLeaveStmt(SourceLocation LL)
: Stmt(SEHLeaveStmtClass), LeaveLoc(LL) {}
- /// \brief Build an empty __leave statement.
+ /// Build an empty __leave statement.
explicit SEHLeaveStmt(EmptyShell Empty) : Stmt(SEHLeaveStmtClass, Empty) {}
SourceLocation getLeaveLoc() const { return LeaveLoc; }
@@ -2046,7 +2060,7 @@ public:
}
};
-/// \brief This captures a statement into a function. For example, the following
+/// This captures a statement into a function. For example, the following
/// pragma annotated compound statement can be represented as a CapturedStmt,
/// and this compound statement is the body of an anonymous outlined function.
/// @code
@@ -2057,7 +2071,7 @@ public:
/// @endcode
class CapturedStmt : public Stmt {
public:
- /// \brief The different capture forms: by 'this', by reference, capture for
+ /// The different capture forms: by 'this', by reference, capture for
/// variable-length array type etc.
enum VariableCaptureKind {
VCK_This,
@@ -2066,7 +2080,7 @@ public:
VCK_VLAType,
};
- /// \brief Describes the capture of either a variable, or 'this', or
+ /// Describes the capture of either a variable, or 'this', or
/// variable-length array type.
class Capture {
llvm::PointerIntPair<VarDecl *, 2, VariableCaptureKind> VarAndKind;
@@ -2075,7 +2089,7 @@ public:
public:
friend class ASTStmtReader;
- /// \brief Create a new capture.
+ /// Create a new capture.
///
/// \param Loc The source location associated with this capture.
///
@@ -2085,52 +2099,52 @@ public:
Capture(SourceLocation Loc, VariableCaptureKind Kind,
VarDecl *Var = nullptr);
- /// \brief Determine the kind of capture.
+ /// Determine the kind of capture.
VariableCaptureKind getCaptureKind() const;
- /// \brief Retrieve the source location at which the variable or 'this' was
+ /// Retrieve the source location at which the variable or 'this' was
/// first used.
SourceLocation getLocation() const { return Loc; }
- /// \brief Determine whether this capture handles the C++ 'this' pointer.
+ /// Determine whether this capture handles the C++ 'this' pointer.
bool capturesThis() const { return getCaptureKind() == VCK_This; }
- /// \brief Determine whether this capture handles a variable (by reference).
+ /// Determine whether this capture handles a variable (by reference).
bool capturesVariable() const { return getCaptureKind() == VCK_ByRef; }
- /// \brief Determine whether this capture handles a variable by copy.
+ /// Determine whether this capture handles a variable by copy.
bool capturesVariableByCopy() const {
return getCaptureKind() == VCK_ByCopy;
}
- /// \brief Determine whether this capture handles a variable-length array
+ /// Determine whether this capture handles a variable-length array
/// type.
bool capturesVariableArrayType() const {
return getCaptureKind() == VCK_VLAType;
}
- /// \brief Retrieve the declaration of the variable being captured.
+ /// Retrieve the declaration of the variable being captured.
///
/// This operation is only valid if this capture captures a variable.
VarDecl *getCapturedVar() const;
};
private:
- /// \brief The number of variable captured, including 'this'.
+ /// The number of variable captured, including 'this'.
unsigned NumCaptures;
- /// \brief The pointer part is the implicit the outlined function and the
+ /// The pointer part is the implicit the outlined function and the
/// int part is the captured region kind, 'CR_Default' etc.
- llvm::PointerIntPair<CapturedDecl *, 1, CapturedRegionKind> CapDeclAndKind;
+ llvm::PointerIntPair<CapturedDecl *, 2, CapturedRegionKind> CapDeclAndKind;
- /// \brief The record for captured variables, a RecordDecl or CXXRecordDecl.
+ /// The record for captured variables, a RecordDecl or CXXRecordDecl.
RecordDecl *TheRecordDecl = nullptr;
- /// \brief Construct a captured statement.
+ /// Construct a captured statement.
CapturedStmt(Stmt *S, CapturedRegionKind Kind, ArrayRef<Capture> Captures,
ArrayRef<Expr *> CaptureInits, CapturedDecl *CD, RecordDecl *RD);
- /// \brief Construct an empty captured statement.
+ /// Construct an empty captured statement.
CapturedStmt(EmptyShell Empty, unsigned NumCaptures);
Stmt **getStoredStmts() { return reinterpret_cast<Stmt **>(this + 1); }
@@ -2155,36 +2169,36 @@ public:
static CapturedStmt *CreateDeserialized(const ASTContext &Context,
unsigned NumCaptures);
- /// \brief Retrieve the statement being captured.
+ /// Retrieve the statement being captured.
Stmt *getCapturedStmt() { return getStoredStmts()[NumCaptures]; }
const Stmt *getCapturedStmt() const { return getStoredStmts()[NumCaptures]; }
- /// \brief Retrieve the outlined function declaration.
+ /// Retrieve the outlined function declaration.
CapturedDecl *getCapturedDecl();
const CapturedDecl *getCapturedDecl() const;
- /// \brief Set the outlined function declaration.
+ /// Set the outlined function declaration.
void setCapturedDecl(CapturedDecl *D);
- /// \brief Retrieve the captured region kind.
+ /// Retrieve the captured region kind.
CapturedRegionKind getCapturedRegionKind() const;
- /// \brief Set the captured region kind.
+ /// Set the captured region kind.
void setCapturedRegionKind(CapturedRegionKind Kind);
- /// \brief Retrieve the record declaration for captured variables.
+ /// Retrieve the record declaration for captured variables.
const RecordDecl *getCapturedRecordDecl() const { return TheRecordDecl; }
- /// \brief Set the record declaration for captured variables.
+ /// Set the record declaration for captured variables.
void setCapturedRecordDecl(RecordDecl *D) {
assert(D && "null RecordDecl");
TheRecordDecl = D;
}
- /// \brief True if this variable has been captured.
+ /// True if this variable has been captured.
bool capturesVariable(const VarDecl *Var) const;
- /// \brief An iterator that walks over the captures.
+ /// An iterator that walks over the captures.
using capture_iterator = Capture *;
using const_capture_iterator = const Capture *;
using capture_range = llvm::iterator_range<capture_iterator>;
@@ -2197,24 +2211,24 @@ public:
return capture_const_range(capture_begin(), capture_end());
}
- /// \brief Retrieve an iterator pointing to the first capture.
+ /// Retrieve an iterator pointing to the first capture.
capture_iterator capture_begin() { return getStoredCaptures(); }
const_capture_iterator capture_begin() const { return getStoredCaptures(); }
- /// \brief Retrieve an iterator pointing past the end of the sequence of
+ /// Retrieve an iterator pointing past the end of the sequence of
/// captures.
capture_iterator capture_end() const {
return getStoredCaptures() + NumCaptures;
}
- /// \brief Retrieve the number of captures, including 'this'.
+ /// Retrieve the number of captures, including 'this'.
unsigned capture_size() const { return NumCaptures; }
- /// \brief Iterator that walks over the capture initialization arguments.
+ /// Iterator that walks over the capture initialization arguments.
using capture_init_iterator = Expr **;
using capture_init_range = llvm::iterator_range<capture_init_iterator>;
- /// \brief Const iterator that walks over the capture initialization
+ /// Const iterator that walks over the capture initialization
/// arguments.
using const_capture_init_iterator = Expr *const *;
using const_capture_init_range =
@@ -2228,7 +2242,7 @@ public:
return const_capture_init_range(capture_init_begin(), capture_init_end());
}
- /// \brief Retrieve the first initialization argument.
+ /// Retrieve the first initialization argument.
capture_init_iterator capture_init_begin() {
return reinterpret_cast<Expr **>(getStoredStmts());
}
@@ -2237,7 +2251,7 @@ public:
return reinterpret_cast<Expr *const *>(getStoredStmts());
}
- /// \brief Retrieve the iterator pointing one past the last initialization
+ /// Retrieve the iterator pointing one past the last initialization
/// argument.
capture_init_iterator capture_init_end() {
return capture_init_begin() + NumCaptures;