mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[DebugInfo] Salvage more in -O builds
Specifically, improved debug info retention in: * tryReplaceRedundantInstructionPair, * splitAggregateLoad, * TempLValueElimination, * Mem2Reg, * ConstantFolding. The changes to Mem2Reg allow debug info to be retained in the case tested by self-nostorage.swift in -O builds, so we have just enabled -O in that file instead of writing a new test for it. We attempted to add a case to salvageDebugInfo for unchecked_enum_data, but it caused crashes in Linux CI that we were not able to reproduce.
This commit is contained in:
@@ -102,6 +102,13 @@ public class Instruction : CustomStringConvertible, Hashable {
|
||||
context.notifyInstructionsChanged()
|
||||
}
|
||||
|
||||
/// Transfer debug info associated with (the result of) this instruction to a
|
||||
/// new `debug_value` instruction before this instruction is deleted.
|
||||
public final func salvageDebugInfo(_ context: some MutatingContext) {
|
||||
BridgedContext.salvageDebugInfo(self.bridged)
|
||||
context.notifyInstructionsChanged()
|
||||
}
|
||||
|
||||
public var mayTrap: Bool { false }
|
||||
|
||||
final public var mayHaveSideEffects: Bool {
|
||||
|
||||
Reference in New Issue
Block a user