[clang] [clang][TableGen] Change Opcode Emitter to use const RecordKeeper (PR #108211)
Rahul Joshi via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 11 05:34:53 PDT 2024
https://github.com/jurahul created https://github.com/llvm/llvm-project/pull/108211
None
>From 49650f70c36c37747da6d73865ebcb7b7a94da2f Mon Sep 17 00:00:00 2001
From: Rahul Joshi <rjoshi at nvidia.com>
Date: Wed, 11 Sep 2024 05:33:50 -0700
Subject: [PATCH] [clang][TableGen] Change Opcode Emitter to use const
RecordKeeper
---
clang/utils/TableGen/ClangOpcodesEmitter.cpp | 6 +++---
clang/utils/TableGen/TableGenBackends.h | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/clang/utils/TableGen/ClangOpcodesEmitter.cpp b/clang/utils/TableGen/ClangOpcodesEmitter.cpp
index 120e1e2efa32b4..7e426d59359a87 100644
--- a/clang/utils/TableGen/ClangOpcodesEmitter.cpp
+++ b/clang/utils/TableGen/ClangOpcodesEmitter.cpp
@@ -20,11 +20,11 @@ using namespace llvm;
namespace {
class ClangOpcodesEmitter {
- RecordKeeper &Records;
+ const RecordKeeper &Records;
unsigned NumTypes;
public:
- ClangOpcodesEmitter(RecordKeeper &R)
+ ClangOpcodesEmitter(const RecordKeeper &R)
: Records(R), NumTypes(Records.getAllDerivedDefinitions("Type").size()) {}
void run(raw_ostream &OS);
@@ -404,6 +404,6 @@ void ClangOpcodesEmitter::PrintTypes(raw_ostream &OS,
OS << ">";
}
-void clang::EmitClangOpcodes(RecordKeeper &Records, raw_ostream &OS) {
+void clang::EmitClangOpcodes(const RecordKeeper &Records, raw_ostream &OS) {
ClangOpcodesEmitter(Records).run(OS);
}
diff --git a/clang/utils/TableGen/TableGenBackends.h b/clang/utils/TableGen/TableGenBackends.h
index 3a424c9c91fe71..5050b764b09fb8 100644
--- a/clang/utils/TableGen/TableGenBackends.h
+++ b/clang/utils/TableGen/TableGenBackends.h
@@ -94,7 +94,7 @@ void EmitClangCommentCommandInfo(llvm::RecordKeeper &Records,
llvm::raw_ostream &OS);
void EmitClangCommentCommandList(llvm::RecordKeeper &Records,
llvm::raw_ostream &OS);
-void EmitClangOpcodes(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
+void EmitClangOpcodes(const llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
void EmitClangSyntaxNodeList(llvm::RecordKeeper &Records,
llvm::raw_ostream &OS);
More information about the cfe-commits
mailing list