mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-25 07:31:32 +00:00
If there are attributes on the varargs part of a
call, don't discard them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45884 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
497e888daf
commit
eb824709cb
@ -2675,8 +2675,15 @@ BBTerminatorInst : RET ResolvedVal { // Return with a result...
|
|||||||
|
|
||||||
if (Ty->isVarArg()) {
|
if (Ty->isVarArg()) {
|
||||||
if (I == E)
|
if (I == E)
|
||||||
for (; ArgI != ArgE; ++ArgI)
|
for (; ArgI != ArgE; ++ArgI, ++index) {
|
||||||
Args.push_back(ArgI->Val); // push the remaining varargs
|
Args.push_back(ArgI->Val); // push the remaining varargs
|
||||||
|
if (ArgI->Attrs != ParamAttr::None) {
|
||||||
|
ParamAttrsWithIndex PAWI;
|
||||||
|
PAWI.index = index;
|
||||||
|
PAWI.attrs = ArgI->Attrs;
|
||||||
|
Attrs.push_back(PAWI);
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if (I != E || ArgI != ArgE)
|
} else if (I != E || ArgI != ArgE)
|
||||||
GEN_ERROR("Invalid number of parameters detected");
|
GEN_ERROR("Invalid number of parameters detected");
|
||||||
}
|
}
|
||||||
@ -3006,8 +3013,15 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef {
|
|||||||
}
|
}
|
||||||
if (Ty->isVarArg()) {
|
if (Ty->isVarArg()) {
|
||||||
if (I == E)
|
if (I == E)
|
||||||
for (; ArgI != ArgE; ++ArgI)
|
for (; ArgI != ArgE; ++ArgI, ++index) {
|
||||||
Args.push_back(ArgI->Val); // push the remaining varargs
|
Args.push_back(ArgI->Val); // push the remaining varargs
|
||||||
|
if (ArgI->Attrs != ParamAttr::None) {
|
||||||
|
ParamAttrsWithIndex PAWI;
|
||||||
|
PAWI.index = index;
|
||||||
|
PAWI.attrs = ArgI->Attrs;
|
||||||
|
Attrs.push_back(PAWI);
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if (I != E || ArgI != ArgE)
|
} else if (I != E || ArgI != ArgE)
|
||||||
GEN_ERROR("Invalid number of parameters detected");
|
GEN_ERROR("Invalid number of parameters detected");
|
||||||
}
|
}
|
||||||
|
10
test/Assembler/2008-01-11-VarargAttrs.ll
Normal file
10
test/Assembler/2008-01-11-VarargAttrs.ll
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
; RUN: llvm-as < %s | llvm-dis | grep byval | count 2
|
||||||
|
|
||||||
|
%struct = type { }
|
||||||
|
|
||||||
|
declare void @foo(...)
|
||||||
|
|
||||||
|
define void @bar() {
|
||||||
|
call void (...)* @foo(%struct* byval null, %struct* byval null )
|
||||||
|
ret void
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user