[LLVMdev] creating Internal GlobalVaraibles
Patrick Meredith
pmeredit at uiuc.edu
Wed Oct 13 01:00:21 PDT 2004
Ahh, you have to initialize it to be Internal. Sorry for the pointless
post.
----- Original Message -----
From: "Patrick Meredith" <pmeredit at uiuc.edu>
To: "LLVM Developers Mailing List" <llvmdev at cs.uiuc.edu>
Sent: Wednesday, October 13, 2004 2:53 AM
Subject: [LLVMdev] creating Internal GlobalVaraibles
> 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?
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev
More information about the llvm-dev
mailing list