[clang] 72a5840 - [clang][bytecode][NFC] Make `Block::rawData()` private (#238407)

via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 3 21:46:19 PST 2026


Author: Timm Baeder
Date: 2026-11-04T06:46:14+01:00
New Revision: 72a5840e9a53448b11876eeef9dbfd6efa04f9a9

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

LOG: [clang][bytecode][NFC] Make `Block::rawData()` private (#238407)

Added: 
    

Modified: 
    clang/lib/AST/ByteCode/Block.h

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/ByteCode/Block.h b/clang/lib/AST/ByteCode/Block.h
index 25514ac126807..5a08b5dee64fe 100644
--- a/clang/lib/AST/ByteCode/Block.h
+++ b/clang/lib/AST/ByteCode/Block.h
@@ -140,15 +140,6 @@ class Block final {
   std::byte *data() { return rawData() + MDSize; }
   const std::byte *data() const { return rawData() + MDSize; }
 
-  /// Returns a pointer to the raw data, including metadata.
-  /// You are allowed to read Desc->getAllocSize() bytes from this address.
-  std::byte *rawData() {
-    return reinterpret_cast<std::byte *>(this) + sizeof(Block);
-  }
-  const std::byte *rawData() const {
-    return reinterpret_cast<const std::byte *>(this) + sizeof(Block);
-  }
-
   template <typename T> const T &deref() const {
     return *reinterpret_cast<const T *>(data());
   }
@@ -221,6 +212,15 @@ class Block final {
   /// For DynamicAllocator.
   void markDead() { Flags = Flags.withDead(); }
 
+  /// Returns a pointer to the raw data, including metadata.
+  /// You are allowed to read Desc->getAllocSize() bytes from this address.
+  std::byte *rawData() {
+    return reinterpret_cast<std::byte *>(this) + sizeof(Block);
+  }
+  const std::byte *rawData() const {
+    return reinterpret_cast<const std::byte *>(this) + sizeof(Block);
+  }
+
   /// Pointer to the stack slot descriptor.
   const Descriptor *const Desc;
   /// Start of the chain of pointers.


        


More information about the cfe-commits mailing list