[llvm] [TableGen] Allow emitter callbacks to use `const RecordKeeper &` (PR #104716)

Rahul Joshi via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 23 06:12:07 PDT 2024


" + sys::path::filename(Record.getInputFilename()),"
In-Reply-To: <llvm.org/llvm/llvm-project/pull/104716 at github.com>


================
@@ -24,29 +22,38 @@ class RecordKeeper;
 class raw_ostream;
 
 namespace TableGen::Emitter {
-using FnT = void (*)(RecordKeeper &Records, raw_ostream &OS);
-
-struct OptCreatorT {
-  static void *call();
-};
-
-extern ManagedStatic<cl::opt<FnT>, OptCreatorT> Action;
+// Support const and non-const forms of callback functions.
+using FnNonConstT = void (*)(RecordKeeper &Records, raw_ostream &OS);
+using FnConstT = void (*)(const RecordKeeper &Records, raw_ostream &OS);
----------------
jurahul wrote:

Resolving this thread.

https://github.com/llvm/llvm-project/pull/104716


More information about the llvm-commits mailing list