[LLVMdev] DW_AT_inline not present in assembly for an inlined inline function

anonymous aspiringllvmdeveloper at gmail.com
Fri Feb 24 06:17:51 PST 2012


Hello

I am trying to run following test case on Clang compiled output to compare
the dwarf inline attributes in the resulting assembly output .

/* Inlined inline function must have abstract DIE  */
/* { dg-do compile } */
/* { dg-options "-O2 -gdwarf-2 -dA -fpreprocessed" } */
/* { dg-final { scan-assembler "3.*DW_AT_inline" } } */
#1 "test.h"
inline int t()
{
}
int q()
{
  t();
}

The testcase fails because, DW_AT_inline is not present in assembly output.
Could anyone let me know why DW_AT_inline is not emitted with Clang
compiled assembly output?
I am aware that Clang uses C99 mode by default.

In case of GCC,
.uleb128 0x2    @ (DIE (0x25) DW_TAG_subprogram)
        .byte   0x1     @ DW_AT_external
        .ascii "t\0"    @ DW_AT_name
        .byte   0x1     @ DW_AT_decl_file (test.h)
        .byte   0x1     @ DW_AT_decl_line
        .4byte  0x30    @ DW_AT_type
        .byte   0x3     @ DW_AT_inline

In case of Clang,
.byte   4                       @ Abbrev [4] 0x87:0xa DW_TAG_subprogram
        .byte   116                     @ DW_AT_name
        .byte   0
        .byte   2                       @ DW_AT_decl_file
        .byte   2                       @ DW_AT_decl_line
        .long   128                     @ DW_AT_type
        .byte   1                       @ DW_AT_external
        .byte   0                       @ End Of Children Mark

Is this a bug in LLVM ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120224/ced96b14/attachment.html>


More information about the llvm-dev mailing list