[LLVMdev] How to create Global Variables using LLVM API?

subramanyam subbu.pur at gmail.com
Wed May 12 20:23:02 PDT 2010


I am using llvm-2.6. 
In the online documentation, the signature is 
GlobalVariable::GlobalVariable  	(  	const Type *   	 Ty,
		bool  	isConstant,
		LinkageTypes  	Linkage,
		Constant *  	Initializer = 0,
		const Twine &  	Name = "",
		bool  	ThreadLocal = false,
		unsigned  	AddressSpace = 0	 
	)
the link to the documenation is
http://llvm.org/doxygen/classllvm_1_1GlobalVariable.html
There are two constructors given. Second constructor signature is same as
the source code. The first one differs though.

In the source code the prototype of the constructor is at line 53 in 
GlobalVariable.h file.
The signature is 
GlobalVariable(LLVMContext &Context, const Type *Ty, bool isConstant,
                 LinkageTypes Linkage,
                 Constant *Initializer = 0, const Twine &Name = "",
                 bool ThreadLocal = false, unsigned AddressSpace = 0);



Duncan Sands wrote:
> 
> Hi subramanyam,
> 
>> Actually, the signature of the constructor given in the online
>> documentation
>> is different from the actual source code.
> 
> which bit of the documentation?  Any chance of a patch that fixes it?
> 
> Ciao,
> 
> Duncan.
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> 
> 

-- 
View this message in context: http://old.nabble.com/How-to-create-Global-Variables-using-LLVM-API--tp28519938p28543259.html
Sent from the LLVM - Dev mailing list archive at Nabble.com.




More information about the llvm-dev mailing list