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

Akira Hatanaka ahatanak at gmail.com
Tue Oct 25 11:11:37 PDT 2011


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; }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: handlebyval.patch
Type: text/x-patch
Size: 3818 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20111025/c47fc0fc/attachment.bin>


More information about the llvm-commits mailing list