diff options
| author | Devang Patel <dpatel@apple.com> | 2007-12-11 00:54:19 +0000 |
|---|---|---|
| committer | Devang Patel <dpatel@apple.com> | 2007-12-11 00:54:19 +0000 |
| commit | 113bd8be70c71bcc3918c5e706038b1fbfe8b419 (patch) | |
| tree | 59e9b3bd883361f6bd669a47fe5a81be0a3eeb2f /clang/CodeGen/CodeGenTypes.cpp | |
| parent | ab6aadb34a4e262d31a60b9805799f891714af60 (diff) | |
| download | bcm5719-llvm-113bd8be70c71bcc3918c5e706038b1fbfe8b419.tar.gz bcm5719-llvm-113bd8be70c71bcc3918c5e706038b1fbfe8b419.zip | |
Beautify comment.
llvm-svn: 44831
Diffstat (limited to 'clang/CodeGen/CodeGenTypes.cpp')
| -rw-r--r-- | clang/CodeGen/CodeGenTypes.cpp | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/clang/CodeGen/CodeGenTypes.cpp b/clang/CodeGen/CodeGenTypes.cpp index 02abf8ee510..21046e9c70c 100644 --- a/clang/CodeGen/CodeGenTypes.cpp +++ b/clang/CodeGen/CodeGenTypes.cpp @@ -66,12 +66,16 @@ namespace { } /// fixCursorPosition - When bit-field is followed by a normal field - /// then cursor position may require some adjustments. For example, - /// struct { char a; short b:2; char c; }; - /// At the beginning of 'c' during layout, cursor position is 10. - /// However, only one llvm struct field is allocated and it is i8. - /// This happens because 'b' shares llvm field with 'a'. - /// Similar adjustment may be required if bit-field is last field. + /// cursor position may require some adjustments. + /// + /// For example, struct { char a; short b:2; char c; }; + /// + /// At the beginning of field 'c' layout, cursor position is 10. + /// However, only llvm struct field allocated so far is of type i8. + /// This happens because 'b' shares llvm field with 'a'. Add padding + /// field of i8 type and reposition cursor to point at 16. This + /// should be done only if next field (i.e. 'c' here) is not a bit-field + /// or last record field is a bit-field. void fixCursorPosition(const ASTRecordLayout &RL); private: @@ -570,12 +574,16 @@ void RecordOrganizer::layoutUnionFields() { } /// fixCursorPosition - When bit-field is followed by a normal field -/// then cursor position may require some adjustments. For example, -/// struct { char a; short b:2; char c; }; -/// At the beginning of 'c' during layout, cursor position is 10. -/// However, only one llvm struct field is allocated so far is i8. -/// This happens because 'b' shares llvm field with 'a'. -/// Similar adjustment may be required if last record field is a bit-field. +/// cursor position may require some adjustments. +/// +/// For example, struct { char a; short b:2; char c; }; +/// +/// At the beginning of field 'c' layout, cursor position is 10. +/// However, only llvm struct field allocated so far is of type i8. +/// This happens because 'b' shares llvm field with 'a'. Add padding +/// field of i8 type and reposition cursor to point at 16. This +/// should be done only if next field (i.e. 'c' here) is not a bit-field +/// or last record field is a bit-field. void RecordOrganizer::fixCursorPosition(const ASTRecordLayout &RL) { uint64_t llvmSize = 0; for(std::vector<const llvm::Type*>::iterator LI = LLVMFields.begin(), |

