This is an archive of the discontinued LLVM Phabricator instance.

[Experimental] getAllDerivedDefinitions() returns unsorted Records by default
Needs ReviewPublic

Authored by chapuni on Mar 21 2023, 5:38 AM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary
  • None: Registration order (by default)
  • Numeric: Use StringRef::compare_numeric
  • Char: Character order

Diff Detail

Event Timeline

chapuni created this revision.Mar 21 2023, 5:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 21 2023, 5:38 AM
chapuni requested review of this revision.Mar 21 2023, 5:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 21 2023, 5:38 AM

This is an experiment to D145874.
RK::Defs2 holds Defs by registration order including anonymous defs.

I have checked only with check-llvm. Bootstrapping is not tested.

llvm/utils/TableGen/Attributes.cpp
68

Enum should be sorted since it would affect the internal order.

118

I guess it should be the same order as Enum.

llvm/utils/TableGen/CodeGenRegisters.cpp
1178

This is the only place that relies on char sort.
I guess it wouldn't affect actual behavior changes.

llvm/utils/TableGen/GlobalISelEmitter.cpp
5555

Possible bug, capturing address of temporary object.