diff options
author | Bruno Ricci <riccibrun@gmail.com> | 2020-07-28 15:49:05 +0100 |
---|---|---|
committer | Bruno Ricci <riccibrun@gmail.com> | 2020-07-29 14:55:15 +0100 |
commit | 1ae63b4179c222431cd6a4b2397abceaa5bc3d30 (patch) | |
tree | bcd3af57e1d010363dd044a38012843c023e241f /clang/lib/Sema/SemaLambda.cpp | |
parent | ad793ed90370f0e99fa7ae0cc4d4e97081b5561a (diff) | |
download | llvm-1ae63b4179c222431cd6a4b2397abceaa5bc3d30.zip llvm-1ae63b4179c222431cd6a4b2397abceaa5bc3d30.tar.gz llvm-1ae63b4179c222431cd6a4b2397abceaa5bc3d30.tar.bz2 |
[clang][NFC] Pass the ASTContext to CXXRecordDecl::setCaptures
In general Decl::getASTContext() is relatively expensive and here the changes
are non-invasive. NFC.
Diffstat (limited to 'clang/lib/Sema/SemaLambda.cpp')
-rw-r--r-- | clang/lib/Sema/SemaLambda.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaLambda.cpp b/clang/lib/Sema/SemaLambda.cpp index dc74f6e..c9f2854 100644 --- a/clang/lib/Sema/SemaLambda.cpp +++ b/clang/lib/Sema/SemaLambda.cpp @@ -1624,8 +1624,9 @@ FieldDecl *Sema::BuildCaptureField(RecordDecl *RD, // Build the non-static data member. FieldDecl *Field = - FieldDecl::Create(Context, RD, Loc, Loc, nullptr, FieldType, TSI, nullptr, - false, ICIS_NoInit); + FieldDecl::Create(Context, RD, /*StartLoc=*/Loc, /*IdLoc=*/Loc, + /*Id=*/nullptr, FieldType, TSI, /*BW=*/nullptr, + /*Mutable=*/false, ICIS_NoInit); // If the variable being captured has an invalid type, mark the class as // invalid as well. if (!FieldType->isDependentType()) { @@ -1785,7 +1786,7 @@ ExprResult Sema::BuildLambdaExpr(SourceLocation StartLoc, SourceLocation EndLoc, CUDACheckLambdaCapture(CallOperator, From); } - Class->setCaptures(Captures); + Class->setCaptures(Context, Captures); // C++11 [expr.prim.lambda]p6: // The closure type for a lambda-expression with no lambda-capture |