[clang] c3f1faf - [clang][Interp][NFC] Fix allocateLocalPrimitive parameter name

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Thu May 4 04:45:44 PDT 2023


Author: Timm Bäder
Date: 2023-05-04T13:45:14+02:00
New Revision: c3f1faf96f18ca2162aff96b0adaf4cd22689ad4

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

LOG: [clang][Interp][NFC] Fix allocateLocalPrimitive parameter name

This is passed on to Program::createDescriptor, where it is used as a
value for IsConst.

Added: 
    

Modified: 
    clang/lib/AST/Interp/ByteCodeExprGen.cpp
    clang/lib/AST/Interp/ByteCodeExprGen.h

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Interp/ByteCodeExprGen.cpp b/clang/lib/AST/Interp/ByteCodeExprGen.cpp
index ca9d345c2e86..df7c4a72f21a 100644
--- a/clang/lib/AST/Interp/ByteCodeExprGen.cpp
+++ b/clang/lib/AST/Interp/ByteCodeExprGen.cpp
@@ -831,7 +831,7 @@ bool ByteCodeExprGen<Emitter>::VisitMaterializeTemporaryExpr(
   // For everyhing else, use local variables.
   if (SubExprT) {
     if (std::optional<unsigned> LocalIndex = allocateLocalPrimitive(
-            SubExpr, *SubExprT, /*IsMutable=*/true, /*IsExtended=*/true)) {
+            SubExpr, *SubExprT, /*IsConst=*/true, /*IsExtended=*/true)) {
       if (!this->visitInitializer(SubExpr))
         return false;
       this->emitSetLocal(*SubExprT, *LocalIndex, E);

diff  --git a/clang/lib/AST/Interp/ByteCodeExprGen.h b/clang/lib/AST/Interp/ByteCodeExprGen.h
index a3aab16c4a08..52a8eca593c2 100644
--- a/clang/lib/AST/Interp/ByteCodeExprGen.h
+++ b/clang/lib/AST/Interp/ByteCodeExprGen.h
@@ -185,7 +185,7 @@ class ByteCodeExprGen : public ConstStmtVisitor<ByteCodeExprGen<Emitter>, bool>,
                         llvm::function_ref<bool(const Expr *)> V);
 
   /// Creates a local primitive value.
-  unsigned allocateLocalPrimitive(DeclTy &&Decl, PrimType Ty, bool IsMutable,
+  unsigned allocateLocalPrimitive(DeclTy &&Decl, PrimType Ty, bool IsConst,
                                   bool IsExtended = false);
 
   /// Allocates a space storing a local given its type.


        


More information about the cfe-commits mailing list