include a specific variable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133102
91177308-0d34-0410-b5e6-
96231b3b80d8
bool capturesCXXThis() const { return CapturesCXXThis; }
+ bool capturesVariable(const VarDecl *var) const;
+
void setCaptures(ASTContext &Context,
const Capture *begin,
const Capture *end,
Captures = static_cast<Capture*>(buffer);
}
+bool BlockDecl::capturesVariable(const VarDecl *variable) const {
+ for (capture_const_iterator
+ i = capture_begin(), e = capture_end(); i != e; ++i)
+ // Only auto vars can be captured, so no redeclaration worries.
+ if (i->getVariable() == variable)
+ return true;
+
+ return false;
+}
+
SourceRange BlockDecl::getSourceRange() const {
return SourceRange(getLocation(), Body? Body->getLocEnd() : getLocation());
}