Skip to content

Commit d6e5b14

Browse files
authored
[NFC][opt] Improve help message (#97805)
This patch changes all single quotes in the help text to double quotes for the sake of cross platform correctness. The single quotes previously used in the help message are correct for bash and most other shells but aren't correct for the Windows command prompt as it only interprets double quotes in the manner intended in the help message. This patch was prompted by the fact that if you aren't aware of the aformentioned quirk the single quotes result in very confusing error messages from the command prompt.
1 parent 959ff45 commit d6e5b14

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

llvm/tools/opt/optdriver.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static codegen::RegisterCodeGenFlags CFG;
6868
// The OptimizationList is automatically populated with registered Passes by the
6969
// PassNameParser.
7070
static cl::list<const PassInfo *, bool, PassNameParser> PassList(cl::desc(
71-
"Optimizations available (use '-passes=' for the new pass manager)"));
71+
"Optimizations available (use \"-passes=\" for the new pass manager)"));
7272

7373
static cl::opt<bool> EnableLegacyPassManager(
7474
"bugpoint-enable-legacy-pm",
@@ -85,7 +85,7 @@ static cl::opt<std::string> PassPipeline(
8585
"passes",
8686
cl::desc(
8787
"A textual description of the pass pipeline. To have analysis passes "
88-
"available before a certain pass, add 'require<foo-analysis>'."));
88+
"available before a certain pass, add \"require<foo-analysis>\"."));
8989
static cl::alias PassPipeline2("p", cl::aliasopt(PassPipeline),
9090
cl::desc("Alias for -passes"));
9191

@@ -154,28 +154,28 @@ static cl::opt<bool>
154154

155155
static cl::opt<bool>
156156
OptLevelO0("O0", cl::desc("Optimization level 0. Similar to clang -O0. "
157-
"Same as -passes='default<O0>'"));
157+
"Same as -passes=\"default<O0>\""));
158158

159159
static cl::opt<bool>
160160
OptLevelO1("O1", cl::desc("Optimization level 1. Similar to clang -O1. "
161-
"Same as -passes='default<O1>'"));
161+
"Same as -passes=\"default<O1>\""));
162162

163163
static cl::opt<bool>
164164
OptLevelO2("O2", cl::desc("Optimization level 2. Similar to clang -O2. "
165-
"Same as -passes='default<O2>'"));
165+
"Same as -passes=\"default<O2>\""));
166166

167167
static cl::opt<bool>
168168
OptLevelOs("Os", cl::desc("Like -O2 but size-conscious. Similar to clang "
169-
"-Os. Same as -passes='default<Os>'"));
169+
"-Os. Same as -passes=\"default<Os>\""));
170170

171171
static cl::opt<bool> OptLevelOz(
172172
"Oz",
173173
cl::desc("Like -O2 but optimize for code size above all else. Similar to "
174-
"clang -Oz. Same as -passes='default<Oz>'"));
174+
"clang -Oz. Same as -passes=\"default<Oz>\""));
175175

176176
static cl::opt<bool>
177177
OptLevelO3("O3", cl::desc("Optimization level 3. Similar to clang -O3. "
178-
"Same as -passes='default<O3>'"));
178+
"Same as -passes=\"default<O3>\""));
179179

180180
static cl::opt<unsigned> CodeGenOptLevelCL(
181181
"codegen-opt-level",

0 commit comments

Comments
 (0)