Skip to content

[NFC][MLIR] Make file-local cl::opt global variables static #126714

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions mlir/tools/mlir-rewrite/mlir-rewrite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,11 +348,11 @@ static mlir::RewriterRegistration
rewriteMarkRanges("mark-ranges", "Indicate ranges parsed", markRanges);

int main(int argc, char **argv) {
static llvm::cl::opt<std::string> inputFilename(
llvm::cl::Positional, llvm::cl::desc("<input file>"),
llvm::cl::init("-"));
llvm::cl::opt<std::string> inputFilename(llvm::cl::Positional,
llvm::cl::desc("<input file>"),
llvm::cl::init("-"));

static llvm::cl::opt<std::string> outputFilename(
llvm::cl::opt<std::string> outputFilename(
"o", llvm::cl::desc("Output filename"), llvm::cl::value_desc("filename"),
llvm::cl::init("-"));

Expand Down
2 changes: 1 addition & 1 deletion mlir/tools/mlir-runner/mlir-runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ using namespace mlir;
// TODO: Consider removing this linking functionality from the SPIR-V CPU Runner
// flow in favour of a more proper host/device split like other runners.
// https://github.com/llvm/llvm-project/issues/115348
llvm::cl::opt<bool> LinkNestedModules(
static llvm::cl::opt<bool> LinkNestedModules(
"link-nested-modules",
llvm::cl::desc("Link two nested MLIR modules into a single LLVM IR module. "
"Useful if both the host and device code can be run on the "
Expand Down
2 changes: 1 addition & 1 deletion mlir/tools/mlir-tblgen/DialectGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ using llvm::Record;
using llvm::RecordKeeper;

static llvm::cl::OptionCategory dialectGenCat("Options for -gen-dialect-*");
llvm::cl::opt<std::string>
static llvm::cl::opt<std::string>
selectedDialect("dialect", llvm::cl::desc("The dialect to gen for"),
llvm::cl::cat(dialectGenCat), llvm::cl::CommaSeparated);

Expand Down
4 changes: 2 additions & 2 deletions mlir/tools/mlir-tblgen/OpDocGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ using mlir::tblgen::Operator;
//===----------------------------------------------------------------------===//
static cl::OptionCategory
docCat("Options for -gen-(attrdef|typedef|enum|op|dialect)-doc");
cl::opt<std::string>
static cl::opt<std::string>
stripPrefix("strip-prefix",
cl::desc("Strip prefix of the fully qualified names"),
cl::init("::mlir::"), cl::cat(docCat));
cl::opt<bool> allowHugoSpecificFeatures(
static cl::opt<bool> allowHugoSpecificFeatures(
"allow-hugo-specific-features",
cl::desc("Allows using features specific to Hugo"), cl::init(false),
cl::cat(docCat));
Expand Down
2 changes: 1 addition & 1 deletion mlir/tools/tblgen-to-irdl/OpDefinitionsGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ using namespace mlir;
using tblgen::NamedTypeConstraint;

static llvm::cl::OptionCategory dialectGenCat("Options for -gen-irdl-dialect");
llvm::cl::opt<std::string>
static llvm::cl::opt<std::string>
selectedDialect("dialect", llvm::cl::desc("The dialect to gen for"),
llvm::cl::cat(dialectGenCat), llvm::cl::Required);

Expand Down