Skip to content

Commit 16bb57e

Browse files
authored
Merge pull request swiftlang#35083 from atrick/sil-verify-none
Add -sil-verify-all and -sil-verify-none to the sil-opt tool.
2 parents 0557e74 + dbd5b27 commit 16bb57e

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

tools/sil-opt/SILOpt.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,25 @@ static llvm::cl::opt<int>
184184
SILInlineThreshold("sil-inline-threshold", llvm::cl::Hidden,
185185
llvm::cl::init(-1));
186186

187+
// Legacy option name still in use. The frontend uses -sil-verify-all.
187188
static llvm::cl::opt<bool>
188189
EnableSILVerifyAll("enable-sil-verify-all",
189190
llvm::cl::Hidden,
190191
llvm::cl::init(true),
191192
llvm::cl::desc("Run sil verifications after every pass."));
192193

194+
static llvm::cl::opt<bool>
195+
SILVerifyAll("sil-verify-all",
196+
llvm::cl::Hidden,
197+
llvm::cl::init(true),
198+
llvm::cl::desc("Run sil verifications after every pass."));
199+
200+
static llvm::cl::opt<bool>
201+
SILVerifyNone("sil-verify-none",
202+
llvm::cl::Hidden,
203+
llvm::cl::init(false),
204+
llvm::cl::desc("Completely disable SIL verification"));
205+
193206
static llvm::cl::opt<bool>
194207
RemoveRuntimeAsserts("remove-runtime-asserts",
195208
llvm::cl::Hidden,
@@ -381,7 +394,8 @@ int main(int argc, char **argv) {
381394
// Setup the SIL Options.
382395
SILOptions &SILOpts = Invocation.getSILOptions();
383396
SILOpts.InlineThreshold = SILInlineThreshold;
384-
SILOpts.VerifyAll = EnableSILVerifyAll;
397+
SILOpts.VerifyAll = SILVerifyAll || EnableSILVerifyAll;
398+
SILOpts.VerifyNone = SILVerifyNone;
385399
SILOpts.RemoveRuntimeAsserts = RemoveRuntimeAsserts;
386400
SILOpts.AssertConfig = AssertConfId;
387401
if (OptimizationGroup != OptGroup::Diagnostics)

0 commit comments

Comments
 (0)