[LLVMbugs] [PATCH] Returning InternalLinkage types from Module::getGlobalVariable

Evan Jones ejones at uwaterloo.ca
Tue Nov 22 12:45:58 PST 2005


On Nov 2, 2005, at 17:10, Chris Lattner wrote:
> 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.

The attached patch is the followup from this discussion on llvmdev. It 
does not change the test suite results on my Linux system.

Evan Jones
-------------- next part --------------
A non-text attachment was scrubbed...
Name: getglobal.patch
Type: application/octet-stream
Size: 2989 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20051122/c2dd2614/attachment.obj>
-------------- next part --------------

--
Evan Jones
http://evanjones.ca/


More information about the llvm-bugs mailing list