diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-05-08 21:04:47 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-05-08 21:04:47 +0000 |
commit | fdda3501a0f7a85539e087be58a73a2c67823cc5 (patch) | |
tree | 2df0f62e54d685d6fdde767933eb5fd70530505b /clang/lib/CodeGen | |
parent | 2e55cc5a4ae5e3d394afca69a8b9db2b38aaaadc (diff) | |
download | bcm5719-llvm-fdda3501a0f7a85539e087be58a73a2c67823cc5.tar.gz bcm5719-llvm-fdda3501a0f7a85539e087be58a73a2c67823cc5.zip |
Darwin x86_32: Ignore padding bit-fields when looking for "single
element" structures.
llvm-svn: 71266
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGCall.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index eba5ff5b5e7..883eb5ede48 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -204,11 +204,15 @@ static const Type *isSingleElementStruct(QualType T, ASTContext &Context) { if (AT->getSize().getZExtValue() == 1) FT = AT->getElementType(); - if (isEmptyRecord(Context, FT)) { - // Ignore - } else if (Found) { + // Ignore empty records and padding bit-fields. + if (isEmptyRecord(Context, FT) || + (FD->isBitField() && !FD->getIdentifier())) + continue; + + if (Found) return 0; - } else if (!CodeGenFunction::hasAggregateLLVMType(FT)) { + + if (!CodeGenFunction::hasAggregateLLVMType(FT)) { Found = FT.getTypePtr(); } else { Found = isSingleElementStruct(FT, Context); |