[all-commits] [llvm/llvm-project] 34dee0: [TableGen] Allow emitter callbacks to use `const R...

Rahul Joshi via All-commits all-commits at lists.llvm.org
Mon Aug 26 12:10:55 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 34dee0a96105d6aeb8b386efbbbfe437ab1be02e
      https://github.com/llvm/llvm-project/commit/34dee0a96105d6aeb8b386efbbbfe437ab1be02e
  Author: Rahul Joshi <rjoshi at nvidia.com>
  Date:   2024-08-26 (Mon, 26 Aug 2024)

  Changed paths:
    M llvm/include/llvm/ADT/STLFunctionalExtras.h
    M llvm/include/llvm/TableGen/TableGenBackend.h
    M llvm/lib/TableGen/Main.cpp
    M llvm/lib/TableGen/TableGenBackend.cpp
    M llvm/unittests/ADT/FunctionRefTest.cpp
    M llvm/utils/TableGen/DisassemblerEmitter.cpp
    M llvm/utils/TableGen/IntrinsicEmitter.cpp
    M llvm/utils/TableGen/TableGen.cpp

  Log Message:
  -----------
  [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.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list