[clang] Enable -mms-bitfields by default for mingw targets

This matches GCC, which enabled -mms-bitfields by default for
mingw targets in 4.7 [1].

[1] https://www.gnu.org/software/gcc/gcc-4.7/changes.html

Differential Revision: https://reviews.llvm.org/D81795
This commit is contained in:
Martin Storsjö 2020-06-13 23:04:40 +03:00
parent 7b3fe96992
commit e3fd9dc973
2 changed files with 3 additions and 2 deletions

View File

@ -4679,7 +4679,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back("-fforbid-guard-variables");
if (Args.hasFlag(options::OPT_mms_bitfields, options::OPT_mno_ms_bitfields,
false)) {
Triple.isWindowsGNUEnvironment())) {
CmdArgs.push_back("-mms-bitfields");
}

View File

@ -1,4 +1,5 @@
// RUN: %clang -### %s 2>&1 | FileCheck %s -check-prefix=NO-MSBITFIELDS
// RUN: %clang -### -target x86_64-linux-gnu %s 2>&1 | FileCheck %s -check-prefix=NO-MSBITFIELDS
// RUN: %clang -### -target x86_64-windows-gnu %s 2>&1 | FileCheck %s -check-prefix=MSBITFIELDS
// RUN: %clang -### -mno-ms-bitfields -mms-bitfields %s 2>&1 | FileCheck %s -check-prefix=MSBITFIELDS
// RUN: %clang -### -mms-bitfields -mno-ms-bitfields %s 2>&1 | FileCheck %s -check-prefix=NO-MSBITFIELDS