[Lldb-commits] [lldb] f2a1320 - [lldb] De-virtualize applicable functions in ValueObject (NFC)

Dave Lee via lldb-commits lldb-commits at lists.llvm.org
Fri Jun 16 11:12:42 PDT 2023


Author: Dave Lee
Date: 2023-06-16T11:12:15-07:00
New Revision: f2a1320c2ff5be9b3280eb926d3f10dc86f56d7f

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

LOG: [lldb] De-virtualize applicable functions in ValueObject (NFC)

Remove `virtual` from `ValueObject` functions that aren't overridden.

One such function, `IsArrayItemForPointer`, is not called and so is instead deleted.

Differential Revision: https://reviews.llvm.org/D153088

Added: 
    

Modified: 
    lldb/include/lldb/Core/ValueObject.h

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/Core/ValueObject.h b/lldb/include/lldb/Core/ValueObject.h
index 2edd1e019d922..2f2b212e238ca 100644
--- a/lldb/include/lldb/Core/ValueObject.h
+++ b/lldb/include/lldb/Core/ValueObject.h
@@ -370,26 +370,26 @@ class ValueObject {
     return GetCompilerType().GetTypeName();
   }
 
-  virtual lldb::LanguageType GetObjectRuntimeLanguage() {
+  lldb::LanguageType GetObjectRuntimeLanguage() {
     return GetCompilerType().GetMinimumLanguage();
   }
 
-  virtual uint32_t
+  uint32_t
   GetTypeInfo(CompilerType *pointee_or_element_compiler_type = nullptr) {
     return GetCompilerType().GetTypeInfo(pointee_or_element_compiler_type);
   }
 
-  virtual bool IsPointerType() { return GetCompilerType().IsPointerType(); }
+  bool IsPointerType() { return GetCompilerType().IsPointerType(); }
 
-  virtual bool IsArrayType() { return GetCompilerType().IsArrayType(); }
+  bool IsArrayType() { return GetCompilerType().IsArrayType(); }
 
-  virtual bool IsScalarType() { return GetCompilerType().IsScalarType(); }
+  bool IsScalarType() { return GetCompilerType().IsScalarType(); }
 
-  virtual bool IsPointerOrReferenceType() {
+  bool IsPointerOrReferenceType() {
     return GetCompilerType().IsPointerOrReferenceType();
   }
 
-  virtual bool IsPossibleDynamicType();
+  bool IsPossibleDynamicType();
 
   bool IsNilReference();
 
@@ -429,10 +429,6 @@ class ValueObject {
     return (GetBitfieldBitSize() != 0) || (GetBitfieldBitOffset() != 0);
   }
 
-  virtual bool IsArrayItemForPointer() {
-    return m_flags.m_is_array_item_for_pointer;
-  }
-
   virtual const char *GetValueAsCString();
 
   virtual bool GetValueAsCString(const lldb_private::TypeFormatImpl &format,
@@ -628,7 +624,7 @@ class ValueObject {
 
   // The backing bits of this value object were updated, clear any descriptive
   // string, so we know we have to refetch them.
-  virtual void ValueUpdated() {
+  void ValueUpdated() {
     ClearUserVisibleData(eClearUserVisibleDataItemsValue |
                          eClearUserVisibleDataItemsSummary |
                          eClearUserVisibleDataItemsDescription);


        


More information about the lldb-commits mailing list