mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +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")
|
"Split all Critical Edges in the SIL CFG")
|
||||||
LEGACY_PASS(SplitNonCondBrCriticalEdges, "split-non-cond_br-critical-edges",
|
LEGACY_PASS(SplitNonCondBrCriticalEdges, "split-non-cond_br-critical-edges",
|
||||||
"Split all Critical Edges not from SIL cond_br")
|
"Split all Critical Edges not from SIL cond_br")
|
||||||
LEGACY_PASS(StripDebugInfo, "strip-debug-info",
|
|
||||||
"Strip Debug Information")
|
|
||||||
LEGACY_PASS(StringOptimization, "string-optimization",
|
LEGACY_PASS(StringOptimization, "string-optimization",
|
||||||
"Optimization for String operations")
|
"Optimization for String operations")
|
||||||
LEGACY_PASS(SwiftArrayPropertyOpt, "array-property-opt",
|
LEGACY_PASS(SwiftArrayPropertyOpt, "array-property-opt",
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ target_sources(swiftSILOptimizer PRIVATE
|
|||||||
SILDebugInfoGenerator.cpp
|
SILDebugInfoGenerator.cpp
|
||||||
SILSkippingChecker.cpp
|
SILSkippingChecker.cpp
|
||||||
SimplifyUnreachableContainingBlocks.cpp
|
SimplifyUnreachableContainingBlocks.cpp
|
||||||
StripDebugInfo.cpp
|
|
||||||
TestRunner.cpp
|
TestRunner.cpp
|
||||||
OwnershipDumper.cpp
|
OwnershipDumper.cpp
|
||||||
OwnershipVerifierTextualErrorDumper.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')
|
SpeculativeDevirtualizer = Pass('SpeculativeDevirtualizer')
|
||||||
SplitAllCriticalEdges = Pass('SplitAllCriticalEdges')
|
SplitAllCriticalEdges = Pass('SplitAllCriticalEdges')
|
||||||
SplitNonCondBrCriticalEdges = Pass('SplitNonCondBrCriticalEdges')
|
SplitNonCondBrCriticalEdges = Pass('SplitNonCondBrCriticalEdges')
|
||||||
StripDebugInfo = Pass('StripDebugInfo')
|
|
||||||
SwiftArrayOpts = Pass('SwiftArrayOpts')
|
SwiftArrayOpts = Pass('SwiftArrayOpts')
|
||||||
|
|
||||||
PASSES = [
|
PASSES = [
|
||||||
@@ -97,6 +96,5 @@ PASSES = [
|
|||||||
SpeculativeDevirtualizer,
|
SpeculativeDevirtualizer,
|
||||||
SplitAllCriticalEdges,
|
SplitAllCriticalEdges,
|
||||||
SplitNonCondBrCriticalEdges,
|
SplitNonCondBrCriticalEdges,
|
||||||
StripDebugInfo,
|
|
||||||
SwiftArrayOpts,
|
SwiftArrayOpts,
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user