[llvm] [TableGen] Allow emitter callbacks to use `const RecordKeeper &` (PR #104716)
Rahul Joshi via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 22 05:22:36 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:
Adopted this into the PR and eliminated the 2 typedefs.
https://github.com/llvm/llvm-project/pull/104716
More information about the llvm-commits
mailing list