[LLVMdev] Statically Initialized Arrays

Chris Lattner sabre at nondot.org
Wed Nov 2 14:10:02 PST 2005


On Wed, 2 Nov 2005, Evan Jones wrote:
> In a vaguely related node, why does Module::getGlobalVariable *not* return 
> types with internal linkage? There must be some logic behind that choice that 
> I can't figure out. It is easy to copy the code out of Module.cpp if you need 
> to find variables with internal linkage, but it seems unnecessary to me.

Good question.  I think that this method was pulled out of the linker 
originally, which didn't want to link against internal symbols.  Other 
clients (such as the lowergc pass) want to get the variable and the var 
must be an external symbol.

If you want to add a 'bool AllowInternal' option to the method, and 
default it to false, go for it.  Please submit the patch to the llvmbugs 
list if you choose to do so.

Thanks!

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/




More information about the llvm-dev mailing list