diff options
author | Reid Kleckner <rnk@google.com> | 2017-11-21 01:25:56 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2017-11-21 01:25:56 +0000 |
commit | 13a3d9eb7b898c47765dc1f16e982f407944de1d (patch) | |
tree | c5f18c3d5934e7f93b67fb224b4f81c0222277a0 /clang/lib/Basic | |
parent | 79708b54f2c1043e28d8d2fb46bb9b416b4806d6 (diff) | |
download | bcm5719-llvm-13a3d9eb7b898c47765dc1f16e982f407944de1d.tar.gz bcm5719-llvm-13a3d9eb7b898c47765dc1f16e982f407944de1d.zip |
[MS] Increase default new alignment for win64 and test it
Summary:
This raises __STDCPP_DEFAULT_NEW_ALIGNMENT__ from 8 to 16 on Win64.
This matches platforms that follow the usual `2 * sizeof(void*)`
alignment requirement for malloc. We might want to consider making that
the default rather than relying on long double alignment.
Fixes PR35356
Reviewers: STL_MSFT, rsmith
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D40277
llvm-svn: 318723
Diffstat (limited to 'clang/lib/Basic')
-rw-r--r-- | clang/lib/Basic/TargetInfo.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Basic/TargetInfo.cpp b/clang/lib/Basic/TargetInfo.cpp index c58ed1e300e..4d7387168e4 100644 --- a/clang/lib/Basic/TargetInfo.cpp +++ b/clang/lib/Basic/TargetInfo.cpp @@ -45,7 +45,7 @@ TargetInfo::TargetInfo(const llvm::Triple &T) : TargetOpts(), Triple(T) { // From the glibc documentation, on GNU systems, malloc guarantees 16-byte // alignment on 64-bit systems and 8-byte alignment on 32-bit systems. See // https://www.gnu.org/software/libc/manual/html_node/Malloc-Examples.html - if (T.isGNUEnvironment()) + if (T.isGNUEnvironment() || T.isWindowsMSVCEnvironment()) NewAlign = Triple.isArch64Bit() ? 128 : Triple.isArch32Bit() ? 64 : 0; else NewAlign = 0; // Infer from basic type alignment. |