[clang] 0a7ca80 - Fix parameter name in Sema::addInitCapture to ByRef.

Jens Massberg via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 7 09:06:59 PDT 2023


Author: Jens Massberg
Date: 2023-06-07T18:06:19+02:00
New Revision: 0a7ca80360584ff35cb58716e08855a913a3f4d0

URL: https://github.com/llvm/llvm-project/commit/0a7ca80360584ff35cb58716e08855a913a3f4d0
DIFF: https://github.com/llvm/llvm-project/commit/0a7ca80360584ff35cb58716e08855a913a3f4d0.diff

LOG: Fix parameter name in Sema::addInitCapture to ByRef.

Rename parameter in Sema::addInitCapture as proposed in review of Sema::addInitCapture. Sorry, that I have missed the comment there!

Reviewed By: ilya-biryukov

Differential Revision: https://reviews.llvm.org/D139541

Added: 
    

Modified: 
    clang/include/clang/Sema/Sema.h
    clang/lib/Sema/SemaLambda.cpp

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index cf25f39de0d19..a15846952fd01 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -7171,8 +7171,7 @@ class Sema final {
       IdentifierInfo *Id, unsigned InitStyle, Expr *Init, DeclContext *DeclCtx);
 
   /// Add an init-capture to a lambda scope.
-  void addInitCapture(sema::LambdaScopeInfo *LSI, VarDecl *Var,
-                      bool isReferenceType);
+  void addInitCapture(sema::LambdaScopeInfo *LSI, VarDecl *Var, bool ByRef);
 
   /// Note that we have finished the explicit captures for the
   /// given lambda.

diff  --git a/clang/lib/Sema/SemaLambda.cpp b/clang/lib/Sema/SemaLambda.cpp
index 730f70e732579..c1d70ad8b08f9 100644
--- a/clang/lib/Sema/SemaLambda.cpp
+++ b/clang/lib/Sema/SemaLambda.cpp
@@ -798,12 +798,11 @@ VarDecl *Sema::createLambdaInitCaptureVarDecl(
   return NewVD;
 }
 
-void Sema::addInitCapture(LambdaScopeInfo *LSI, VarDecl *Var,
-                          bool isReferenceType) {
+void Sema::addInitCapture(LambdaScopeInfo *LSI, VarDecl *Var, bool ByRef) {
   assert(Var->isInitCapture() && "init capture flag should be set");
-  LSI->addCapture(Var, /*isBlock*/ false, isReferenceType,
-                  /*isNested*/ false, Var->getLocation(), SourceLocation(),
-                  Var->getType(), /*Invalid*/ false);
+  LSI->addCapture(Var, /*isBlock=*/false, ByRef,
+                  /*isNested=*/false, Var->getLocation(), SourceLocation(),
+                  Var->getType(), /*Invalid=*/false);
 }
 
 // Unlike getCurLambda, getCurrentLambdaScopeUnsafe doesn't


        


More information about the cfe-commits mailing list