RFC: Patch for CFA on Darwin

Hello, Bill

The reason for it: when going to calculate the CFA in LLVM, the
original code was adding an offset of type i32 to a pointer. This is
fine if pointers are 32-bits, but we get an assert if the types are
different. By converting the cfa_offset to a pointer, we get it to be
that size.

How do you like the one attached? It seems to be much more clear to fix
codegen :slight_smile: Only slightly tested. If this looks ok to you - I'll commit
tomorrow.

dwarf_cfa.diff (1.41 KB)

Hello, Bill

> The reason for it: when going to calculate the CFA in LLVM, the
> original code was adding an offset of type i32 to a pointer. This is
> fine if pointers are 32-bits, but we get an assert if the types are
> different. By converting the cfa_offset to a pointer, we get it to be
> that size.
How do you like the one attached? It seems to be much more clear to fix
codegen :slight_smile: Only slightly tested. If this looks ok to you - I'll commit
tomorrow.

Hi Anton,

One question, can the offset be >32-bit? If not, then this patch looks
good (though I haven't tested it yet). But if the offset can be

32-bit, then we'll have trouble with the offset being truncated in

the front-end...

-bw