[clang] [libcxxabi] [lldb] [llvm] [WIP][lldb] Alternative implementation of more reliable function call infrastructure (PR #115245)

via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 4 04:40:51 PDT 2025


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 HEAD~1 HEAD --extensions h,cpp -- clang/lib/AST/Mangle.cpp clang/lib/Sema/SemaDeclAttr.cpp libcxxabi/src/demangle/ItaniumDemangle.h lldb/source/Expression/IRExecutionUnit.cpp lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp llvm/include/llvm/Demangle/Demangle.h llvm/include/llvm/Demangle/ItaniumDemangle.h llvm/lib/Demangle/ItaniumDemangle.cpp
``````````

</details>

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

``````````diff
diff --git a/lldb/source/Expression/IRExecutionUnit.cpp b/lldb/source/Expression/IRExecutionUnit.cpp
index 1056195b1..f864b0f38 100644
--- a/lldb/source/Expression/IRExecutionUnit.cpp
+++ b/lldb/source/Expression/IRExecutionUnit.cpp
@@ -892,43 +892,44 @@ static std::string FindStructorLinkageName(DWARFDIE die,
   return {};
 }
 
-static lldb::addr_t FindSpecialLinkageName(
-        LoadAddressResolver &resolver,ConstString name, llvm::StringRef symbol) {
+static lldb::addr_t FindSpecialLinkageName(LoadAddressResolver &resolver,
+                                           ConstString name,
+                                           llvm::StringRef symbol) {
   uintptr_t module_ptr;
   if (symbol.consumeInteger(0, module_ptr))
     return LLDB_INVALID_ADDRESS;
-  
+
   if (module_ptr == 0) {
     // TODO: log this case. We should ever be putting a null module pointer
     // here
     return LLDB_INVALID_ADDRESS;
   }
-  
+
   auto *mod = (lldb_private::Module *)module_ptr;
   assert(mod);
   auto *sym = mod->GetSymbolFile();
   assert(sym);
-  
+
   if (!symbol.consume_front(":"))
     return LLDB_INVALID_ADDRESS;
-  
+
   lldb::user_id_t die_id;
   if (symbol.consumeInteger(10, die_id))
     return LLDB_INVALID_ADDRESS;
-  
+
   auto *dwarf = llvm::dyn_cast<plugin::dwarf::SymbolFileDWARF>(sym);
   if (!dwarf)
     return LLDB_INVALID_ADDRESS;
-  
+
   auto die = dwarf->GetDIE(die_id);
   if (!die.IsValid())
     return LLDB_INVALID_ADDRESS;
-  
+
   // TODO: account for MS-ABI (where there are no ctor variants in the
   // mangling)
   if (!symbol.consume_front(":"))
     return LLDB_INVALID_ADDRESS;
-  
+
   auto structor_variant_or_err = MakeStructorVariant(symbol);
   if (!structor_variant_or_err) {
     LLDB_LOG_ERROR(GetLog(LLDBLog::Expressions),
@@ -937,13 +938,12 @@ static lldb::addr_t FindSpecialLinkageName(
                    name.GetStringRef());
     return LLDB_INVALID_ADDRESS;
   }
-  
-  ConstString mangled(
-      FindStructorLinkageName(die, *structor_variant_or_err));
-  
-  Module::LookupInfo lookup_info(
-      mangled, lldb::FunctionNameType::eFunctionNameTypeAny,
-      lldb::LanguageType::eLanguageTypeC_plus_plus);
+
+  ConstString mangled(FindStructorLinkageName(die, *structor_variant_or_err));
+
+  Module::LookupInfo lookup_info(mangled,
+                                 lldb::FunctionNameType::eFunctionNameTypeAny,
+                                 lldb::LanguageType::eLanguageTypeC_plus_plus);
   SymbolContextList sc_list;
   dwarf->FindFunctions(lookup_info, {}, false, sc_list);
   if (auto load_addr = resolver.Resolve(sc_list))

``````````

</details>


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


More information about the llvm-commits mailing list