[LLVMdev] AddressSpace of a GlobalAddress

Chris Lattner clattner at apple.com
Tue Apr 28 10:57:54 PDT 2009

On Apr 28, 2009, at 7:57 AM, Sanjiv Gupta wrote:

> Every GlobalAddress has a GlobalValue, Every GlobalValue is a
> PointerType, Every PointerType has an AddressSpace. So is it ok to  
> add a
> method getAddressSpace in GlobalAddressSDNode class itself?
> Currently we have to do GSDN->getGlobal()->getType()- 
> >getAddressSpace().

Yep, go for it.  However, if it would require adding a #include to  
globalvalue.h, then please avoid this by making the method out-of-line.

Thanks Sanjiv,


More information about the llvm-dev mailing list