[llvm] dacbf4a - [llvm][TableGen][Jupyter] Note an easily encountered error

David Spickett via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 5 01:00:29 PDT 2023


Author: David Spickett
Date: 2023-07-05T08:59:58+01:00
New Revision: dacbf4a7094a72e7651737ac1f137b03b5d5b2d8

URL: https://github.com/llvm/llvm-project/commit/dacbf4a7094a72e7651737ac1f137b03b5d5b2d8
DIFF: https://github.com/llvm/llvm-project/commit/dacbf4a7094a72e7651737ac1f137b03b5d5b2d8.diff

LOG: [llvm][TableGen][Jupyter] Note an easily encountered error

When using VSCode it'll default to the Python kernel the first
time you open the notebook. Mention this in the readme, as the fix
is simple but only if you know what to look for.

Added: 
    

Modified: 
    llvm/utils/TableGen/jupyter/README.md

Removed: 
    


################################################################################
diff  --git a/llvm/utils/TableGen/jupyter/README.md b/llvm/utils/TableGen/jupyter/README.md
index f2909265d99c68..927a3d3dd14b6c 100644
--- a/llvm/utils/TableGen/jupyter/README.md
+++ b/llvm/utils/TableGen/jupyter/README.md
@@ -21,7 +21,9 @@ If you have installed Jupyter into a virtual environment, adjust `python3` to
 be the interpreter for that environment. This will ensure that tools run the
 kernel in the correct context.
 
+```shell
     python3 -m tablegen_kernel.install
+```
 
 Then run one of:
 
@@ -39,6 +41,17 @@ Then run one of:
 `llvm-tblgen` is expected to be either in the `PATH` or you can set
 the environment variable `LLVM_TBLGEN_EXECUTABLE` to point to it directly.
 
+If you see an error like this:
+```shell
+  Cell In[8], line 2
+    // This is some tablegen
+    ^
+SyntaxError: invalid syntax
+```
+
+You are probably running the notebook using the iPython kernel. Make sure you
+ have selected the tablegen kernel.
+
 To run the kernel's doctests do:
 
 ```shell


        


More information about the llvm-commits mailing list