From: Eli Friedman Date: Tue, 20 May 2008 15:17:39 +0000 (+0000) Subject: Remove hacks from ASTContext now that alignment gets reported correctly. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4210802b1e07ecf5c0d3a63622e49e0533ef329a;p=clang Remove hacks from ASTContext now that alignment gets reported correctly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51322 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 8fd088a305..12bbee2d9f 100644 --- a/lib/AST/ASTContext.cpp +++ b/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 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); }