[clang] 07dc9b8 - [clang][TableGen] Change DataCollector to use const RecordKeeper (#108203)

via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 11 10:51:00 PDT 2024


Author: Rahul Joshi
Date: 2024-09-11T10:50:57-07:00
New Revision: 07dc9b838efc32647aeafbf7325e3d710412a0bf

URL: https://github.com/llvm/llvm-project/commit/07dc9b838efc32647aeafbf7325e3d710412a0bf
DIFF: https://github.com/llvm/llvm-project/commit/07dc9b838efc32647aeafbf7325e3d710412a0bf.diff

LOG: [clang][TableGen] Change DataCollector to use const RecordKeeper (#108203)

Change DataCollectors 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

Added: 
    

Modified: 
    clang/utils/TableGen/ClangDataCollectorsEmitter.cpp
    clang/utils/TableGen/TableGenBackends.h

Removed: 
    


################################################################################
diff  --git a/clang/utils/TableGen/ClangDataCollectorsEmitter.cpp b/clang/utils/TableGen/ClangDataCollectorsEmitter.cpp
index 45082935c1f794..dae6710d752358 100644
--- a/clang/utils/TableGen/ClangDataCollectorsEmitter.cpp
+++ b/clang/utils/TableGen/ClangDataCollectorsEmitter.cpp
@@ -4,7 +4,7 @@
 
 using namespace llvm;
 
-void clang::EmitClangDataCollectors(RecordKeeper &RK, raw_ostream &OS) {
+void clang::EmitClangDataCollectors(const RecordKeeper &RK, raw_ostream &OS) {
   const auto &Defs = RK.getClasses();
   for (const auto &Entry : Defs) {
     Record &R = *Entry.second;

diff  --git a/clang/utils/TableGen/TableGenBackends.h b/clang/utils/TableGen/TableGenBackends.h
index 503684118278bf..699df49bc80466 100644
--- a/clang/utils/TableGen/TableGenBackends.h
+++ b/clang/utils/TableGen/TableGenBackends.h
@@ -152,7 +152,7 @@ void EmitClangOpenCLBuiltinHeader(llvm::RecordKeeper &Records,
 void EmitClangOpenCLBuiltinTests(llvm::RecordKeeper &Records,
                                  llvm::raw_ostream &OS);
 
-void EmitClangDataCollectors(llvm::RecordKeeper &Records,
+void EmitClangDataCollectors(const llvm::RecordKeeper &Records,
                              llvm::raw_ostream &OS);
 
 void EmitTestPragmaAttributeSupportedAttributes(llvm::RecordKeeper &Records,


        


More information about the cfe-commits mailing list