diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-09-24 05:12:36 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-09-24 05:12:36 +0000 |
commit | 55e59e139d9ebcaae16d710472e28edbcafac98a (patch) | |
tree | 27938d82dfbbca18ed4b292a57934b3d07791d12 /lib/CodeGen/TargetABIInfo.cpp | |
parent | 0954cdec4b13f1b3fd4c8711e02ded914968000b (diff) |
Darwin/x86-32: Enumerated types and block pointer types in structures were not
handled correctly.
- <rdar://problem/7247671> Function arguments incorrect when function returns a
struct on i386 w/ llvm-g++ and clang
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82681 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/TargetABIInfo.cpp')
-rw-r--r-- | lib/CodeGen/TargetABIInfo.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/CodeGen/TargetABIInfo.cpp b/lib/CodeGen/TargetABIInfo.cpp index 3ad8cfc36f..da30060ecd 100644 --- a/lib/CodeGen/TargetABIInfo.cpp +++ b/lib/CodeGen/TargetABIInfo.cpp @@ -159,7 +159,9 @@ static const Type *isSingleElementStruct(QualType T, ASTContext &Context) { } static bool is32Or64BitBasicType(QualType Ty, ASTContext &Context) { - if (!Ty->getAs<BuiltinType>() && !Ty->isPointerType()) + if (!Ty->getAs<BuiltinType>() && !Ty->isAnyPointerType() && + !Ty->isAnyComplexType() && !Ty->isEnumeralType() && + !Ty->isBlockPointerType()) return false; uint64_t Size = Context.getTypeSize(Ty); @@ -291,8 +293,10 @@ bool X86_32ABIInfo::shouldReturnTypeInRegister(QualType Ty, return true; } - // If this is a builtin, pointer, or complex type, it is ok. - if (Ty->getAs<BuiltinType>() || Ty->isPointerType() || Ty->isAnyComplexType()) + // If this is a builtin, pointer, enum, or complex type, it is ok. + if (Ty->getAs<BuiltinType>() || Ty->isAnyPointerType() || + Ty->isAnyComplexType() || Ty->isEnumeralType() || + Ty->isBlockPointerType()) return true; // Arrays are treated like records. |