[LLVMdev] creating Internal GlobalVaraibles
Patrick Meredith
pmeredit at uiuc.edu
Wed Oct 13 00:53:34 PDT 2004
Here is my code, (GV is a GlobalVariable*):
GV = new GlobalVariable(AI->getType(), false, GlobalValue::InternalLinkage,
0, "temp_glob", &M);
I tell it to make it with internal linkage, but when I run the pass it makes
them external:
%temp_glob = external global [10 x int]* ; <[10 x int]**>
[#uses=2]
%temp_glob = external global [10 x float]* ; <[10 x float]**>
[#uses=2]
and of course I get the broken module error because they aren't external:
Global is external, but doesn't have external linkage!
[10 x int]** %temp_glob
Global is external, but doesn't have external linkage!
[10 x float]** %temp_glob
Anyone know what I am doing wrong?
More information about the llvm-dev
mailing list