This is an archive of the discontinued LLVM Phabricator instance.

[demangler] Fix node matchers
ClosedPublic

Authored by urnathan on Mar 29 2022, 9:49 AM.

Details

Reviewers
dblaikie
bruno
frgossen
Group Reviewers
Restricted Project
Commits
rGabffdd887677: [demangler] Fix node matchers
Summary

This fixes up the matcher fallout from D120905

  • Add instantiation tests to ItaniumDemangleTest, to make sure all match functions provide constructor arguments to the provided functor. This found some problems ...
  • Fix the Node constructors that lost const qualification on arguments.

The node names are broken out into a def file by D122739, which this depends upon

Diff Detail

Event Timeline

urnathan created this revision.Mar 29 2022, 9:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 29 2022, 9:49 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
urnathan requested review of this revision.Mar 29 2022, 9:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 29 2022, 9:49 AM
dblaikie added inline comments.Mar 29 2022, 12:19 PM
llvm/include/llvm/Demangle/ItaniumDemangle.h
2377–2379

The modules-unfriendly nature of this worries me a bit.

Maybe we could change the FOR_EACH_NODE_KIND to a .def file instead? (basically take the macro out, put it in another (includable, intentionally non-modular) file that calls the includer-defined macro & undefs the macro at the end (so it doesn't persist/pollute other things))

We have a lot of these in LLVM, one example (though it handles a variet of different lists, which adds more complexity than will be needed here) is llvm/include/llvm/BinaryFormat/Dwarf.def

urnathan edited reviewers, added: Restricted Project; removed: ldionne.Mar 31 2022, 9:48 AM
dblaikie accepted this revision.Mar 31 2022, 1:33 PM

Sounds good

This revision is now accepted and ready to land.Mar 31 2022, 1:33 PM
This revision was landed with ongoing or failed builds.Apr 1 2022, 5:19 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 1 2022, 5:19 AM
Herald added 1 blocking reviewer(s): Restricted Project. · View Herald Transcript

committed d7692c0f9b06 2022-04-01 | [demangler] Fix node matcher test
to fix build bot: https://lab.llvm.org/buildbot/#/builders/216/builds/2249