[lldb] Refactor and rename CPlusPlusLanguage::FindAlternateFunctionManglings
authorAlex Langford <apl@fb.com>
Tue, 14 Sep 2021 20:31:35 +0000 (13:31 -0700)
committerAlex Langford <apl@fb.com>
Thu, 16 Sep 2021 20:13:07 +0000 (13:13 -0700)
commita65f6aafe2d357cd83de62832a2bdae49a2d6749
tree78645303d4c96a1bb196dfcc6fcd4a7f4b9bc93e
parent4c1023b4b7900db3ddeec16e16018c1413ecc3db
[lldb] Refactor and rename CPlusPlusLanguage::FindAlternateFunctionManglings

I have 2 goals with this change:
1. Disambiguate between CPlusPlus::FindAlternateFunctionManglings and
   IRExecutionUnit::FindBestAlternateMangledName. These are named very
   similar things, they try to do very similar things, but their
   approaches are different. This change should make it clear that one
   is generating possible alternate manglings (through some
   heuristics-based approach) and the other is finding alternate
   manglings (through searching the SymbolFile for potential matches).
2. Change GenerateAlternateFunctionManglings from a static method in
   CPlusPlusLanguage to a virtual method in Language. This will allow us
   to remove a direct use of CPlusPlusLanguage in IRExecutionUnit,
   further pushing it to be more general. This change doesn't meet this
   goal completely but allows for it to happen later.

Though this doesn't remove IRExecutionUnit's dependency on
CPlusPlusLanguage, it does bring us closer to that goal.

Differential Revision: https://reviews.llvm.org/D109785
lldb/include/lldb/Target/Language.h
lldb/source/Expression/IRExecutionUnit.cpp
lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h
lldb/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp