forked from OSchip/llvm-project
Add inreg attributes to reference arguments.
llvm-svn: 145189
This commit is contained in:
parent
251d827d2c
commit
32d8a275b9
|
@ -831,7 +831,8 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
|
|||
// FALL THROUGH
|
||||
case ABIArgInfo::Direct:
|
||||
if (RegParm > 0 &&
|
||||
(ParamType->isIntegerType() || ParamType->isPointerType())) {
|
||||
(ParamType->isIntegerType() || ParamType->isPointerType() ||
|
||||
ParamType->isReferenceType())) {
|
||||
RegParm -=
|
||||
(Context.getTypeSize(ParamType) + PointerWidth - 1) / PointerWidth;
|
||||
if (RegParm >= 0)
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
// RUN: %clang_cc1 -triple i386-unknown-unknown %s -emit-llvm -o - | FileCheck %s
|
||||
|
||||
|
||||
// CHECK: _Z3fooRi(i32* inreg
|
||||
void __attribute__ ((regparm (1))) foo(int &a) {
|
||||
}
|
Loading…
Reference in New Issue