[LLVMdev] global question

Chris Lattner clattner at apple.com
Sat Mar 7 15:15:34 PST 2009


On Mar 7, 2009, at 12:21 PM, Mike Stump wrote:

> On Mar 7, 2009, at 10:54 AM, Patrick Boettcher wrote:
>> (I even remember someone, that it is platform specific whether x is
>> initialized to 0 or not... or was it a question of C89 or C99?)
>
> If that is the entire program, the value will be 0, and that is not
> platform specific, save the fact in ancient history there were buggy
> systems.

Using the "opt -internalize" pass will mark everything internal (aka  
static) if there is a main defined in the .bc file.  If this is useful  
for your project, it should be easy to do.  Another (better) option is  
to use LTO with an export map that says you only export main.

-Chris




More information about the llvm-dev mailing list