Skip to content

Commit 0767027

Browse files
authored
[clang][TableGen] Change Opcode Emitter to use const RecordKeeper (#108211)
Change Opcode Emitter to use const RecordKeeper. This is a part of effort to have better const correctness in TableGen backends: https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089
1 parent 07dc9b8 commit 0767027

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

clang/utils/TableGen/ClangOpcodesEmitter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ using namespace llvm;
2020

2121
namespace {
2222
class ClangOpcodesEmitter {
23-
RecordKeeper &Records;
23+
const RecordKeeper &Records;
2424
unsigned NumTypes;
2525

2626
public:
27-
ClangOpcodesEmitter(RecordKeeper &R)
27+
ClangOpcodesEmitter(const RecordKeeper &R)
2828
: Records(R), NumTypes(Records.getAllDerivedDefinitions("Type").size()) {}
2929

3030
void run(raw_ostream &OS);
@@ -404,6 +404,6 @@ void ClangOpcodesEmitter::PrintTypes(raw_ostream &OS,
404404
OS << ">";
405405
}
406406

407-
void clang::EmitClangOpcodes(RecordKeeper &Records, raw_ostream &OS) {
407+
void clang::EmitClangOpcodes(const RecordKeeper &Records, raw_ostream &OS) {
408408
ClangOpcodesEmitter(Records).run(OS);
409409
}

clang/utils/TableGen/TableGenBackends.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ void EmitClangCommentCommandInfo(const llvm::RecordKeeper &Records,
9595
llvm::raw_ostream &OS);
9696
void EmitClangCommentCommandList(const llvm::RecordKeeper &Records,
9797
llvm::raw_ostream &OS);
98-
void EmitClangOpcodes(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
98+
void EmitClangOpcodes(const llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
9999

100100
void EmitClangSyntaxNodeList(llvm::RecordKeeper &Records,
101101
llvm::raw_ostream &OS);

0 commit comments

Comments
 (0)