summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2008-05-20 15:17:39 +0000
committerEli Friedman <eli.friedman@gmail.com>2008-05-20 15:17:39 +0000
commitcc6b071c1e23903e897f8bf44f8006366b785c0b (patch)
tree9943e30961665411f205f08a3620bef57d3b319b /clang/lib/AST/ASTContext.cpp
parent7cef49e2d808445a230e563d31c97c1d91ed7c8f (diff)
downloadbcm5719-llvm-cc6b071c1e23903e897f8bf44f8006366b785c0b.tar.gz
bcm5719-llvm-cc6b071c1e23903e897f8bf44f8006366b785c0b.zip
Remove hacks from ASTContext now that alignment gets reported correctly.
llvm-svn: 51322
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r--clang/lib/AST/ASTContext.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 8fd088a305f..12bbee2d9fc 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -354,11 +354,7 @@ const ASTRecordLayout &ASTContext::getASTRecordLayout(const RecordDecl *D) {
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 @@ const ASTRecordLayout &ASTContext::getASTRecordLayout(const RecordDecl *D) {
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);
}
OpenPOWER on IntegriCloud