mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-08 06:32:24 +00:00
crashing but breaks exception handling. The problem described in PR1224 is that invoke is a terminator that can produce a value. The value may be needed in other blocks. The code that writes to registers values needed in other blocks runs before terminators are lowered (in this case invoke) so asserted because the value was not yet available. The fix that was applied was to do invoke lowering earlier, before writing values to registers. The problem this causes is that the code to copy values to registers can be output after the invoke call. If an exception is raised and control is passed to the landing pad then this copy-code will never execute. If the value is needed in some code path reached via the landing pad then that code will get something bogus. So revert the original fix and simply skip invoke values in the general copying to registers code. Instead copy the invoke value to a register in the invoke lowering code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37567 91177308-0d34-0410-b5e6-96231b3b80d8