[LLVMdev] A question about Module::getGlobalVariable()

Chris Lattner sabre at nondot.org
Sun Mar 26 11:46:59 PST 2006

On Sun, 26 Mar 2006, lizhuo wrote:
> I want to find a global variable by name in some module ,
> I find LLVM function Module::getGlobalVariable(string name,Type* ty);
> My question is , is it necessary to specify the global variable type (second param) ?
> Why not just
> getGlobalVariable(string name).

If you are using LLVM CVS, you can use Module::getNamedGlobal(string 
name), which doesn't take a type.



More information about the llvm-dev mailing list