diff options
author | Reid Kleckner <rnk@google.com> | 2018-03-07 22:48:35 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2018-03-07 22:48:35 +0000 |
commit | 04f9bcaa6d3b991266a74360ea1716cfb14e38ea (patch) | |
tree | 99218c0df38d07778837f9ffb93d01beee9fd194 /clang/lib/Sema/SemaExpr.cpp | |
parent | 586f40cf4f7f0430b19577835dcc8373fd4bb9ec (diff) | |
download | bcm5719-llvm-04f9bcaa6d3b991266a74360ea1716cfb14e38ea.tar.gz bcm5719-llvm-04f9bcaa6d3b991266a74360ea1716cfb14e38ea.zip |
Avoid including ScopeInfo.h from Sema.h
Summary:
This provides no measurable build speedup, but it reinstates an
optimization from r112038 that was lost in r179618. It requires moving
CapturedScopeInfo::Capture out to clang::sema, which might be too
general since we have plenty of other Capture records in BlockDecl and
other AST nodes.
Reviewers: rjmccall
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D44221
llvm-svn: 326957
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 8c22c0e6435..95b56a242a6 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -1679,9 +1679,9 @@ Sema::BuildDeclRefExpr(ValueDecl *D, QualType Ty, ExprValueKind VK, MarkDeclRefReferenced(E); if (getLangOpts().ObjCWeak && isa<VarDecl>(D) && - Ty.getObjCLifetime() == Qualifiers::OCL_Weak && + Ty.getObjCLifetime() == Qualifiers::OCL_Weak && !isUnevaluatedContext() && !Diags.isIgnored(diag::warn_arc_repeated_use_of_weak, E->getLocStart())) - recordUseOfEvaluatedWeak(E); + getCurFunction()->recordUseOfWeak(E); FieldDecl *FD = dyn_cast<FieldDecl>(D); if (IndirectFieldDecl *IFD = dyn_cast<IndirectFieldDecl>(D)) @@ -2431,8 +2431,9 @@ Sema::LookupInObjCMethod(LookupResult &Lookup, Scope *S, IV->getLocation(), SelfExpr.get(), true, true); if (IV->getType().getObjCLifetime() == Qualifiers::OCL_Weak) { - if (!Diags.isIgnored(diag::warn_arc_repeated_use_of_weak, Loc)) - recordUseOfEvaluatedWeak(Result); + if (!isUnevaluatedContext() && + !Diags.isIgnored(diag::warn_arc_repeated_use_of_weak, Loc)) + getCurFunction()->recordUseOfWeak(Result); } if (getLangOpts().ObjCAutoRefCount) { if (CurContext->isClosure()) @@ -13045,7 +13046,7 @@ ExprResult Sema::ActOnBlockStmtExpr(SourceLocation CaretLoc, // Set the captured variables on the block. // FIXME: Share capture structure between BlockDecl and CapturingScopeInfo! SmallVector<BlockDecl::Capture, 4> Captures; - for (CapturingScopeInfo::Capture &Cap : BSI->Captures) { + for (Capture &Cap : BSI->Captures) { if (Cap.isThisCapture()) continue; BlockDecl::Capture NewCap(Cap.getVariable(), Cap.isBlockCapture(), @@ -14144,7 +14145,7 @@ static bool isVariableAlreadyCapturedInScopeInfo(CapturingScopeInfo *CSI, VarDec // Similarly to mutable captures in lambda, all the OpenMP captures by copy // are mutable in the sense that user can change their value - they are // private instances of the captured declarations. - const CapturingScopeInfo::Capture &Cap = CSI->getCapture(Var); + const Capture &Cap = CSI->getCapture(Var); if (Cap.isCopyCapture() && !(isa<LambdaScopeInfo>(CSI) && cast<LambdaScopeInfo>(CSI)->Mutable) && !(isa<CapturedRegionScopeInfo>(CSI) && |