]> granicus.if.org Git - clang/commit
Handle functions with struct arguments or return types and the regparm
authorRafael Espindola <rafael.espindola@gmail.com>
Tue, 31 Jul 2012 02:44:24 +0000 (02:44 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Tue, 31 Jul 2012 02:44:24 +0000 (02:44 +0000)
commitb48280ba1790122cd3fa6e17c88ecd6a4571a4eb
treef9542b6b14db62a150a7af7d2cfb0b0d7d3b859f
parentd72f56de7c79828928147389aed2c6c46f331031
Handle functions with struct arguments or return types and the regparm
attribute. It is a variation of the x86_64 ABI:

* A struct returned indirectly uses the first register argument to pass the
  pointer.
* Floats, Doubles and structs containing only one of them are not passed in
  registers.
* Other structs are split into registers if they fit on the remaining ones.
  Otherwise they are passed in memory.
* When a struct doesn't fit it still consumes the registers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161022 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/ABIInfo.h
lib/CodeGen/CGCall.cpp
lib/CodeGen/TargetInfo.cpp
test/CodeGen/regparm-struct.c [new file with mode: 0644]
test/CodeGenCXX/pr13396.cpp