views:

78

answers:

1

Hello,

We're building our project (with Xcode 3.2.2 on Mac OS X 10.6.3, GCC 4.0.1) using the -fvisibility=hidden flag. We mark the classes we want to be visible with __attribute__((visibility("default"))). For further optimization, should we be marking with __attribute__((visibility("hidden"))) the methods inside these classes that should not be exported? It seems like quite a bit of work, and I'm not sure if it's worthwile, but the GCC Visibility Wiki makes me think it's the right way to go.

Thanks!

A: 

While it would appear the benefit exists, I would wait until the optimization becomes necessary to perform it.

fbrereto
In the long run, I'm wondering whether it would be faster if each programmer added the attributes when they create a new class, instead of having to do it later when said programmer may not be around anymore. Do you know if some tool can be applied on the final product to determine which methods are actually used outside of their DSO? I guess this would really help speeding up the optimization pass.
Guillaume
AFAIK such a tool does not exist, but I'm nowhere near an authority in this area.
fbrereto