This is an archive of the discontinued LLVM Phabricator instance.

[lldb] abi_tag support 2/3 - Make FindBestAlternateFunctionMangledName local to the C++ language plugin
AcceptedPublic

Authored by Michael137 on Aug 6 2022, 10:44 AM.

Details

Summary

This patch makes CPlusPlusLanguage::FindBestAlternateFunctionMangledName local
to CPlusPlusLanguage. We do so by creating a new API CollectAlternateFunctionNames.
Both APIs are called only by IRExecutionUnit. However, by having
FindBestAlternateFunctionMangledName local to the C++ plugin we can
change its implementation in C++-specific ways, which we plan to do
in follow-up commits that add Itanium mangle tree API support to
FindBestAlternateFunctionMangledName.

Testing

  • API tests still pass

Diff Detail

Event Timeline

Michael137 created this revision.Aug 6 2022, 10:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 6 2022, 10:44 AM
aprantl added inline comments.Aug 8 2022, 11:41 AM
lldb/include/lldb/Target/Language.h
329

Why not return results? Are we expecting to add more results to an existing vector regularly?

Michael137 updated this revision to Diff 450991.Aug 8 2022, 4:05 PM
  • Reword commit message
Michael137 retitled this revision from [lldb] abi_tag support 2/4 - Make FindBestAlternateFunctionMangledName local to the C++ language plugin to [lldb] abi_tag support 2/3 - Make FindBestAlternateFunctionMangledName local to the C++ language plugin.Aug 8 2022, 4:07 PM
Michael137 added reviewers: labath, jingham.
Michael137 published this revision for review.Aug 8 2022, 4:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 8 2022, 4:09 PM
Michael137 added inline comments.Aug 8 2022, 4:12 PM
lldb/include/lldb/Target/Language.h
329

No reason in particular. Just tried to keep it consistent with the other related APIs. Mainly to cause less confusion for reviewers. If we wanted to return the vector we'd have to at least change IRExecutionUnit::CollectCandidateCPlusPlusNames also.

JDevlieghere added inline comments.Aug 8 2022, 5:41 PM
lldb/include/lldb/Target/Language.h
331

I was wondering the same. I think it's worth the churn.

aprantl added inline comments.Aug 10 2022, 8:28 AM
lldb/include/lldb/Target/Language.h
331

Let's do it then (but this can be a follow-up NFC patch if that makes things easier).

  • Return std::vector instead of using an output argument
Michael137 marked 3 inline comments as done.Aug 14 2022, 11:41 AM
Michael137 added inline comments.
lldb/include/lldb/Target/Language.h
331

Just did it in this patch. Made some questions in the third part of this patchset easier to answer

Michael137 marked an inline comment as done.Aug 14 2022, 2:54 PM
aprantl accepted this revision.Aug 15 2022, 9:56 AM
This revision is now accepted and ready to land.Aug 15 2022, 9:56 AM