Skip to content

Commit 9b3206f

Browse files
committed
Add flag that exists on swift-5.1-branch
1 parent 311edcf commit 9b3206f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/SILOptimizer/Transforms/SpecializeOpaqueArchetypes.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
#include "swift/SILOptimizer/PassManager/Transforms.h"
2424
#include "swift/SILOptimizer/Utils/CFG.h"
2525

26+
#include "llvm/Support/CommandLine.h"
27+
28+
llvm::cl::opt<bool>
29+
EnableOpaqueArchetypeSpecializer("enable-opaque-archetype-specializer",
30+
llvm::cl::init(true));
2631

2732
using namespace swift;
2833

@@ -459,6 +464,9 @@ void OpaqueSpecializerCloner::insertOpaqueToConcreteAddressCasts(
459464
namespace {
460465
class OpaqueArchetypeSpecializer : public SILFunctionTransform {
461466
void run() override {
467+
if (!EnableOpaqueArchetypeSpecializer)
468+
return;
469+
462470
auto *context = getFunction();
463471

464472
if (!context->shouldOptimize())

0 commit comments

Comments
 (0)