[Lldb-commits] [lldb] [llvm] [lldb][dwarf] Compute fully qualified names on simplified template names with DWARFTypePrinter (PR #112811)

via lldb-commits lldb-commits at lists.llvm.org
Thu Oct 17 19:34:01 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff e9eec14bb3566f6578950797559de98678f16985 e996ae0076881bc9f660f75baeb9522ff7af49e4 --extensions cpp,h -- lldb/test/Shell/SymbolFile/DWARF/x86/simplified-template-names.cpp lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp lldb/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.h lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.h lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h llvm/include/llvm/DebugInfo/DWARF/DWARFDie.h llvm/include/llvm/DebugInfo/DWARF/DWARFTypePrinter.h llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
index d0d61a8489..fbcbbc666f 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -1619,8 +1619,8 @@ void DWARFASTParserClang::GetUniqueTypeNameAndDeclaration(
     case DW_TAG_union_type: {
       if (const char *class_union_struct_name = parent_decl_ctx_die.GetName()) {
         qualified_name.insert(0, "::");
-        qualified_name.insert(
-            0, GetDIEClassTemplateParams(parent_decl_ctx_die));
+        qualified_name.insert(0,
+                              GetDIEClassTemplateParams(parent_decl_ctx_die));
         qualified_name.insert(0, class_union_struct_name);
       }
       parent_decl_ctx_die = parent_decl_ctx_die.GetParentDeclContextDIE();
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.h
index d9d40a84f3..ca25801137 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.h
@@ -88,9 +88,7 @@ public:
   // Accessing information about a DIE
   dw_tag_t Tag() const;
 
-  dw_tag_t getTag() const {
-    return Tag();
-  }
+  dw_tag_t getTag() const { return Tag(); }
 
   dw_offset_t GetOffset() const;
 
@@ -102,9 +100,7 @@ public:
 
   const char *GetName() const;
 
-  const char *getShortName() const {
-    return GetName();
-  }
+  const char *getShortName() const { return GetName(); }
 
   lldb::ModuleSP GetModule() const;
 
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
index a3960aadb8..bc5d0a9555 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
@@ -576,23 +576,23 @@ std::optional<uint64_t> DWARFFormValue::getAsUnsignedConstant() const {
 }
 
 std::optional<int64_t> DWARFFormValue::getAsSignedConstant() const {
-    if ((!IsDataForm(m_form)) ||
-        (m_form == lldb_private::dwarf::DW_FORM_udata &&
-         uint64_t(std::numeric_limits<int64_t>::max()) < m_value.uval))
-      return std::nullopt;
-    switch (m_form) {
-    case lldb_private::dwarf::DW_FORM_data4:
-      return int32_t(m_value.uval);
-    case lldb_private::dwarf::DW_FORM_data2:
-      return int16_t(m_value.uval);
-    case lldb_private::dwarf::DW_FORM_data1:
-      return int8_t(m_value.uval);
-    case lldb_private::dwarf::DW_FORM_sdata:
-    case lldb_private::dwarf::DW_FORM_data8:
-    default:
-      return m_value.sval;
-    }
+  if ((!IsDataForm(m_form)) ||
+      (m_form == lldb_private::dwarf::DW_FORM_udata &&
+       uint64_t(std::numeric_limits<int64_t>::max()) < m_value.uval))
+    return std::nullopt;
+  switch (m_form) {
+  case lldb_private::dwarf::DW_FORM_data4:
+    return int32_t(m_value.uval);
+  case lldb_private::dwarf::DW_FORM_data2:
+    return int16_t(m_value.uval);
+  case lldb_private::dwarf::DW_FORM_data1:
+    return int8_t(m_value.uval);
+  case lldb_private::dwarf::DW_FORM_sdata:
+  case lldb_private::dwarf::DW_FORM_data8:
+  default:
+    return m_value.sval;
   }
+}
 
 const uint8_t *DWARFFormValue::BlockData() const { return m_value.data; }
 
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
index dd8d653c0f..66fb6e855f 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
@@ -65,9 +65,7 @@ public:
   int64_t Signed() const { return m_value.sval; }
   void SetSigned(int64_t sval) { m_value.sval = sval; }
   const char *AsCString() const;
-  const char* getAsCString() const {
-    return AsCString();
-  }
+  const char *getAsCString() const { return AsCString(); }
   dw_addr_t Address() const;
   bool IsValid() const { return m_form != 0; }
   bool SkipValue(const DWARFDataExtractor &debug_info_data,

``````````

</details>


https://github.com/llvm/llvm-project/pull/112811


More information about the lldb-commits mailing list