[all-commits] [llvm/llvm-project] 92787e: [LLVM][TableGen] Support combined cells in jupyter...

David Spickett via All-commits all-commits at lists.llvm.org
Mon Jan 23 06:19:51 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 92787e3e3409890001171bdd01ced86ccdf4b77d
      https://github.com/llvm/llvm-project/commit/92787e3e3409890001171bdd01ced86ccdf4b77d
  Author: David Spickett <david.spickett at linaro.org>
  Date:   2023-01-23 (Mon, 23 Jan 2023)

  Changed paths:
    M llvm/utils/TableGen/jupyter/LLVM_TableGen.ipynb
    M llvm/utils/TableGen/jupyter/LLVM_TableGen.md
    M llvm/utils/TableGen/jupyter/tablegen_kernel/kernel.py

  Log Message:
  -----------
  [LLVM][TableGen] Support combined cells in jupyter kernel

This changes the default mode to cache the code blocks we're
asked to compile until we see the new `%reset` magic to clear that cache.

This means that if you run several cells in sequence, at the end you're
compiling the code from all the cells at once.

This emulates what the ipython kernel does where it uses a persistent
interpreter state by default.

`%reset` will only be acted on when it's in the cell we're asked to run
(the newest code).

`%args` we will use the most recent value we have cached.

The example notebook has been updated to explain that.

Depends on D132378

Reviewed By: jpienaar

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




More information about the All-commits mailing list