This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Refactor and rename CPlusPlusLanguage::FindAlternateFunctionManglings
ClosedPublic

Authored by bulbazord on Sep 14 2021, 1:53 PM.

Details

Summary

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.

Diff Detail

Event Timeline

bulbazord requested review of this revision.Sep 14 2021, 1:53 PM
bulbazord created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptSep 14 2021, 1:53 PM
clayborg accepted this revision.Sep 15 2021, 4:19 PM
clayborg added inline comments.
lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h
130–131

Do we need to be using a std::set? Do we need this to be an ordered result? I would think a std::vector would be better no?

This revision is now accepted and ready to land.Sep 15 2021, 4:19 PM
bulbazord added inline comments.Sep 15 2021, 4:31 PM
lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h
130–131

I'm not sure why it was a std::set to begin with but I don't see any reason why it can't be a std::vector instead. I'll update this before I land it.

This revision was landed with ongoing or failed builds.Sep 16 2021, 1:31 PM
This revision was automatically updated to reflect the committed changes.