diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-04-15 05:09:28 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-04-15 05:09:28 +0000 |
commit | 7fb619500404129322af972aab66c369949a2a74 (patch) | |
tree | 7fd41f5c9c2948ac1037ffb6d4cb6799a93a5663 /lib/CodeGen/CGRecordLayoutBuilder.cpp | |
parent | 2677261656b2f3325218d38bdd9d102ad732da92 (diff) |
IRgen: Eliminate now unused fields from CGBitFieldInfo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101344 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGRecordLayoutBuilder.cpp')
-rw-r--r-- | lib/CodeGen/CGRecordLayoutBuilder.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/CodeGen/CGRecordLayoutBuilder.cpp b/lib/CodeGen/CGRecordLayoutBuilder.cpp index 45acb03450..cfdae2445e 100644 --- a/lib/CodeGen/CGRecordLayoutBuilder.cpp +++ b/lib/CodeGen/CGRecordLayoutBuilder.cpp @@ -153,15 +153,15 @@ static CGBitFieldInfo ComputeBitFieldInfo(CodeGenTypes &Types, uint64_t TypeSizeInBytes = Types.getTargetData().getTypeAllocSize(Ty); uint64_t TypeSizeInBits = TypeSizeInBytes * 8; + unsigned StartBit = FieldOffset % TypeSizeInBits; bool IsSigned = FD->getType()->isSignedIntegerType(); - CGBitFieldInfo BFI(Ty, FieldOffset / TypeSizeInBits, - FieldOffset % TypeSizeInBits, FieldSize, IsSigned); + CGBitFieldInfo BFI(FieldSize, IsSigned); // The current policy is to always access the bit-field using the source type // of the bit-field. With the C bit-field rules, this implies that we always // use either one or two accesses, and two accesses can only occur with a // packed structure when the bit-field straddles an alignment boundary. - unsigned LowBits = std::min(FieldSize, TypeSizeInBits - BFI.Start); + unsigned LowBits = std::min(FieldSize, TypeSizeInBits - StartBit); bool NeedsHighAccess = LowBits != FieldSize; BFI.setNumComponents(1 + NeedsHighAccess); @@ -170,7 +170,7 @@ static CGBitFieldInfo ComputeBitFieldInfo(CodeGenTypes &Types, LowAccess.FieldIndex = 0; LowAccess.FieldByteOffset = TypeSizeInBytes * ((FieldOffset / 8) / TypeSizeInBytes); - LowAccess.FieldBitStart = BFI.Start; + LowAccess.FieldBitStart = StartBit; LowAccess.AccessWidth = TypeSizeInBits; // FIXME: This might be wrong! LowAccess.AccessAlignment = 0; @@ -565,9 +565,6 @@ void CGRecordLayout::dump() const { void CGBitFieldInfo::print(llvm::raw_ostream &OS) const { OS << "<CGBitFieldInfo"; - OS << " FieldTy:" << *FieldTy; - OS << " FieldNo:" << FieldNo; - OS << " Start:" << Start; OS << " Size:" << Size; OS << " IsSigned:" << IsSigned << "\n"; |