Skip to content

Commit 10dd581

Browse files
committed
NFC: [TypeLowering] Add flag to skip verify.
To allow skipping it when verification has a false positive.
1 parent 187f434 commit 10dd581

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/SIL/IR/TypeLowering.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ llvm::cl::opt<bool> TypeLoweringForceOpaqueValueLowering(
5454
llvm::cl::desc("Force TypeLowering to behave as if building with opaque "
5555
"values enabled"));
5656

57+
llvm::cl::opt<bool> TypeLoweringDisableVerification(
58+
"type-lowering-disable-verification", llvm::cl::init(false),
59+
llvm::cl::desc("Disable the asserts-only verification of lowerings"));
60+
5761
namespace {
5862
/// A CRTP type visitor for deciding whether the metatype for a type
5963
/// is a singleton type, i.e. whether there can only ever be one
@@ -2945,6 +2949,9 @@ void TypeConverter::verifyLowering(const TypeLowering &lowering,
29452949
AbstractionPattern origType,
29462950
CanType substType,
29472951
TypeExpansionContext forExpansion) {
2952+
if (TypeLoweringDisableVerification) {
2953+
return;
2954+
}
29482955
verifyLexicalLowering(lowering, origType, substType, forExpansion);
29492956
verifyTrivialLowering(lowering, origType, substType, forExpansion);
29502957
}

0 commit comments

Comments
 (0)