[cfe-commits] r51322 - /cfe/trunk/lib/AST/ASTContext.cpp
Eli Friedman
eli.friedman at gmail.com
Tue May 20 08:17:39 PDT 2008
Author: efriedma
Date: Tue May 20 10:17:39 2008
New Revision: 51322
URL: http://llvm.org/viewvc/llvm-project?rev=51322&view=rev
Log:
Remove hacks from ASTContext now that alignment gets reported correctly.
Modified:
cfe/trunk/lib/AST/ASTContext.cpp
Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=51322&r1=51321&r2=51322&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Tue May 20 10:17:39 2008
@@ -354,11 +354,7 @@
else if (FieldIsPacked)
FieldAlign = 8;
else {
- // FIXME: This is X86 specific, use 32-bit alignment for long long.
- if (FD->getType()->isIntegerType() && TypeInfo.second > 32)
- FieldAlign = 32;
- else
- FieldAlign = TypeInfo.second;
+ FieldAlign = TypeInfo.second;
}
// Check if we need to add padding to give the field the correct
@@ -418,17 +414,13 @@
std::pair<uint64_t, unsigned> FieldInfo = getTypeInfo(FD->getType());
uint64_t FieldSize = FieldInfo.first;
unsigned FieldAlign = FieldInfo.second;
-
- // FIXME: This is X86 specific, use 32-bit alignment for long long.
- if (FD->getType()->isIntegerType() && FieldAlign > 32)
- FieldAlign = 32;
// Round up the current record size to the field's alignment boundary.
RecordSize = std::max(RecordSize, FieldSize);
-
+
// Place this field at the start of the record.
FieldOffsets[i] = 0;
-
+
// Remember max struct/class alignment.
RecordAlign = std::max(RecordAlign, FieldAlign);
}
More information about the cfe-commits
mailing list