diff options
author | Chad Rosier <mcrosier@apple.com> | 2011-07-25 19:39:39 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2011-07-25 19:39:39 +0000 |
commit | 822f54a7ba3eca643104623e8048be20a3391b19 (patch) | |
tree | 719e3f1babf4490a1e9a26dfe4a88d475aec6da1 /lib/AST/ASTContext.cpp | |
parent | 01231610bc89a8d3ae1bdfee0063af9386fd82a4 (diff) |
Allow target to specify about using minimum alignment vs preferred. Takes care of
FIXME: Override "preferred align" for double and long long for ARM apcs-gnu ABI.
Also part of rdar://9802874
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135940 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r-- | lib/AST/ASTContext.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 5463b7b7b0..c6e2c20df7 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -696,7 +696,10 @@ CharUnits ASTContext::getDeclAlign(const Decl *D, bool RefAsPointee) const { // Walk through any array types while we're at it. T = getBaseElementType(arrayType); } - Align = std::max(Align, getPreferredTypeAlign(T.getTypePtr())); + if (Target.usePreferredTypeAlign()) + Align = std::max(Align, getPreferredTypeAlign(T.getTypePtr())); + else + Align = std::max(Align, getTypeAlign(T.getTypePtr())); } // Fields can be subject to extra alignment constraints, like if |