[clang] 737d2ac - [clang][Interp][NFC] Make Block::Desc const

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 26 02:50:06 PDT 2023


Author: Timm Bäder
Date: 2023-10-26T11:47:46+02:00
New Revision: 737d2acd6863ca7012a75575c1a52fd807ed44ba

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

LOG: [clang][Interp][NFC] Make Block::Desc const

Added: 
    

Modified: 
    clang/lib/AST/Interp/InterpBlock.h

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Interp/InterpBlock.h b/clang/lib/AST/Interp/InterpBlock.h
index 89f937b588fb678..4ab67ebb9eaafcc 100644
--- a/clang/lib/AST/Interp/InterpBlock.h
+++ b/clang/lib/AST/Interp/InterpBlock.h
@@ -53,7 +53,7 @@ class Block final {
         bool IsStatic = false, bool IsExtern = false)
       : DeclID(DeclID), IsStatic(IsStatic), IsExtern(IsExtern), Desc(Desc) {}
 
-  Block(Descriptor *Desc, bool IsStatic = false, bool IsExtern = false)
+  Block(const Descriptor *Desc, bool IsStatic = false, bool IsExtern = false)
       : DeclID((unsigned)-1), IsStatic(IsStatic), IsExtern(IsExtern),
         Desc(Desc) {}
 
@@ -120,8 +120,8 @@ class Block final {
   friend class DeadBlock;
   friend class InterpState;
 
-  Block(Descriptor *Desc, bool IsExtern, bool IsStatic, bool IsDead)
-    : IsStatic(IsStatic), IsExtern(IsExtern), IsDead(true), Desc(Desc) {}
+  Block(const Descriptor *Desc, bool IsExtern, bool IsStatic, bool IsDead)
+      : IsStatic(IsStatic), IsExtern(IsExtern), IsDead(true), Desc(Desc) {}
 
   /// Deletes a dead block at the end of its lifetime.
   void cleanup();
@@ -149,7 +149,7 @@ class Block final {
   /// via invokeCtor.
   bool IsInitialized = false;
   /// Pointer to the stack slot descriptor.
-  Descriptor *Desc;
+  const Descriptor *Desc;
 };
 
 /// Descriptor for a dead block.


        


More information about the cfe-commits mailing list