Fix a small calling-convention bug for x86-32. PR14453.

llvm-svn: 168959
This commit is contained in:
Eli Friedman 2012-11-29 23:21:04 +00:00
parent 2e9952ef60
commit a92db6773a
2 changed files with 13 additions and 2 deletions

View File

@ -266,9 +266,15 @@ static const Type *isSingleElementStruct(QualType T, ASTContext &Context) {
}
static bool is32Or64BitBasicType(QualType Ty, ASTContext &Context) {
// Treat complex types as the element type.
if (const ComplexType *CTy = Ty->getAs<ComplexType>())
Ty = CTy->getElementType();
// Check for a type which we know has a simple scalar argument-passing
// convention without any padding. (We're specifically looking for 32
// and 64-bit integer and integer-equivalents, float, and double.)
if (!Ty->getAs<BuiltinType>() && !Ty->hasPointerRepresentation() &&
!Ty->isAnyComplexType() && !Ty->isEnumeralType() &&
!Ty->isBlockPointerType())
!Ty->isEnumeralType() && !Ty->isBlockPointerType())
return false;
uint64_t Size = Context.getTypeSize(Ty);

View File

@ -337,3 +337,8 @@ T66 f66(int i, ...) {
__builtin_va_end(ap);
return v;
}
// PR14453
struct s67 { _Complex unsigned short int a; };
void f67(struct s67 x) {}
// CHECK: define void @f67(%struct.s67* byval align 4 %x)