mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +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:
@@ -1534,6 +1534,7 @@ struct BridgedContext {
|
||||
BRIDGED_INLINE void eraseBlock(BridgedBasicBlock block) const;
|
||||
static BRIDGED_INLINE void moveInstructionBefore(BridgedInstruction inst, BridgedInstruction beforeInst);
|
||||
static BRIDGED_INLINE void copyInstructionBefore(BridgedInstruction inst, BridgedInstruction beforeInst);
|
||||
static BRIDGED_INLINE void salvageDebugInfo(BridgedInstruction inst);
|
||||
|
||||
// SSAUpdater
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#include "swift/SIL/SILVTable.h"
|
||||
#include "swift/SIL/SILWitnessTable.h"
|
||||
#include "swift/SILOptimizer/Utils/ConstExpr.h"
|
||||
#include "swift/SILOptimizer/Utils/DebugOptUtils.h"
|
||||
#include "swift/SIL/SILConstants.h"
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
@@ -3129,6 +3130,10 @@ void BridgedContext::copyInstructionBefore(BridgedInstruction inst, BridgedInstr
|
||||
inst.unbridged()->clone(beforeInst.unbridged());
|
||||
}
|
||||
|
||||
void BridgedContext::salvageDebugInfo(BridgedInstruction inst) {
|
||||
swift::salvageDebugInfo(inst.unbridged());
|
||||
}
|
||||
|
||||
OptionalBridgedFunction BridgedContext::lookupStdlibFunction(BridgedStringRef name) const {
|
||||
return {context->lookupStdlibFunction(name.unbridged())};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user