Skip to content

Commit c5663f2

Browse files
committed
[NFC]Make file-local cl::opt global variables static
1 parent 5d4998b commit c5663f2

File tree

50 files changed

+251
-242
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+251
-242
lines changed

llvm/examples/Kaleidoscope/MCJIT/cached/toy-jit.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ using namespace llvm;
2828
//===----------------------------------------------------------------------===//
2929

3030
namespace {
31-
cl::opt<std::string>
32-
InputIR("input-IR",
33-
cl::desc("Specify the name of an IR file to load for function definitions"),
34-
cl::value_desc("input IR file name"));
31+
cl::opt<std::string> InputIR(
32+
"input-IR",
33+
cl::desc("Specify the name of an IR file to load for function definitions"),
34+
cl::value_desc("input IR file name"));
3535
} // namespace
3636

3737
//===----------------------------------------------------------------------===//

llvm/examples/Kaleidoscope/MCJIT/cached/toy.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ using namespace llvm;
3131
// Command-line options
3232
//===----------------------------------------------------------------------===//
3333

34-
cl::opt<std::string>
35-
InputIR("input-IR",
36-
cl::desc("Specify the name of an IR file to load for function definitions"),
37-
cl::value_desc("input IR file name"));
38-
39-
cl::opt<bool>
40-
UseObjectCache("use-object-cache",
41-
cl::desc("Enable use of the MCJIT object caching"),
42-
cl::init(false));
34+
static cl::opt<std::string> InputIR(
35+
"input-IR",
36+
cl::desc("Specify the name of an IR file to load for function definitions"),
37+
cl::value_desc("input IR file name"));
38+
39+
static cl::opt<bool>
40+
UseObjectCache("use-object-cache",
41+
cl::desc("Enable use of the MCJIT object caching"),
42+
cl::init(false));
4343

4444
//===----------------------------------------------------------------------===//
4545
// Lexer

llvm/examples/OrcV2Examples/LLJITDumpObjects/LLJITDumpObjects.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ using namespace llvm::orc;
2121

2222
ExitOnError ExitOnErr;
2323

24-
cl::opt<bool> DumpJITdObjects("dump-jitted-objects",
25-
cl::desc("dump jitted objects"), cl::Optional,
26-
cl::init(true));
24+
static cl::opt<bool> DumpJITdObjects("dump-jitted-objects",
25+
cl::desc("dump jitted objects"),
26+
cl::Optional, cl::init(true));
2727

28-
cl::opt<std::string> DumpDir("dump-dir",
29-
cl::desc("directory to dump objects to"),
30-
cl::Optional, cl::init(""));
28+
static cl::opt<std::string> DumpDir("dump-dir",
29+
cl::desc("directory to dump objects to"),
30+
cl::Optional, cl::init(""));
3131

32-
cl::opt<std::string> DumpFileStem("dump-file-stem",
33-
cl::desc("Override default dump names"),
34-
cl::Optional, cl::init(""));
32+
static cl::opt<std::string>
33+
DumpFileStem("dump-file-stem", cl::desc("Override default dump names"),
34+
cl::Optional, cl::init(""));
3535

3636
int main(int argc, char *argv[]) {
3737
// Initialize LLVM.

llvm/examples/OrcV2Examples/LLJITWithThinLTOSummaries/LLJITWithThinLTOSummaries.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ using namespace llvm;
5555
using namespace llvm::orc;
5656

5757
// Path of the module summary index file.
58-
cl::opt<std::string> IndexFile{cl::desc("<module summary index>"),
59-
cl::Positional, cl::init("-")};
58+
static cl::opt<std::string> IndexFile{cl::desc("<module summary index>"),
59+
cl::Positional, cl::init("-")};
6060

6161
// Describe a fail state that is caused by the given ModuleSummaryIndex
6262
// providing multiple definitions of the given global value name. It will dump

llvm/lib/Analysis/AliasAnalysis.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ STATISTIC(NumMustAlias, "Number of MustAlias results");
6161
namespace llvm {
6262
/// Allow disabling BasicAA from the AA results. This is particularly useful
6363
/// when testing to isolate a single AA implementation.
64-
cl::opt<bool> DisableBasicAA("disable-basic-aa", cl::Hidden, cl::init(false));
64+
static cl::opt<bool> DisableBasicAA("disable-basic-aa", cl::Hidden,
65+
cl::init(false));
6566
} // namespace llvm
6667

6768
#ifndef NDEBUG

llvm/lib/Analysis/BranchProbabilityInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static cl::opt<bool> PrintBranchProb(
5454
"print-bpi", cl::init(false), cl::Hidden,
5555
cl::desc("Print the branch probability info."));
5656

57-
cl::opt<std::string> PrintBranchProbFuncName(
57+
static cl::opt<std::string> PrintBranchProbFuncName(
5858
"print-bpi-func-name", cl::Hidden,
5959
cl::desc("The option to specify the name of the function "
6060
"whose branch probability info is printed."));

llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ cl::opt<bool> EnableDetailedFunctionProperties(
3030
"enable-detailed-function-properties", cl::Hidden, cl::init(false),
3131
cl::desc("Whether or not to compute detailed function properties."));
3232

33-
cl::opt<unsigned> BigBasicBlockInstructionThreshold(
33+
static cl::opt<unsigned> BigBasicBlockInstructionThreshold(
3434
"big-basic-block-instruction-threshold", cl::Hidden, cl::init(500),
3535
cl::desc("The minimum number of instructions a basic block should contain "
3636
"before being considered big."));
3737

38-
cl::opt<unsigned> MediumBasicBlockInstructionThreshold(
38+
static cl::opt<unsigned> MediumBasicBlockInstructionThreshold(
3939
"medium-basic-block-instruction-threshold", cl::Hidden, cl::init(15),
4040
cl::desc("The minimum number of instructions a basic block should contain "
4141
"before being considered medium-sized."));

llvm/lib/Analysis/IRSimilarityIdentifier.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ cl::opt<bool>
3636
cl::ReallyHidden,
3737
cl::desc("disable outlining indirect calls."));
3838

39-
cl::opt<bool>
39+
static cl::opt<bool>
4040
MatchCallsByName("ir-sim-calls-by-name", cl::init(false), cl::ReallyHidden,
4141
cl::desc("only allow matching call instructions if the "
4242
"name and type signature match."));

llvm/lib/Analysis/InlineSizeEstimatorAnalysis.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ AnalysisKey InlineSizeEstimatorAnalysis::Key;
3636
#include <deque>
3737
#include <optional>
3838

39-
cl::opt<std::string> TFIR2NativeModelPath(
39+
static cl::opt<std::string> TFIR2NativeModelPath(
4040
"ml-inliner-ir2native-model", cl::Hidden,
4141
cl::desc("Path to saved model evaluating native size from IR."));
4242

llvm/lib/Analysis/MemoryProfileInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ cl::opt<bool> MemProfReportHintedSizes(
5454
// This is useful if we have enabled reporting of hinted sizes, and want to get
5555
// information from the indexing step for all contexts (especially for testing),
5656
// or have specified a value less than 100% for -memprof-cloning-cold-threshold.
57-
cl::opt<bool> MemProfKeepAllNotColdContexts(
57+
static cl::opt<bool> MemProfKeepAllNotColdContexts(
5858
"memprof-keep-all-not-cold-contexts", cl::init(false), cl::Hidden,
5959
cl::desc("Keep all non-cold contexts (increases cloning overheads)"));
6060

0 commit comments

Comments
 (0)