[llvm] [LLVM][TableGen] Change PrintEnums to use const RecordKeeper (PR #109200)

Rahul Joshi via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 18 14:12:11 PDT 2024


https://github.com/jurahul created https://github.com/llvm/llvm-project/pull/109200

 Change PrintEnums to use const RecordKeeper.

>From 1eb62ec67d76409b6d2e3bde361929fc280bf242 Mon Sep 17 00:00:00 2001
From: Rahul Joshi <rjoshi at nvidia.com>
Date: Wed, 18 Sep 2024 14:10:53 -0700
Subject: [PATCH] [LLVM][TableGen] Change PrintEnums to use const RecordKeeper

---
 llvm/utils/TableGen/TableGen.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/llvm/utils/TableGen/TableGen.cpp b/llvm/utils/TableGen/TableGen.cpp
index 2cc9f364d20cb4..fff4c6b7c27ada 100644
--- a/llvm/utils/TableGen/TableGen.cpp
+++ b/llvm/utils/TableGen/TableGen.cpp
@@ -43,8 +43,8 @@ static void PrintRecords(const RecordKeeper &Records, raw_ostream &OS) {
   OS << Records; // No argument, dump all contents
 }
 
-static void PrintEnums(RecordKeeper &Records, raw_ostream &OS) {
-  for (Record *Rec : Records.getAllDerivedDefinitions(Class))
+static void PrintEnums(const RecordKeeper &Records, raw_ostream &OS) {
+  for (const Record *Rec : Records.getAllDerivedDefinitions(Class))
     OS << Rec->getName() << ", ";
   OS << "\n";
 }



More information about the llvm-commits mailing list