[Lldb-commits] [lldb] 00efcd6 - Add a Type::Payload typedef. (NFC)

Adrian Prantl via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 31 14:33:01 PDT 2020


Author: Adrian Prantl
Date: 2020-03-31T14:32:53-07:00
New Revision: 00efcd6fffa533e5a4aa5646e678d57df0f9aca8

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

LOG: Add a Type::Payload typedef. (NFC)

This addresses review feedback from Raphael that I missed before
landing the change that introduced the payload field.

Added: 
    

Modified: 
    lldb/include/lldb/Symbol/Type.h
    lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/Symbol/Type.h b/lldb/include/lldb/Symbol/Type.h
index d18027c7248c..dfff30029168 100644
--- a/lldb/include/lldb/Symbol/Type.h
+++ b/lldb/include/lldb/Symbol/Type.h
@@ -196,10 +196,11 @@ class Type : public std::enable_shared_from_this<Type>, public UserID {
 
   uint32_t GetEncodingMask();
 
+  typedef uint32_t Payload;
   /// Return the language-specific payload.
-  uint32_t GetPayload() { return m_payload; }
+  Payload GetPayload() { return m_payload; }
   /// Return the language-specific payload.
-  void SetPayload(uint32_t opaque_payload) { m_payload = opaque_payload; }
+  void SetPayload(Payload opaque_payload) { m_payload = opaque_payload; }
 
 protected:
   ConstString m_name;
@@ -215,7 +216,7 @@ class Type : public std::enable_shared_from_this<Type>, public UserID {
   CompilerType m_compiler_type;
   ResolveState m_compiler_type_resolve_state;
   /// Language-specific flags.
-  uint32_t m_payload;
+  Payload m_payload;
 
   Type *GetEncodingType();
 

diff  --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
index a609b06d4e13..7be259a85669 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
@@ -56,7 +56,7 @@ class Declaration;
 /// The implementation of lldb::Type's m_payload field for TypeSystemClang.
 class TypePayloadClang {
   /// Layout: bit 31 ... IsCompleteObjCClass.
-  uint32_t m_payload = 0;
+  Type::Payload m_payload = 0;
 public:
   TypePayloadClang() = default;
   explicit TypePayloadClang(bool is_complete_objc_class);


        


More information about the lldb-commits mailing list