[clang] c8e1774 - [Interp] Use llvm::endianness::native (NFC)

Kazu Hirata via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 10 22:26:14 PDT 2023


Author: Kazu Hirata
Date: 2023-10-10T22:26:08-07:00
New Revision: c8e17749757a62cdd5c1dea2cb25f3eaf933cd5d

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

LOG: [Interp] Use llvm::endianness::native (NFC)

This patch replaces endianness::native with llvm::endianness::native.
Note that endianness::native would rely on:

  using endianness = llvm::endianness;

in llvm/include/llvm/Support/Endian.h.

Added: 
    

Modified: 
    clang/lib/AST/Interp/ByteCodeEmitter.cpp
    clang/lib/AST/Interp/Source.h

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Interp/ByteCodeEmitter.cpp b/clang/lib/AST/Interp/ByteCodeEmitter.cpp
index a634ee288f57c99..4989b4ba797f2cf 100644
--- a/clang/lib/AST/Interp/ByteCodeEmitter.cpp
+++ b/clang/lib/AST/Interp/ByteCodeEmitter.cpp
@@ -149,7 +149,7 @@ void ByteCodeEmitter::emitLabel(LabelTy Label) {
       void *Location = Code.data() + Reloc - align(sizeof(int32_t));
       assert(aligned(Location));
       const int32_t Offset = Target - static_cast<int64_t>(Reloc);
-      endian::write<int32_t, endianness::native, 1>(Location, Offset);
+      endian::write<int32_t, llvm::endianness::native, 1>(Location, Offset);
     }
     LabelRelocs.erase(It);
   }

diff  --git a/clang/lib/AST/Interp/Source.h b/clang/lib/AST/Interp/Source.h
index fec950dd544f8a1..70a6b87d031bb85 100644
--- a/clang/lib/AST/Interp/Source.h
+++ b/clang/lib/AST/Interp/Source.h
@@ -55,7 +55,7 @@ class CodePtr final {
   template <typename T> std::enable_if_t<!std::is_pointer<T>::value, T> read() {
     assert(aligned(Ptr));
     using namespace llvm::support;
-    T Value = endian::read<T, endianness::native, 1>(Ptr);
+    T Value = endian::read<T, llvm::endianness::native, 1>(Ptr);
     Ptr += align(sizeof(T));
     return Value;
   }


        


More information about the cfe-commits mailing list