Files
clang-p2996/llvm/utils/TableGen/DisassemblerEmitter.cpp
Rahul Joshi 34dee0a961 [TableGen] Allow emitter callbacks to use const RecordKeeper & (#104716)
- Refactor TableGen backend options to allow specifying a callback
  function that takes either a const reference or a non-const reference
  to `RecordKeeper`. This will enable gradual migration of code to use
  const references and pointers to `RecordKeeper` and  `Record` in the
  TableGen backends. 

- Refactor handling of the callback command line options. Move variable
  for the command line option from the header to the CPP file, and add a
  function `ApplyCallback` to apply the selected callback.

- Change callbacks in TableGen.cpp to take const reference. They use the
  `Opt` class to register their callbacks.

- Change IntrinsicEmitter to use the `OptClass` to define its callbacks.
  It already uses a const reference in the implementation.
2024-08-26 12:10:33 -07:00

6.2 KiB