[llvm-commits] [llvm-gcc-4.2] r53130 - /llvm-gcc-4.2/trunk/gcc/cgraphunit.c

Chris Lattner clattner at apple.com
Thu Jul 3 22:11:45 PDT 2008


On Jul 3, 2008, at 8:48 PM, Eric Christopher wrote:
>> Thanks for tracking this down Dale!
>
> I don't know that I agree with this. For example:
>
> struct foo
> {
>   ...
> }
>
> static void debug_foo (struct foo)
> {
>     printf(...)
>     ...
> }
>
> You've just made it impossible to print out (without additional work)
> struct foo from within gdb if foo is only used in one file and
> therefore doesn't need a non-static debug routine. Worse, this isn't
> obvious - especially at O0.

Make the function non-static.  Note that this only changes behavior  
when compiling C++, not C.  In C++ the same thing already happens for  
inline functions and many other cases.

-Chris



More information about the llvm-commits mailing list