[all-commits] [llvm/llvm-project] 2ac3cd: [TableGen] Remove the use of global Record state

River Riddle via All-commits all-commits at lists.llvm.org
Wed May 11 11:56:03 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2ac3cd20cacdf37135eeb64ad2b7baefb9769e99
      https://github.com/llvm/llvm-project/commit/2ac3cd20cacdf37135eeb64ad2b7baefb9769e99
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2022-05-11 (Wed, 11 May 2022)

  Changed paths:
    M llvm/include/llvm/TableGen/Record.h
    M llvm/lib/TableGen/Error.cpp
    M llvm/lib/TableGen/Parser.cpp
    M llvm/lib/TableGen/Record.cpp
    R llvm/lib/TableGen/RecordContext.h
    M llvm/lib/TableGen/TGParser.cpp
    M llvm/utils/TableGen/CodeGenDAGPatterns.cpp
    M llvm/utils/TableGen/CodeGenInstruction.cpp
    M llvm/utils/TableGen/CodeGenRegisters.cpp
    M llvm/utils/TableGen/CodeGenTarget.cpp
    M llvm/utils/TableGen/DecoderEmitter.cpp
    M llvm/utils/TableGen/PseudoLoweringEmitter.cpp
    M llvm/utils/TableGen/SearchableTableEmitter.cpp
    M llvm/utils/TableGen/WebAssemblyDisassemblerEmitter.cpp

  Log Message:
  -----------
  [TableGen] Remove the use of global Record state

This commits removes TableGens reliance on managed static global record state
by moving the RecordContext into the RecordKeeper. The RecordKeeper is now
treated similarly to a (LLVM|MLIR|etc)Context object and is passed to static
construction functions. This is an important step forward in removing TableGens
reliance on global state, and in a followup will allow for users that parse tablegen
to parse multiple tablegen files without worrying about Record lifetime.

Differential Revision: https://reviews.llvm.org/D125276


  Commit: 5a9a438a54672915247b70ba293d2e8dfe262570
      https://github.com/llvm/llvm-project/commit/5a9a438a54672915247b70ba293d2e8dfe262570
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2022-05-11 (Wed, 11 May 2022)

  Changed paths:
    M llvm/include/llvm/TableGen/Parser.h
    M llvm/lib/TableGen/Parser.cpp
    M llvm/unittests/TableGen/ParserEntryPointTest.cpp
    M mlir/lib/Tools/PDLL/Parser/Parser.cpp

  Log Message:
  -----------
  [TableGen] Refactor TableGenParseFile to no longer use a callback

Now that TableGen no longer relies on global Record state, we can allow
for the client to own the RecordKeeper and SourceMgr. Given that TableGen
internally still relies on the global llvm::SrcMgr, this method unfortunately
still isn't thread-safe.

Differential Revision: https://reviews.llvm.org/D125277


Compare: https://github.com/llvm/llvm-project/compare/3ca6328637b3...5a9a438a5467


More information about the All-commits mailing list