summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/ScopeInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/ScopeInfo.cpp')
-rw-r--r--clang/lib/Sema/ScopeInfo.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/clang/lib/Sema/ScopeInfo.cpp b/clang/lib/Sema/ScopeInfo.cpp
index dd309a28118..e84e592a482 100644
--- a/clang/lib/Sema/ScopeInfo.cpp
+++ b/clang/lib/Sema/ScopeInfo.cpp
@@ -112,13 +112,6 @@ FunctionScopeInfo::WeakObjectProfileTy::getBaseInfo(const Expr *E) {
return BaseInfoTy(D, IsExact);
}
-bool CapturingScopeInfo::isVLATypeCaptured(const VariableArrayType *VAT) const {
- for (auto &Cap : Captures)
- if (Cap.isVLATypeCapture() && Cap.getCapturedVLAType() == VAT)
- return true;
- return false;
-}
-
FunctionScopeInfo::WeakObjectProfileTy::WeakObjectProfileTy(
const ObjCPropertyRefExpr *PropE)
: Base(nullptr, true), Property(getBestPropertyDecl(PropE)) {
@@ -223,6 +216,19 @@ void FunctionScopeInfo::markSafeWeakUse(const Expr *E) {
ThisUse->markSafe();
}
+bool Capture::isInitCapture() const {
+ // Note that a nested capture of an init-capture is not itself an
+ // init-capture.
+ return !isNested() && isVariableCapture() && getVariable()->isInitCapture();
+}
+
+bool CapturingScopeInfo::isVLATypeCaptured(const VariableArrayType *VAT) const {
+ for (auto &Cap : Captures)
+ if (Cap.isVLATypeCapture() && Cap.getCapturedVLAType() == VAT)
+ return true;
+ return false;
+}
+
void LambdaScopeInfo::getPotentialVariableCapture(unsigned Idx, VarDecl *&VD,
Expr *&E) const {
assert(Idx < getNumPotentialVariableCaptures() &&
OpenPOWER on IntegriCloud