[PATCH] D146519: [Experimental] getAllDerivedDefinitions() returns unsorted Records by default
NAKAMURA Takumi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 21 05:49:21 PDT 2023
chapuni added a comment.
This is an experiment to D145874 <https://reviews.llvm.org/D145874>.
`RK::Defs2` holds Defs by registration order including anonymous defs.
I have checked only with `check-llvm`. Bootstrapping is not tested.
================
Comment at: llvm/utils/TableGen/Attributes.cpp:68
+ for (auto *A :
+ Records.getAllDerivedDefinitions(KindName, RecordKeeper::Numeric)) {
OS << A->getName() << " = " << Value << ",\n";
----------------
Enum should be sorted since it would affect the internal order.
================
Comment at: llvm/utils/TableGen/Attributes.cpp:118
+ for (auto *A :
+ Records.getAllDerivedDefinitions(KindName, RecordKeeper::Numeric)) {
OS << "0";
----------------
I guess it should be the same order as Enum.
================
Comment at: llvm/utils/TableGen/CodeGenRegisters.cpp:1178
+ std::vector<Record *> Tups =
+ Records.getAllDerivedDefinitions("RegisterTuples", RecordKeeper::Char);
----------------
This is the only place that relies on char sort.
I guess it wouldn't affect actual behavior changes.
================
Comment at: llvm/utils/TableGen/GlobalISelEmitter.cpp:5555
std::vector<const Record *> MatchedRecords;
- const auto &Defs = RK.getAllDerivedDefinitions("PatFrags");
std::copy_if(Defs.begin(), Defs.end(), std::back_inserter(MatchedRecords),
----------------
Possible bug, capturing address of temporary object.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146519/new/
https://reviews.llvm.org/D146519
More information about the llvm-commits
mailing list