Skip to content

Commit 916bd7d

Browse files
committed
[clang][Interp][NFC] Remove Root record from opcode emitter
It's only used once and only for its name, so replace that with a string literal.
1 parent 3545486 commit 916bd7d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

clang/utils/TableGen/ClangOpcodesEmitter.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,11 @@ using namespace llvm;
2121
namespace {
2222
class ClangOpcodesEmitter {
2323
RecordKeeper &Records;
24-
const Record Root;
2524
unsigned NumTypes;
2625

2726
public:
2827
ClangOpcodesEmitter(RecordKeeper &R)
29-
: Records(R), Root("Opcode", SMLoc(), R),
30-
NumTypes(Records.getAllDerivedDefinitions("Type").size()) {}
28+
: Records(R), NumTypes(Records.getAllDerivedDefinitions("Type").size()) {}
3129

3230
void run(raw_ostream &OS);
3331

@@ -86,7 +84,7 @@ void Enumerate(const Record *R, StringRef N,
8684
} // namespace
8785

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

0 commit comments

Comments
 (0)