[LLVMdev] [LLVMDev] [Question] The TargetRegisterClass has a confusing method.
Bill Wendling
wendling at apple.com
Tue Aug 31 13:29:50 PDT 2010
On Aug 31, 2010, at 12:26 PM, Jeff Kunkel wrote:
> The method below takes in a register and returns a register. To me this makes no sense because
> when I already have a register, why would I need to get it? Could someone please explain the
> transformation that is happening here?
>
> /// getRegister - Return the specified register in the class.
> ///
> unsigned getRegister(unsigned i) const {
> assert(i < getNumRegs() && "Register number out of range!");
> return RegsBegin[i];
> }
>
The "i" in here isn't the register but an index into the RegsBegin array.
-bw
More information about the llvm-dev
mailing list