forked from OSchip/llvm-project
Ignore empty unions in argument lowering on x86-32. From gcc struct layout tests.
llvm-svn: 144944
This commit is contained in:
parent
841dd8861a
commit
9f061a37bb
|
@ -700,8 +700,8 @@ ABIArgInfo X86_32ABIInfo::classifyArgumentType(QualType Ty) const {
|
|||
return getIndirectResult(Ty);
|
||||
}
|
||||
|
||||
// Ignore empty structs.
|
||||
if (Ty->isStructureType() && getContext().getTypeSize(Ty) == 0)
|
||||
// Ignore empty structs/unions.
|
||||
if (Ty->isRecordType() && getContext().getTypeSize(Ty) == 0)
|
||||
return ABIArgInfo::getIgnore();
|
||||
|
||||
// Expand small (<= 128-bit) record types when we know that the stack layout
|
||||
|
|
|
@ -280,3 +280,7 @@ void f56(char a0, struct s56_0 a1,
|
|||
// CHECK: call void @f57(
|
||||
struct s57 { _Complex int x; };
|
||||
void f57(struct s57 x) {} void f57a(void) { f57((struct s57){1}); }
|
||||
|
||||
union u58 {};
|
||||
void f58(union u58 x) {}
|
||||
// CHECK: define void @f58()
|
||||
|
|
Loading…
Reference in New Issue