diff options
| author | Eli Friedman <eli.friedman@gmail.com> | 2012-11-29 23:21:04 +0000 |
|---|---|---|
| committer | Eli Friedman <eli.friedman@gmail.com> | 2012-11-29 23:21:04 +0000 |
| commit | a92db6773ad6054317a7f72a16e319eddd6d7edf (patch) | |
| tree | 10c36655945c28703a431e0dc23780ee71e93db2 /clang/lib/CodeGen | |
| parent | 2e9952ef60bd5416447e615067ae79f8d07eca42 (diff) | |
| download | bcm5719-llvm-a92db6773ad6054317a7f72a16e319eddd6d7edf.tar.gz bcm5719-llvm-a92db6773ad6054317a7f72a16e319eddd6d7edf.zip | |
Fix a small calling-convention bug for x86-32. PR14453.
llvm-svn: 168959
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/TargetInfo.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp index 1582eb63544..8ff57f6c20a 100644 --- a/clang/lib/CodeGen/TargetInfo.cpp +++ b/clang/lib/CodeGen/TargetInfo.cpp @@ -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); |

