Skip to content

Commit 1ed9846

Browse files
committed
EISW-173753 Fix invalid TableGen flag in LLVM 20.x causing precommit failure
Also adds explicit registration for the CMake/TableGen-passed flag in mlir-src-sharder after command line reset.
1 parent 59be7e8 commit 1ed9846

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

llvm/cmake/modules/TableGen.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function(tablegen project ofn)
8181
endif()
8282

8383
if (NOT LLVM_ENABLE_WARNINGS)
84-
list(APPEND LLVM_TABLEGEN_FLAGS "-Dno-warn-on-unused-template-args")
84+
list(APPEND LLVM_TABLEGEN_FLAGS "--no-warn-on-unused-template-args")
8585
endif()
8686

8787
# We need both _TABLEGEN_TARGET and _TABLEGEN_EXE in the DEPENDS list

mlir/tools/mlir-src-sharder/mlir-src-sharder.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ int main(int argc, char **argv) {
7272
"Name of the macro to be defined -- ignored by mlir-src-sharder"),
7373
llvm::cl::value_desc("macro name"), llvm::cl::Prefix);
7474

75+
// CMake/TableGen pass this flag, re-registering after ResetCommandLineParser
76+
// avoids "unknown argument" errors.
77+
// TODO: Investigate if mlir-src-sharder's argument parsing can be
78+
// aligned with generic tablegen options more broadly.
79+
llvm::cl::opt<bool> noWarnOnUnusedTemplateArg(
80+
"no-warn-on-unused-template-args",
81+
llvm::cl::desc("Disable unused template argument warnings."));
82+
7583
llvm::InitLLVM y(argc, argv);
7684
llvm::cl::ParseCommandLineOptions(argc, argv);
7785

0 commit comments

Comments
 (0)