Skip to content

Commit c0a763d

Browse files
[NFC][MLIR] Make file-local cl::opt global variables static (llvm#126714)
This is per style-guide: make file-scope symbol static whenever possible. Fix llvm#125983.
1 parent fadbc33 commit c0a763d

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

mlir/tools/mlir-rewrite/mlir-rewrite.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -348,11 +348,11 @@ static mlir::RewriterRegistration
348348
rewriteMarkRanges("mark-ranges", "Indicate ranges parsed", markRanges);
349349

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

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

mlir/tools/mlir-runner/mlir-runner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ using namespace mlir;
3232
// TODO: Consider removing this linking functionality from the SPIR-V CPU Runner
3333
// flow in favour of a more proper host/device split like other runners.
3434
// https://github.com/llvm/llvm-project/issues/115348
35-
llvm::cl::opt<bool> LinkNestedModules(
35+
static llvm::cl::opt<bool> LinkNestedModules(
3636
"link-nested-modules",
3737
llvm::cl::desc("Link two nested MLIR modules into a single LLVM IR module. "
3838
"Useful if both the host and device code can be run on the "

mlir/tools/mlir-tblgen/DialectGen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ using llvm::Record;
3434
using llvm::RecordKeeper;
3535

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

mlir/tools/mlir-tblgen/OpDocGen.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ using mlir::tblgen::Operator;
4444
//===----------------------------------------------------------------------===//
4545
static cl::OptionCategory
4646
docCat("Options for -gen-(attrdef|typedef|enum|op|dialect)-doc");
47-
cl::opt<std::string>
47+
static cl::opt<std::string>
4848
stripPrefix("strip-prefix",
4949
cl::desc("Strip prefix of the fully qualified names"),
5050
cl::init("::mlir::"), cl::cat(docCat));
51-
cl::opt<bool> allowHugoSpecificFeatures(
51+
static cl::opt<bool> allowHugoSpecificFeatures(
5252
"allow-hugo-specific-features",
5353
cl::desc("Allows using features specific to Hugo"), cl::init(false),
5454
cl::cat(docCat));

mlir/tools/tblgen-to-irdl/OpDefinitionsGen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ using namespace mlir;
3636
using tblgen::NamedTypeConstraint;
3737

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

0 commit comments

Comments
 (0)