forked from OSchip/llvm-project
Correct a thinko in bitfield layout code. Fixes PR4611.
llvm-svn: 76898
This commit is contained in:
parent
2a5b83c7e6
commit
516e5e7835
|
@ -88,10 +88,8 @@ void CGRecordLayoutBuilder::LayoutBitField(const FieldDecl *D,
|
||||||
|
|
||||||
AppendBytes(NumBytesToAppend);
|
AppendBytes(NumBytesToAppend);
|
||||||
|
|
||||||
if (!NumBytesToAppend)
|
BitsAvailableInLastField =
|
||||||
BitsAvailableInLastField -= FieldSize;
|
getNextFieldOffsetInBytes() * 8 - (FieldOffset + FieldSize);
|
||||||
else
|
|
||||||
BitsAvailableInLastField = NumBytesToAppend * 8 - FieldSize;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CGRecordLayoutBuilder::LayoutField(const FieldDecl *D,
|
bool CGRecordLayoutBuilder::LayoutField(const FieldDecl *D,
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
// RUN: clang-cc -triple i386-unknown-unknown %s -emit-llvm -o %t &&
|
||||||
|
// RUN: grep "struct.object_entry = type <{ i8, i8, i8, i8 }>" %t
|
||||||
|
|
||||||
|
struct object_entry {
|
||||||
|
unsigned int type:3, pack_id:16, depth:13;
|
||||||
|
} entries;
|
Loading…
Reference in New Issue