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

Martin Storsjö via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 16 23:57:53 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGe3fd9dc9734c: [clang] Enable -mms-bitfields by default for mingw targets (authored by mstorsjo).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81795/new/

https://reviews.llvm.org/D81795

Files:
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/Driver/ms-bitfields.c


Index: clang/test/Driver/ms-bitfields.c
===================================================================
--- clang/test/Driver/ms-bitfields.c
+++ clang/test/Driver/ms-bitfields.c
@@ -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
 
Index: clang/lib/Driver/ToolChains/Clang.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -4679,7 +4679,7 @@
     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");
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81795.271283.patch
Type: text/x-patch
Size: 1165 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200617/ad41ddd3/attachment.bin>


More information about the cfe-commits mailing list