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

This is per style-guide: make file-scope symbol static whenever possible.

Fix #125983.
This commit is contained in:
Daniel 2025-02-19 09:11:38 -03:00 committed by GitHub
parent fadbc33b01
commit c0a763d3ef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 9 additions and 9 deletions

View File

@ -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("-"));

View File

@ -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 "

View File

@ -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);

View File

@ -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));

View File

@ -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);