[llvm-commits] [llvm] r55962 - /llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Dale Johannesen dalej at apple.com
Mon Sep 8 15:06:25 PDT 2008


On Sep 8, 2008, at 2:58 PMPDT, Anton Korobeynikov wrote:

> Hi Dale,
>
>> Don't suppress no-dead-strip for used static functions.
> This contradicts with the comment of function. Please update it. Also,
> it seems, that gcc (at least, apple gcc 4.0.1) does not look to
> linkage in this such situation at all:
>
> void bar();
>
> static int __attribute__((used)) a;

Thanks, you are right.  gcc does suppress the directive in some cases  
involving ObjC metadata,
which is what I was trying to fix originally (the used attribute is  
created internally).
Evidently linkage is not the right thing to look at.  I'll fix it.

> static void __attribute__((used)) foo()  {
>  bar();
> }
>
> compiles into:
>
>        .text
>        .align 4,0x90
> .no_dead_strip _foo
> _foo:
>        pushl   %ebp
>        movl    %esp, %ebp
>        leave
>        jmp     L_bar$stub
> .no_dead_strip _a
> .lcomm _a,4,2
>
> Note, that both foo and a are 'used' here
> -- 
> With best regards, Anton Korobeynikov
> Faculty of Mathematics and Mechanics, Saint Petersburg State  
> University
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list