mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[DebugInfo] Improve stepping behavior for switch case stmts
Assign the location of a switch statement's subject expression to all of its case statements. This improves the debugger's stepping behavior in switch statements. Stepping into a switch now goes directly to the first matching case (possibly one with a `where` clause that may or may not match). It's still possible to set breakpoints within `where` clauses. rdar://35628672
This commit is contained in:
committed by
Vedant Kumar
parent
a0d9c2371a
commit
f9372fdb62
@@ -521,3 +521,20 @@ void SILBuilder::emitShallowDestructureAddressOperation(
|
||||
return P.createAddressProjection(*this, Loc, V).get();
|
||||
});
|
||||
}
|
||||
|
||||
DebugValueInst *SILBuilder::createDebugValue(SILLocation Loc, SILValue src,
|
||||
SILDebugVariable Var) {
|
||||
// Debug location overrides cannot apply to debug value instructions.
|
||||
DebugLocOverrideRAII LocOverride{*this, None};
|
||||
return insert(
|
||||
DebugValueInst::create(getSILDebugLocation(Loc), src, getModule(), Var));
|
||||
}
|
||||
|
||||
DebugValueAddrInst *SILBuilder::createDebugValueAddr(SILLocation Loc,
|
||||
SILValue src,
|
||||
SILDebugVariable Var) {
|
||||
// Debug location overrides cannot apply to debug addr instructions.
|
||||
DebugLocOverrideRAII LocOverride{*this, None};
|
||||
return insert(DebugValueAddrInst::create(getSILDebugLocation(Loc), src,
|
||||
getModule(), Var));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user