Unverified Commit f97f04ec authored by Daniel Chen's avatar Daniel Chen Committed by GitHub
Browse files

[mlir] Fixing a regression that '-D' option of llvm-tblgen is unregistered. (#91329)

PR #89664 introduced a regression that it unregistered llvm-tblgen
option `-D` for macros. The test `TestOps.cpp` failed due to passing a
macros to llvm-tblgen.

It caused our internal build to fail because we append `-DLOCAL_NAME`
into `LLVM_TABLEGEN_FLANGS` in `llvm/lib/cmake/llvm/TableGen.cmake` as

```
list(APPEND LLVM_TABLEGEN_FLAGS "-DLOCAL_NAME")
```

And in `./llvm/lib/Target/PowerPC/PPC.td`, we check it for some
downstream code as:

```
...
#ifdef LOCAL_NAME
...
#endif
```
Now we got error message from mlir-src-sharder as
```
mlir-src-sharder -op-shard-index=1 -DLOCAL_NAME llvm-project/mlir/test/lib/Dialect/Test/TestOps.cpp --write-if-changed -o tools/mlir/test/lib/Dialect/Test/TestOps.1.cpp -d tools/mlir/test/lib/Dialect/Test/TestOps.1.cpp.d
mlir-src-sharder: Unknown command line argument '-DLOCAL_NAME'.  Try: 'llvm-project/build/bin/mlir-src-sharder --help'
mlir-src-sharder: Did you mean '-I'?
```

This PR is to fix the regression.
parent 40b322ba
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment