[llvm-commits] New interfaces for getting address space

Villmow, Micah Micah.Villmow at amd.com
Tue Oct 9 15:29:36 PDT 2012


Issues fixed and commited in r165554.

> -----Original Message-----
> From: Eli Friedman [mailto:eli.friedman at gmail.com]
> Sent: Tuesday, October 09, 2012 1:56 PM
> To: Villmow, Micah
> Cc: llvm-commits at cs.uiuc.edu
> Subject: Re: [llvm-commits] New interfaces for getting address space
> 
> On Tue, Oct 9, 2012 at 9:55 AM, Villmow, Micah <Micah.Villmow at amd.com>
> wrote:
> > The attached patch supplies some new interfaces that allows easier
> access to the address space of the pointer in an instruction.
> > These interfaces are required for simplifying the update path of the
> optimizers for when supporting variable pointer sizes on a per-address
> space basis.
> 
> +  /// getAddressSpace - Method to return the address space of the
> +  /// pointer operand.
> +  unsigned getAddressSpace() const {
> +    return dyn_cast<PointerType>(getPointerOperandType())-
> >getAddressSpace();
> +  }
> 
> cast<>, not dyn_cast<>.  dyn_cast implies you're checking the result
> for null.  (Applies globally.)
> 
> I think I would prefer the name getPointerAddressSpace for cases when
> you're getting the address-space of an operand, given that the
> instruction itself doesn't really have an address space.
> 
> Otherwise, looks fine.
> 
> -Eli






More information about the llvm-commits mailing list