[Lldb-commits] [PATCH] D105215: [lldb] Remove CPlusPlusLanguage from Mangled

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jul 26 16:52:43 PDT 2021


clayborg added inline comments.


================
Comment at: lldb/source/Core/Mangled.cpp:322
   if (preference == ePreferDemangledWithoutArguments) {
-    return GetDemangledNameWithoutArguments(m_mangled, demangled);
+    if (Language *lang = Language::FindPlugin(GuessLanguage())) {
+      return lang->GetDemangledFunctionNameWithoutArguments(*this);
----------------
Maybe we should make a Language::FindPlugin(...) that like:
```
Language *Language::FindPlugin(Mangled::ManglingScheme mangling_scheme);
```
Should be easy to add since this change is kind of about refactoring and putting the code into plug-ins. It is essentially what "lldb::LanguageType Mangled::GuessLanguage() const" is doing. That code could be moved to where Language::FindPlugin(...) lives.


================
Comment at: lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp:67
 
+ConstString CPlusPlusLanguage::GetDemangledFunctionNameWithoutArguments(
+    Mangled mangled) const {
----------------
We are doing the work over and over here. Who calls this? Is this something we should think about caching? It would be easy to make a map of ConstString (demangled name) to ConstString (result of this function call) and we can possibly improve the efficiency of this. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105215/new/

https://reviews.llvm.org/D105215



More information about the lldb-commits mailing list