[LLVMdev] CFI Directives

Bill Wendling wendling at apple.com
Thu Sep 5 16:27:44 PDT 2013


Hi Rafael,

I've been staring at the CFI directives and have a question. Some background: I want to generate the compact unwind information using just the CFI directives. I *think* that this should be doable. The issue I'm facing right now is that I need to know how much the stack pointer was adjusted. So when I have something like this:

        .cfi_startproc
Lfunc_begin175:
        pushq   %rbp
Ltmp1532:
        .cfi_def_cfa_offset 16
Ltmp1533:
        .cfi_offset %rbp, -16
        movq    %rsp, %rbp
Ltmp1534:
        .cfi_def_cfa_register %rbp
        pushq   %r15
        pushq   %r14
        pushq   %rbx
        subq    $3224, %rsp             ## imm = 0xC98
Ltmp1535:
        .cfi_offset %rbx, -40
Ltmp1536:
        .cfi_offset %r14, -32
Ltmp1537:
        .cfi_offset %r15, -24

I need to be able to know that `%rsp' was adjusted by 3224. However, there are no CFI directives that encode this information. Is this something which cannot be encoded in CFI? or if it can be, what's the best way?

-bw




More information about the llvm-dev mailing list