This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Delete IRExecutionUnit::CollectCandidateCPlusPlusNames
AbandonedPublic

Authored by bulbazord on Aug 19 2021, 11:41 AM.

Details

Summary

My goal is to remove lldbExpression's dependence on
lldbPluginCPlusPlusLanguage. I initially deleted this code in
to see what tests failed so that I could better understand how to
trigger this code path. No tests failed and I was unable to figure out
how to trigger the path manually, so I would like to delete it.

Diff Detail

Event Timeline

bulbazord created this revision.Aug 19 2021, 11:41 AM
bulbazord requested review of this revision.Aug 19 2021, 11:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 19 2021, 11:41 AM
teemperor requested changes to this revision.Aug 20 2021, 5:41 AM

I'm very supportive of the idea that we delete everything that isn't tested :) (and I'm only partly joking here). However removing this should cause a bunch of test failures on Linux as it effectively disables D70721 (the test added in that patch was just a unit test that is preserved with this patch, but the bigger problem describes there will break a few tests calling constructors on Linux).

I believe the usual 'iterate over all language plugins' approach would again work here? We can guess from the mangled symbol what language we deal with (and in the worst case we could encode that in the IRExecutionUnit), so the plugins would just deliver alternative names. GetAlternativeSymbolNames(ConstString symbol) or something like that maybe?

This revision now requires changes to proceed.Aug 20 2021, 5:41 AM

I'm very supportive of the idea that we delete everything that isn't tested :) (and I'm only partly joking here).

I can sympathize, I'm only partly serious with this change! :D

However removing this should cause a bunch of test failures on Linux as it effectively disables D70721 (the test added in that patch was just a unit test that is preserved with this patch, but the bigger problem describes there will break a few tests calling constructors on Linux).

It doesn't cause test any test failures on my Linux machine unfortunately. I don't think this codepath is currently exercised by any tests. Certainly the FindAlternateFunctionManglings test in CPlusPlusLanguageTest.cpp also uses CPlusPlusLanguage::FindAlternateFunctionManglings, but that's not the same thing as testing IRExecutionUnit::CollectCandidateCPlusPlusNames being tested as a part of IRExecutionUnit::FindSymbol.

I believe the usual 'iterate over all language plugins' approach would again work here? We can guess from the mangled symbol what language we deal with (and in the worst case we could encode that in the IRExecutionUnit), so the plugins would just deliver alternative names. GetAlternativeSymbolNames(ConstString symbol) or something like that maybe?

I definitely think that the usual "iterate over all language plugins" approach would work here if we don't delete this (which it seems like we shouldn't). I mostly uploaded this change to see if anybody knew how to trigger this codepath. Before refactoring I'd like to write a test for this codepath, though I'm still not entirely sure how to do that yet.

Embarassingly I found out my test environment was not working correctly, this does indeed fail some tests. I will upload a patch to actually refactor it :)

bulbazord abandoned this revision.Aug 30 2021, 3:10 PM