mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
`salvageDebugInfo` is called during SIL Mem2Reg and could produce misleading debug info in the following case: ``` %a = alloc_stack $MyModel.TangentVector, var, name "self", argno 1, implicit, loc "debug2.swift":37:17 ... ... store %b to %a : $*MyModel.TangentVector ``` Such SIL could be created as a result of inlining (where store comes from the inlined function). Before this patch we'd end with `debug_value` instruction with variable information, but without or incorrect location. This caused LLVM IR debug info verifier assertions when there might be another instruction with complete debug info (including location) for the same argument. After this patch we always reuse it from destination alloca Fixes #58660
2.0 KiB
2.0 KiB