[cfe-commits] r100433 - in /cfe/trunk/lib/CodeGen: CGExpr.cpp CGObjCMac.cpp CGRecordLayout.h CGRecordLayoutBuilder.cpp
Daniel Dunbar
daniel at zuster.org
Mon Apr 5 09:20:44 PDT 2010
Author: ddunbar
Date: Mon Apr 5 11:20:44 2010
New Revision: 100433
URL: http://llvm.org/viewvc/llvm-project?rev=100433&view=rev
Log:
IRgen: Lift BitFieldInfo to CGBitFieldInfo at namespace level.
Modified:
cfe/trunk/lib/CodeGen/CGExpr.cpp
cfe/trunk/lib/CodeGen/CGObjCMac.cpp
cfe/trunk/lib/CodeGen/CGRecordLayout.h
cfe/trunk/lib/CodeGen/CGRecordLayoutBuilder.cpp
Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=100433&r1=100432&r2=100433&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Mon Apr 5 11:20:44 2010
@@ -1471,7 +1471,7 @@
unsigned CVRQualifiers) {
const CGRecordLayout &RL =
CGM.getTypes().getCGRecordLayout(Field->getParent());
- const CGRecordLayout::BitFieldInfo &Info = RL.getBitFieldInfo(Field);
+ const CGBitFieldInfo &Info = RL.getBitFieldInfo(Field);
// FIXME: CodeGenTypes should expose a method to get the appropriate type for
// FieldTy (the appropriate type is ABI-dependent).
Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=100433&r1=100432&r2=100433&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Mon Apr 5 11:20:44 2010
@@ -3126,7 +3126,7 @@
const CGRecordLayout &RL =
CGM.getTypes().getCGRecordLayout(Field->getParent());
if (Field->isBitField()) {
- const CGRecordLayout::BitFieldInfo &Info = RL.getBitFieldInfo(Field);
+ const CGBitFieldInfo &Info = RL.getBitFieldInfo(Field);
const llvm::Type *Ty =
CGM.getTypes().ConvertTypeForMemRecursive(Field->getType());
Modified: cfe/trunk/lib/CodeGen/CGRecordLayout.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGRecordLayout.h?rev=100433&r1=100432&r2=100433&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGRecordLayout.h (original)
+++ cfe/trunk/lib/CodeGen/CGRecordLayout.h Mon Apr 5 11:20:44 2010
@@ -19,6 +19,16 @@
namespace clang {
namespace CodeGen {
+class CGBitFieldInfo {
+public:
+ CGBitFieldInfo(unsigned FieldNo, unsigned Start, unsigned Size)
+ : FieldNo(FieldNo), Start(Start), Size(Size) {}
+
+ unsigned FieldNo;
+ unsigned Start;
+ unsigned Size;
+};
+
/// CGRecordLayout - This class handles struct and union layout info while
/// lowering AST types to LLVM types.
///
@@ -29,18 +39,6 @@
CGRecordLayout(const CGRecordLayout&); // DO NOT IMPLEMENT
void operator=(const CGRecordLayout&); // DO NOT IMPLEMENT
-public:
- struct BitFieldInfo {
- BitFieldInfo(unsigned FieldNo,
- unsigned Start,
- unsigned Size)
- : FieldNo(FieldNo), Start(Start), Size(Size) {}
-
- unsigned FieldNo;
- unsigned Start;
- unsigned Size;
- };
-
private:
/// The LLVMType corresponding to this record layout.
const llvm::Type *LLVMType;
@@ -51,7 +49,7 @@
/// Map from (bit-field) struct field to the corresponding llvm struct type
/// field no. This info is populated by record builder.
- llvm::DenseMap<const FieldDecl *, BitFieldInfo> BitFields;
+ llvm::DenseMap<const FieldDecl *, CGBitFieldInfo> BitFields;
/// Whether one of the fields in this record layout is a pointer to data
/// member, or a struct that contains pointer to data member.
@@ -80,9 +78,9 @@
/// \brief Return llvm::StructType element number that corresponds to the
/// field FD.
- const BitFieldInfo &getBitFieldInfo(const FieldDecl *FD) const {
+ const CGBitFieldInfo &getBitFieldInfo(const FieldDecl *FD) const {
assert(FD->isBitField() && "Invalid call for non bit-field decl!");
- llvm::DenseMap<const FieldDecl *, BitFieldInfo>::const_iterator
+ llvm::DenseMap<const FieldDecl *, CGBitFieldInfo>::const_iterator
it = BitFields.find(FD);
assert(it != BitFields.end() && "Unable to find bitfield info");
return it->second;
Modified: cfe/trunk/lib/CodeGen/CGRecordLayoutBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGRecordLayoutBuilder.cpp?rev=100433&r1=100432&r2=100433&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGRecordLayoutBuilder.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGRecordLayoutBuilder.cpp Mon Apr 5 11:20:44 2010
@@ -506,7 +506,7 @@
const CGRecordLayoutBuilder::LLVMBitFieldInfo &Info =
Builder.LLVMBitFields[i];
- CGRecordLayout::BitFieldInfo BFI(Info.FieldNo, Info.Start, Info.Size);
+ CGBitFieldInfo BFI(Info.FieldNo, Info.Start, Info.Size);
RL->BitFields.insert(std::make_pair(Info.FD, BFI));
}
More information about the cfe-commits
mailing list