[cfe-commits] r44831 - /cfe/trunk/CodeGen/CodeGenTypes.cpp
Devang Patel
dpatel at apple.com
Mon Dec 10 16:54:19 PST 2007
Author: dpatel
Date: Mon Dec 10 18:54:19 2007
New Revision: 44831
URL: http://llvm.org/viewvc/llvm-project?rev=44831&view=rev
Log:
Beautify comment.
Modified:
cfe/trunk/CodeGen/CodeGenTypes.cpp
Modified: cfe/trunk/CodeGen/CodeGenTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CodeGenTypes.cpp?rev=44831&r1=44830&r2=44831&view=diff
==============================================================================
--- cfe/trunk/CodeGen/CodeGenTypes.cpp (original)
+++ cfe/trunk/CodeGen/CodeGenTypes.cpp Mon Dec 10 18:54:19 2007
@@ -66,12 +66,16 @@
}
/// 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 @@
}
/// 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(),
More information about the cfe-commits
mailing list