diff options
author | Mike Stump <mrs@apple.com> | 2009-09-09 15:08:12 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2009-09-09 15:08:12 +0000 |
commit | 1eb4433ac451dc16f4133a88af2d002ac26c58ef (patch) | |
tree | 07065b80cb7787bb7b9ffcb985196007a57e86f7 /lib/CodeGen/CGRecordLayoutBuilder.h | |
parent | 79d39f92590cf2e91bf81486b02cd1156d13ca54 (diff) |
Remove tabs, and whitespace cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGRecordLayoutBuilder.h')
-rw-r--r-- | lib/CodeGen/CGRecordLayoutBuilder.h | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/lib/CodeGen/CGRecordLayoutBuilder.h b/lib/CodeGen/CGRecordLayoutBuilder.h index 63ddc10df5..d1a13aa297 100644 --- a/lib/CodeGen/CGRecordLayoutBuilder.h +++ b/lib/CodeGen/CGRecordLayoutBuilder.h @@ -25,57 +25,57 @@ namespace llvm { namespace clang { class FieldDecl; class RecordDecl; - + namespace CodeGen { class CGRecordLayout; class CodeGenTypes; -class CGRecordLayoutBuilder { +class CGRecordLayoutBuilder { CodeGenTypes &Types; - + /// Packed - Whether the resulting LLVM struct will be packed or not. bool Packed; /// ContainsMemberPointer - Whether one of the fields is a member pointer /// or is a struct that contains a member pointer. bool ContainsMemberPointer; - + /// Alignment - Contains the alignment of the RecordDecl. unsigned Alignment; /// AlignmentAsLLVMStruct - Will contain the maximum alignment of all the /// LLVM types. unsigned AlignmentAsLLVMStruct; - + /// BitsAvailableInLastField - If a bit field spans only part of a LLVM field, /// this will have the number of bits still available in the field. char BitsAvailableInLastField; /// NextFieldOffsetInBytes - Holds the next field offset in bytes. uint64_t NextFieldOffsetInBytes; - + /// FieldTypes - Holds the LLVM types that the struct is created from. std::vector<const llvm::Type *> FieldTypes; - + /// LLVMFieldInfo - Holds a field and its corresponding LLVM field number. typedef std::pair<const FieldDecl *, unsigned> LLVMFieldInfo; llvm::SmallVector<LLVMFieldInfo, 16> LLVMFields; /// LLVMBitFieldInfo - Holds location and size information about a bit field. struct LLVMBitFieldInfo { - LLVMBitFieldInfo(const FieldDecl *FD, unsigned FieldNo, unsigned Start, + LLVMBitFieldInfo(const FieldDecl *FD, unsigned FieldNo, unsigned Start, unsigned Size) : FD(FD), FieldNo(FieldNo), Start(Start), Size(Size) { } - + const FieldDecl *FD; - + unsigned FieldNo; unsigned Start; unsigned Size; }; llvm::SmallVector<LLVMBitFieldInfo, 16> LLVMBitFields; - - CGRecordLayoutBuilder(CodeGenTypes &Types) + + CGRecordLayoutBuilder(CodeGenTypes &Types) : Types(Types), Packed(false), ContainsMemberPointer(false) , Alignment(0), AlignmentAsLLVMStruct(1) , BitsAvailableInLastField(0), NextFieldOffsetInBytes(0) { } @@ -85,15 +85,15 @@ class CGRecordLayoutBuilder { /// LayoutUnion - Will layout a union RecordDecl. void LayoutUnion(const RecordDecl *D); - + /// LayoutField - try to layout all fields in the record decl. /// Returns false if the operation failed because the struct is not packed. bool LayoutFields(const RecordDecl *D); - + /// LayoutField - layout a single field. Returns false if the operation failed /// because the current struct is not packed. bool LayoutField(const FieldDecl *D, uint64_t FieldOffset); - + /// LayoutBitField - layout a single bit field. void LayoutBitField(const FieldDecl *D, uint64_t FieldOffset); @@ -107,28 +107,28 @@ class CGRecordLayoutBuilder { /// AppendPadding - Appends enough padding bytes so that the total /// struct size is a multiple of the field alignment. void AppendPadding(uint64_t FieldOffsetInBytes, unsigned FieldAlignment); - + /// AppendBytes - Append a given number of bytes to the record. void AppendBytes(uint64_t NumBytes); /// AppendTailPadding - Append enough tail padding so that the type will have /// the passed size. void AppendTailPadding(uint64_t RecordSize); - + unsigned getTypeAlignment(const llvm::Type *Ty) const; uint64_t getTypeSizeInBytes(const llvm::Type *Ty) const; /// CheckForMemberPointer - Check if the field contains a member pointer. void CheckForMemberPointer(const FieldDecl *FD); - + public: /// ComputeLayout - Return the right record layout for a given record decl. - static CGRecordLayout *ComputeLayout(CodeGenTypes &Types, + static CGRecordLayout *ComputeLayout(CodeGenTypes &Types, const RecordDecl *D); }; - + } // end namespace CodeGen } // end namespace clang - -#endif + +#endif |