mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[NFC][SILOptimizer]: remove seemingly unused StripDebugInfo pass
This commit is contained in:
@@ -434,8 +434,6 @@ LEGACY_PASS(SplitAllCriticalEdges, "split-critical-edges",
|
||||
"Split all Critical Edges in the SIL CFG")
|
||||
LEGACY_PASS(SplitNonCondBrCriticalEdges, "split-non-cond_br-critical-edges",
|
||||
"Split all Critical Edges not from SIL cond_br")
|
||||
LEGACY_PASS(StripDebugInfo, "strip-debug-info",
|
||||
"Strip Debug Information")
|
||||
LEGACY_PASS(StringOptimization, "string-optimization",
|
||||
"Optimization for String operations")
|
||||
LEGACY_PASS(SwiftArrayPropertyOpt, "array-property-opt",
|
||||
|
||||
@@ -27,7 +27,6 @@ target_sources(swiftSILOptimizer PRIVATE
|
||||
SILDebugInfoGenerator.cpp
|
||||
SILSkippingChecker.cpp
|
||||
SimplifyUnreachableContainingBlocks.cpp
|
||||
StripDebugInfo.cpp
|
||||
TestRunner.cpp
|
||||
OwnershipDumper.cpp
|
||||
OwnershipVerifierTextualErrorDumper.cpp)
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
//===--- StripDebugInfo.cpp - Strip debug info from SIL -------------------===//
|
||||
//
|
||||
// This source file is part of the Swift.org open source project
|
||||
//
|
||||
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
|
||||
// Licensed under Apache License v2.0 with Runtime Library Exception
|
||||
//
|
||||
// See https://swift.org/LICENSE.txt for license information
|
||||
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "swift/SILOptimizer/PassManager/Passes.h"
|
||||
#include "swift/SILOptimizer/PassManager/Transforms.h"
|
||||
#include "swift/SIL/SILInstruction.h"
|
||||
#include "swift/SIL/SILModule.h"
|
||||
#include "swift/SIL/SILFunction.h"
|
||||
|
||||
|
||||
using namespace swift;
|
||||
|
||||
static void stripFunction(SILFunction *F) {
|
||||
for (auto &BB : *F)
|
||||
for (auto II = BB.begin(), IE = BB.end(); II != IE;) {
|
||||
SILInstruction *Inst = &*II;
|
||||
++II;
|
||||
|
||||
if (!isa<DebugValueInst>(Inst))
|
||||
continue;
|
||||
|
||||
Inst->eraseFromParent();
|
||||
}
|
||||
}
|
||||
|
||||
namespace {
|
||||
class StripDebugInfo : public swift::SILFunctionTransform {
|
||||
~StripDebugInfo() override {}
|
||||
|
||||
/// The entry point to the transformation.
|
||||
void run() override {
|
||||
stripFunction(getFunction());
|
||||
invalidateAnalysis(SILAnalysis::InvalidationKind::Instructions);
|
||||
}
|
||||
|
||||
};
|
||||
} // end anonymous namespace
|
||||
|
||||
|
||||
SILTransform *swift::createStripDebugInfo() {
|
||||
return new StripDebugInfo();
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
// RUN: %target-sil-opt -enable-sil-verify-all -strip-debug-info %s | %FileCheck %s
|
||||
|
||||
sil_stage canonical
|
||||
|
||||
import Swift
|
||||
import Builtin
|
||||
|
||||
// CHECK-LABEL: sil @test
|
||||
// CHECK: bb0
|
||||
// CHECK-NEXT: tuple
|
||||
// CHECK-NEXT: return
|
||||
sil @test : $@convention(thin) <T> (@inout T, Builtin.Int64) -> () {
|
||||
bb0(%0 : $*T, %1 : $Builtin.Int64):
|
||||
debug_value %0 : $*T, expr op_deref
|
||||
debug_value %1 : $Builtin.Int64
|
||||
%2 = tuple ()
|
||||
return %2 : $()
|
||||
}
|
||||
@@ -48,7 +48,6 @@ SimplifyCFG = Pass('SimplifyCFG')
|
||||
SpeculativeDevirtualizer = Pass('SpeculativeDevirtualizer')
|
||||
SplitAllCriticalEdges = Pass('SplitAllCriticalEdges')
|
||||
SplitNonCondBrCriticalEdges = Pass('SplitNonCondBrCriticalEdges')
|
||||
StripDebugInfo = Pass('StripDebugInfo')
|
||||
SwiftArrayOpts = Pass('SwiftArrayOpts')
|
||||
|
||||
PASSES = [
|
||||
@@ -97,6 +96,5 @@ PASSES = [
|
||||
SpeculativeDevirtualizer,
|
||||
SplitAllCriticalEdges,
|
||||
SplitNonCondBrCriticalEdges,
|
||||
StripDebugInfo,
|
||||
SwiftArrayOpts,
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user