Skip to content
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
18 changes: 9 additions & 9 deletions llvm/examples/Kaleidoscope/MCJIT/cached/toy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ using namespace llvm;
// Command-line options
//===----------------------------------------------------------------------===//

cl::opt<std::string>
InputIR("input-IR",
cl::desc("Specify the name of an IR file to load for function definitions"),
cl::value_desc("input IR file name"));

cl::opt<bool>
UseObjectCache("use-object-cache",
cl::desc("Enable use of the MCJIT object caching"),
cl::init(false));
static cl::opt<std::string> InputIR(
"input-IR",
cl::desc("Specify the name of an IR file to load for function definitions"),
cl::value_desc("input IR file name"));

static cl::opt<bool>
UseObjectCache("use-object-cache",
cl::desc("Enable use of the MCJIT object caching"),
cl::init(false));

//===----------------------------------------------------------------------===//
// Lexer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ using namespace llvm::orc;

ExitOnError ExitOnErr;

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

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

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

int main(int argc, char *argv[]) {
// Initialize LLVM.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ static void reportErrorAndExit() {
exit(1);
}

cl::list<std::string> InputArgv(cl::Positional,
cl::desc("<program arguments>..."));
static cl::list<std::string> InputArgv(cl::Positional,
cl::desc("<program arguments>..."));

int main(int argc, char *argv[]) {
// Initialize LLVM.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ const llvm::StringRef MainMod =
declare i32 @bar()
)";

cl::list<std::string> InputArgv(cl::Positional,
cl::desc("<program arguments>..."));
static cl::list<std::string> InputArgv(cl::Positional,
cl::desc("<program arguments>..."));

int main(int argc, char *argv[]) {
// Initialize LLVM.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ using namespace llvm;
using namespace llvm::orc;

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

// Describe a fail state that is caused by the given ModuleSummaryIndex
// providing multiple definitions of the given global value name. It will dump
Expand Down
5 changes: 2 additions & 3 deletions llvm/lib/Analysis/AliasAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,10 @@ STATISTIC(NumNoAlias, "Number of NoAlias results");
STATISTIC(NumMayAlias, "Number of MayAlias results");
STATISTIC(NumMustAlias, "Number of MustAlias results");

namespace llvm {
/// Allow disabling BasicAA from the AA results. This is particularly useful
/// when testing to isolate a single AA implementation.
cl::opt<bool> DisableBasicAA("disable-basic-aa", cl::Hidden, cl::init(false));
} // namespace llvm
static cl::opt<bool> DisableBasicAA("disable-basic-aa", cl::Hidden,
cl::init(false));

#ifndef NDEBUG
/// Print a trace of alias analysis queries and their results.
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Analysis/BranchProbabilityInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static cl::opt<bool> PrintBranchProb(
"print-bpi", cl::init(false), cl::Hidden,
cl::desc("Print the branch probability info."));

cl::opt<std::string> PrintBranchProbFuncName(
static cl::opt<std::string> PrintBranchProbFuncName(
"print-bpi-func-name", cl::Hidden,
cl::desc("The option to specify the name of the function "
"whose branch probability info is printed."));
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ cl::opt<bool> EnableDetailedFunctionProperties(
"enable-detailed-function-properties", cl::Hidden, cl::init(false),
cl::desc("Whether or not to compute detailed function properties."));

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

cl::opt<unsigned> MediumBasicBlockInstructionThreshold(
static cl::opt<unsigned> MediumBasicBlockInstructionThreshold(
"medium-basic-block-instruction-threshold", cl::Hidden, cl::init(15),
cl::desc("The minimum number of instructions a basic block should contain "
"before being considered medium-sized."));
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Analysis/IRSimilarityIdentifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ cl::opt<bool>
cl::ReallyHidden,
cl::desc("disable outlining indirect calls."));

cl::opt<bool>
static cl::opt<bool>
MatchCallsByName("ir-sim-calls-by-name", cl::init(false), cl::ReallyHidden,
cl::desc("only allow matching call instructions if the "
"name and type signature match."));
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Analysis/InlineSizeEstimatorAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ AnalysisKey InlineSizeEstimatorAnalysis::Key;
#include <deque>
#include <optional>

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

Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Analysis/MemoryProfileInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ cl::opt<bool> MemProfReportHintedSizes(
// This is useful if we have enabled reporting of hinted sizes, and want to get
// information from the indexing step for all contexts (especially for testing),
// or have specified a value less than 100% for -memprof-cloning-cold-threshold.
cl::opt<bool> MemProfKeepAllNotColdContexts(
static cl::opt<bool> MemProfKeepAllNotColdContexts(
"memprof-keep-all-not-cold-contexts", cl::init(false), cl::Hidden,
cl::desc("Keep all non-cold contexts (increases cloning overheads)"));

Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/CGData/CodeGenData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
using namespace llvm;
using namespace cgdata;

cl::opt<bool>
static cl::opt<bool>
CodeGenDataGenerate("codegen-data-generate", cl::init(false), cl::Hidden,
cl::desc("Emit CodeGen Data into custom sections"));
cl::opt<std::string>
static cl::opt<std::string>
CodeGenDataUsePath("codegen-data-use-path", cl::init(""), cl::Hidden,
cl::desc("File path to where .cgdata file is read"));
cl::opt<bool> CodeGenDataThinLTOTwoRounds(
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
using namespace llvm;

/// Query value using AddLinkageNamesToDeclCallOriginsForTuning.
cl::opt<cl::boolOrDefault> AddLinkageNamesToDeclCallOrigins(
static cl::opt<cl::boolOrDefault> AddLinkageNamesToDeclCallOrigins(
"add-linkage-names-to-declaration-call-origins", cl::Hidden,
cl::desc("Add DW_AT_linkage_name to function declaration DIEs "
"referenced by DW_AT_call_origin attributes. Enabled by default "
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/MachinePipeliner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ cl::opt<int> SwpForceIssueWidth(
cl::init(-1));

/// A command line argument to set the window scheduling option.
cl::opt<WindowSchedulingFlag> WindowSchedulingOption(
static cl::opt<WindowSchedulingFlag> WindowSchedulingOption(
"window-sched", cl::Hidden, cl::init(WindowSchedulingFlag::WS_On),
cl::desc("Set how to use window scheduling algorithm."),
cl::values(clEnumValN(WindowSchedulingFlag::WS_Off, "off",
Expand Down
8 changes: 4 additions & 4 deletions llvm/lib/CodeGen/MachineScheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ cl::opt<MISched::Direction> PreRADirection(
clEnumValN(MISched::Bidirectional, "bidirectional",
"Force bidirectional pre reg-alloc list scheduling")));

cl::opt<MISched::Direction> PostRADirection(
static cl::opt<MISched::Direction> PostRADirection(
"misched-postra-direction", cl::Hidden,
cl::desc("Post reg-alloc list scheduling direction"),
cl::init(MISched::Unspecified),
Expand All @@ -102,9 +102,9 @@ cl::opt<MISched::Direction> PostRADirection(
clEnumValN(MISched::Bidirectional, "bidirectional",
"Force bidirectional post reg-alloc list scheduling")));

cl::opt<bool>
DumpCriticalPathLength("misched-dcpl", cl::Hidden,
cl::desc("Print critical path length to stdout"));
static cl::opt<bool>
DumpCriticalPathLength("misched-dcpl", cl::Hidden,
cl::desc("Print critical path length to stdout"));

cl::opt<bool> VerifyScheduling(
"verify-misched", cl::Hidden,
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/WindowScheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ cl::opt<unsigned> WindowDiffLimit(

// WindowIILimit serves as an indicator of abnormal scheduling results and could
// potentially be referenced by the derived target window scheduler.
cl::opt<unsigned>
static cl::opt<unsigned>
WindowIILimit("window-ii-limit",
cl::desc("The upper limit of II in the window algorithm."),
cl::Hidden, cl::init(1000));
Expand Down
13 changes: 6 additions & 7 deletions llvm/lib/LTO/LTOCodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,21 +109,20 @@ cl::opt<std::string> RemarksFormat(
cl::desc("The format used for serializing remarks (default: YAML)"),
cl::value_desc("format"), cl::init("yaml"));

cl::opt<std::string> LTOStatsFile(
"lto-stats-file",
cl::desc("Save statistics to the specified file"),
cl::Hidden);
static cl::opt<std::string>
LTOStatsFile("lto-stats-file",
cl::desc("Save statistics to the specified file"), cl::Hidden);

cl::opt<std::string> AIXSystemAssemblerPath(
static cl::opt<std::string> AIXSystemAssemblerPath(
"lto-aix-system-assembler",
cl::desc("Path to a system assembler, picked up on AIX only"),
cl::value_desc("path"));

cl::opt<bool>
static cl::opt<bool>
LTORunCSIRInstr("cs-profile-generate",
cl::desc("Perform context sensitive PGO instrumentation"));

cl::opt<std::string>
static cl::opt<std::string>
LTOCSIRProfile("cs-profile-path",
cl::desc("Context sensitive profile file path"));
} // namespace llvm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ using namespace llvm;
#define AARCH64_LOWER_HOMOGENEOUS_PROLOG_EPILOG_NAME \
"AArch64 homogeneous prolog/epilog lowering pass"

cl::opt<int> FrameHelperSizeThreshold(
static cl::opt<int> FrameHelperSizeThreshold(
"frame-helper-size-threshold", cl::init(2), cl::Hidden,
cl::desc("The minimum number of instructions that are outlined in a frame "
"helper (default = 2)"));
Expand Down
5 changes: 2 additions & 3 deletions llvm/lib/Target/AArch64/AArch64StackTaggingPreRA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ using namespace llvm;

enum UncheckedLdStMode { UncheckedNever, UncheckedSafe, UncheckedAlways };

cl::opt<UncheckedLdStMode> ClUncheckedLdSt(
"stack-tagging-unchecked-ld-st", cl::Hidden,
cl::init(UncheckedSafe),
static cl::opt<UncheckedLdStMode> ClUncheckedLdSt(
"stack-tagging-unchecked-ld-st", cl::Hidden, cl::init(UncheckedSafe),
cl::desc(
"Unconditionally apply unchecked-ld-st optimization (even for large "
"stack frames, or in the presence of variable sized allocas)."),
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ class TailFoldingOption {

TailFoldingOption TailFoldingOptionLoc;

cl::opt<TailFoldingOption, true, cl::parser<std::string>> SVETailFolding(
static cl::opt<TailFoldingOption, true, cl::parser<std::string>> SVETailFolding(
"sve-tail-folding",
cl::desc(
"Control the use of vectorisation using tail-folding for SVE where the"
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ using namespace llvm;

#define DEBUG_TYPE "arm-selectiondag-info"

cl::opt<TPLoop::MemTransfer> EnableMemtransferTPLoop(
static cl::opt<TPLoop::MemTransfer> EnableMemtransferTPLoop(
"arm-memtransfer-tploop", cl::Hidden,
cl::desc("Control conversion of memcpy to "
"Tail predicated loops (WLSTP)"),
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/ARM/MVELaneInterleavingPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ using namespace llvm;

#define DEBUG_TYPE "mve-laneinterleave"

cl::opt<bool> EnableInterleave(
static cl::opt<bool> EnableInterleave(
"enable-mve-interleave", cl::Hidden, cl::init(true),
cl::desc("Enable interleave MVE vector operation lowering"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ cl::opt<bool> MV79("mv79", cl::Hidden, cl::desc("Build for Hexagon V79"),
cl::init(false));
} // namespace

cl::opt<Hexagon::ArchEnum> EnableHVX(
static cl::opt<Hexagon::ArchEnum> EnableHVX(
"mhvx", cl::desc("Enable Hexagon Vector eXtensions"),
cl::values(clEnumValN(Hexagon::ArchEnum::V60, "v60", "Build for HVX v60"),
clEnumValN(Hexagon::ArchEnum::V62, "v62", "Build for HVX v62"),
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ using namespace llvm;

// This disables the removal of registers when lowering into MC, as required
// by some current tests.
cl::opt<bool>
static cl::opt<bool>
WasmKeepRegisters("wasm-keep-registers", cl::Hidden,
cl::desc("WebAssembly: output stack registers in"
" instruction output for test purposes only."),
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/IPO/ElimAvailExtern.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ using namespace llvm;

#define DEBUG_TYPE "elim-avail-extern"

cl::opt<bool> ConvertToLocal(
static cl::opt<bool> ConvertToLocal(
"avail-extern-to-local", cl::Hidden,
cl::desc("Convert available_externally into locals, renaming them "
"to avoid link-time clashes."));
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ cl::opt<bool> SupportsHotColdNew(
"supports-hot-cold-new", cl::init(false), cl::Hidden,
cl::desc("Linking with hot/cold operator new interfaces"));

cl::opt<bool> MemProfRequireDefinitionForPromotion(
static cl::opt<bool> MemProfRequireDefinitionForPromotion(
"memprof-require-definition-for-promotion", cl::init(false), cl::Hidden,
cl::desc(
"Require target function definition when promoting indirect calls"));
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/IPO/ModuleInliner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ using namespace llvm;
STATISTIC(NumInlined, "Number of functions inlined");
STATISTIC(NumDeleted, "Number of functions deleted because all callers found");

cl::opt<bool> CtxProfPromoteAlwaysInline(
static cl::opt<bool> CtxProfPromoteAlwaysInline(
"ctx-prof-promote-alwaysinline", cl::init(false), cl::Hidden,
cl::desc("If using a contextual profile in this module, and an indirect "
"call target is marked as alwaysinline, perform indirect call "
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/Scalar/LICM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ static cl::opt<unsigned> FPAssociationUpperLimit(
"Set upper limit for the number of transformations performed "
"during a single round of hoisting the reassociated expressions."));

cl::opt<unsigned> IntAssociationUpperLimit(
static cl::opt<unsigned> IntAssociationUpperLimit(
"licm-max-num-int-reassociations", cl::init(5U), cl::Hidden,
cl::desc(
"Set upper limit for the number of transformations performed "
Expand Down
4 changes: 1 addition & 3 deletions llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,10 @@ AllowStridedPointerIVs("lv-strided-pointer-ivs", cl::init(false), cl::Hidden,
cl::desc("Enable recognition of non-constant strided "
"pointer induction variables."));

namespace llvm {
cl::opt<bool>
static cl::opt<bool>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should pull these out of the namespace to be with the other opts. I assume the intent was these should be exposed at some point?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, does @jurahul have any thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, we should pull them out of the namespace

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every option inside all namespaces?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general yes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've checked the 52 changed files and take those inside llvm namespace out

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since some options are prefixed with namespace when used, this causes issues if I move them out. I'll just leave those as they are.

HintsAllowReordering("hints-allow-reordering", cl::init(true), cl::Hidden,
cl::desc("Allow enabling loop hints to reorder "
"FP operations during vectorization."));
} // namespace llvm

// TODO: Move size-based thresholds out of legality checking, make cost based
// decisions instead of hard thresholds.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@
using namespace llvm;
namespace llvm::sandboxir {

cl::opt<unsigned> SeedBundleSizeLimit(
static cl::opt<unsigned> SeedBundleSizeLimit(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are under the namespace but it doesn't really matter

"sbvec-seed-bundle-size-limit", cl::init(32), cl::Hidden,
cl::desc("Limit the size of the seed bundle to cap compilation time."));
#define LoadSeedsDef "loads"
#define StoreSeedsDef "stores"
cl::opt<std::string> CollectSeeds(
static cl::opt<std::string> CollectSeeds(
"sbvec-collect-seeds", cl::init(LoadSeedsDef "," StoreSeedsDef), cl::Hidden,
cl::desc("Collect these seeds. Use empty for none or a comma-separated "
"list of '" LoadSeedsDef "' and '" StoreSeedsDef "'."));
cl::opt<unsigned> SeedGroupsLimit(
static cl::opt<unsigned> SeedGroupsLimit(
"sbvec-seed-groups-limit", cl::init(256), cl::Hidden,
cl::desc("Limit the number of collected seeds groups in a BB to "
"cap compilation time."));
Expand Down
4 changes: 2 additions & 2 deletions llvm/tools/bugpoint/ExecutionDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ cl::opt<std::string>
InputFile("input", cl::init("/dev/null"),
cl::desc("Filename to pipe in as stdin (default: /dev/null)"));

cl::list<std::string>
static cl::list<std::string>
AdditionalSOs("additional-so", cl::desc("Additional shared objects to load "
"into executing programs"));

cl::list<std::string> AdditionalLinkerArgs(
static cl::list<std::string> AdditionalLinkerArgs(
"Xlinker", cl::desc("Additional arguments to pass to the linker"));

cl::opt<std::string> CustomCompileCommand(
Expand Down
2 changes: 1 addition & 1 deletion llvm/tools/bugpoint/OptimizerDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void BugDriver::EmitProgressBitcode(const Module &M, const std::string &ID,
outs() << " " << getPassesString(PassesToRun) << "\n";
}

cl::opt<bool> SilencePasses(
static cl::opt<bool> SilencePasses(
"silence-passes",
cl::desc("Suppress output of running passes (both stdout and stderr)"));

Expand Down
Loading