[Lldb-commits] [lldb] 4617fb0 - [lldb] Move implementation of GetDisplayName to TypeSystem class

Raphael Isemann via lldb-commits lldb-commits at lists.llvm.org
Wed Feb 12 00:32:45 PST 2020


Author: Raphael Isemann
Date: 2020-02-12T09:32:09+01:00
New Revision: 4617fb0b7fd444dca9bf7612dd632ef3feb61d48

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

LOG: [lldb] Move implementation of GetDisplayName to TypeSystem class

CompilerType doesn't implement logic.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/Symbol/TypeSystem.h b/lldb/include/lldb/Symbol/TypeSystem.h
index 811b99028f63..188b276b7c48 100644
--- a/lldb/include/lldb/Symbol/TypeSystem.h
+++ b/lldb/include/lldb/Symbol/TypeSystem.h
@@ -199,6 +199,8 @@ class TypeSystem : public PluginInterface {
 
   virtual ConstString GetTypeName(lldb::opaque_compiler_type_t type) = 0;
 
+  virtual ConstString GetDisplayTypeName(lldb::opaque_compiler_type_t type) = 0;
+
   virtual uint32_t
   GetTypeInfo(lldb::opaque_compiler_type_t type,
               CompilerType *pointee_or_element_compiler_type) = 0;

diff  --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
index db03595e970b..049975a3547b 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
@@ -586,6 +586,10 @@ class TypeSystemClang : public TypeSystem {
 
   ConstString GetTypeName(lldb::opaque_compiler_type_t type) override;
 
+  ConstString GetDisplayTypeName(lldb::opaque_compiler_type_t type) override {
+    return GetTypeName(type);
+  }
+
   uint32_t GetTypeInfo(lldb::opaque_compiler_type_t type,
                        CompilerType *pointee_or_element_compiler_type) override;
 

diff  --git a/lldb/source/Symbol/CompilerType.cpp b/lldb/source/Symbol/CompilerType.cpp
index a0f38981e2db..ba69b6b9f0c2 100644
--- a/lldb/source/Symbol/CompilerType.cpp
+++ b/lldb/source/Symbol/CompilerType.cpp
@@ -288,7 +288,11 @@ ConstString CompilerType::GetTypeName() const {
   return ConstString("<invalid>");
 }
 
-ConstString CompilerType::GetDisplayTypeName() const { return GetTypeName(); }
+ConstString CompilerType::GetDisplayTypeName() const {
+  if (IsValid())
+    return m_type_system->GetDisplayTypeName(m_type);
+  return ConstString("<invalid>");
+}
 
 uint32_t CompilerType::GetTypeInfo(
     CompilerType *pointee_or_element_compiler_type) const {


        


More information about the lldb-commits mailing list