Skip to content

Commit

Permalink
[clang][Interp][NFC] Remove Root record from opcode emitter
Browse files Browse the repository at this point in the history
It's only used once and only for its name, so replace that with
a string literal.
  • Loading branch information
tbaederr committed Jan 28, 2024
1 parent 3545486 commit 916bd7d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions clang/utils/TableGen/ClangOpcodesEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ using namespace llvm;
namespace {
class ClangOpcodesEmitter {
RecordKeeper &Records;
const Record Root;
unsigned NumTypes;

public:
ClangOpcodesEmitter(RecordKeeper &R)
: Records(R), Root("Opcode", SMLoc(), R),
NumTypes(Records.getAllDerivedDefinitions("Type").size()) {}
: Records(R), NumTypes(Records.getAllDerivedDefinitions("Type").size()) {}

void run(raw_ostream &OS);

Expand Down Expand Up @@ -86,7 +84,7 @@ void Enumerate(const Record *R, StringRef N,
} // namespace

void ClangOpcodesEmitter::run(raw_ostream &OS) {
for (const auto *Opcode : Records.getAllDerivedDefinitions(Root.getName())) {
for (const auto *Opcode : Records.getAllDerivedDefinitions("Opcode")) {
// The name is the record name, unless overriden.
StringRef N = Opcode->getValueAsString("Name");
if (N.empty())
Expand Down

0 comments on commit 916bd7d

Please sign in to comment.