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

Mehdi Amini llvmlistbot at llvm.org
Tue May 7 09:22:04 PDT 2024


================
@@ -62,6 +62,14 @@ int main(int argc, char **argv) {
       "write-if-changed",
       llvm::cl::desc("Only write to the output file if it changed"));
 
+  // `ResetCommandLineParser` at the above unregistered the "D" option
+  // of `llvm-tblgen`, which caused `TestOps.cpp` to fail due to
+  // "Unknnown command line argument '-D...`" when a macros name is
+  // present. The following is a workaround to re-register it again.
+  llvm::cl::list<std::string> MacroNames(
+      "D", llvm::cl::desc("Name of the macro to be defined"),
+      llvm::cl::value_desc("macro name"), llvm::cl::Prefix);
----------------
joker-eph wrote:

It should be documented as ignored and present for compatibility I think.

https://github.com/llvm/llvm-project/pull/91329


More information about the Mlir-commits mailing list