[llvm-commits] [PATCH][Review request] Change handling of byval arguments passed in registers.

Bruno Cardoso Lopes bruno.cardoso at gmail.com
Tue Oct 25 11:50:37 PDT 2011


Hi Akira,

On Tue, Oct 25, 2011 at 4:11 PM, Akira Hatanaka <ahatanak at gmail.com> wrote:
> This patch enables handling of functions with multiple byval arguments.
> foo(struct S1 a0, struct S1 a1);
> This feature hasn't been necessary since it seems that ARM, which was
> the only user of FirstByValReg, allows just one byval argument being
> passed.
>
> All registers used to pass or receive byval arguments are stored in a
> map, which obviates the need to rediscover them later.
>
> Also, I think the following functions can be simplified if variable
> FirstByValRegValid is removed. You can tell whether FirstByValReg is
> valid or not by checking whether it is 0 since enums for registers are
> non-zero (NoRegister is 0).
>
> unsigned getFirstByValReg() { return FirstByValRegValid ? FirstByValReg : 0; }
> void setFirstByValReg(unsigned r) { FirstByValReg = r;
> FirstByValRegValid = true; }
> void clearFirstByValReg() { FirstByValReg = 0; FirstByValRegValid = false; }
> bool isFirstByValRegValid() { return FirstByValRegValid; }

I may be missing something, but why don't handle this sort of Mips
requirement in the front-end (clang)?


-- 
Bruno Cardoso Lopes
http://www.brunocardoso.cc



More information about the llvm-commits mailing list