summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-04-15 05:09:28 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-04-15 05:09:28 +0000
commitbb13845c5f6fc61888092b455e9616bbbebcffb7 (patch)
tree6b701a8377340ce730a59616c903fca814ab3b08 /clang/lib/CodeGen/CGRecordLayoutBuilder.cpp
parent4041ab6e007201a69128886d6942416f2ce04e97 (diff)
downloadbcm5719-llvm-bb13845c5f6fc61888092b455e9616bbbebcffb7.tar.gz
bcm5719-llvm-bb13845c5f6fc61888092b455e9616bbbebcffb7.zip
IRgen: Eliminate now unused fields from CGBitFieldInfo.
llvm-svn: 101344
Diffstat (limited to 'clang/lib/CodeGen/CGRecordLayoutBuilder.cpp')
-rw-r--r--clang/lib/CodeGen/CGRecordLayoutBuilder.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp b/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp
index 45acb03450f..cfdae2445e6 100644
--- a/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp
+++ b/clang/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";
OpenPOWER on IntegriCloud