[LLVMdev] RFC: Patch for CFA on Darwin

Anton Korobeynikov asl at math.spbu.ru
Thu Aug 23 00:04:49 PDT 2007


Bill,

> The built-in dwarf_cfa doesn't take an argument. It returns a pointer.
Ah. Sorry for confusion:
 gcc's __builtin_draft_cfa doesn't have any argument
 LLVM's eh_dwarf_cfa intrinsic has extra "offset" argument, which is
i32, because we have to propagate some information from GCC to LLVM.

> But there's an offset associated with the CFA. So it looks like LLVM
> is taking the pointer and adding the offset to it to synthesize what
> GCC is doing.
Exactly. The only problem is that offset is platform-dependent and is
available on on gcc side. Thus extra argument of LLVM intrinsic.


> 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...
I expect offset to fit into i32 on every sane platform :) In almost all
cases it should be something like +-4 or +-8.

-- 
With best regards, Anton Korobeynikov.

Faculty of Mathematics & Mechanics, Saint Petersburg State University.





More information about the llvm-dev mailing list