[llvm-commits] [llvm-gcc-4.2] r53130 - /llvm-gcc-4.2/trunk/gcc/cgraphunit.c
Eric Christopher
echristo at apple.com
Fri Jul 4 11:46:21 PDT 2008
>>>>
>
> If debug_foo is dead, and there are no objects of type foo or foo*
> (either of which would cause the type to be emitted), why would you
> want to do this?
As I said, for debugging purposes, i.e. within gdb calling the function.
Think debug_tree from gcc.
> (Apple-centric view): Also, this is not a change in behavior from the
> viewpoint of most users; it restores the 4.0 behavior. g++'s behavior
> changed from 3.3 to 4.0, and changed back from 4.0 to 4.2; I'm not
> aware of any bug reports about either change. So I don't believe this
> is important to users.
>
Enh. Drove me nuts when it happened. I had to mark functions
__attribute__((used)).
>>> 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.
>
> This won't work when LTO is on, will it? You need the explicit
> "used" (actually, I'm not sure whether LTO honors that, but it ought
> to).
Well, hopefully people aren't using LTO with O0. That'd just be a
little weird. :)
-eric
More information about the llvm-commits
mailing list