[llvm-branch-commits] [cfe-branch] r353825 - Merging r353411:

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Feb 12 02:56:22 PST 2019


Author: hans
Date: Tue Feb 12 02:56:21 2019
New Revision: 353825

URL: http://llvm.org/viewvc/llvm-project?rev=353825&view=rev
Log:
Merging r353411:
------------------------------------------------------------------------
r353411 | erichkeane | 2019-02-07 16:14:11 +0100 (Thu, 07 Feb 2019) | 7 lines

Fix r350643 to limit COFF emission to <= 32 BYTES instead of BITS.

The patch in r350643 incorrectly sets the COFF emission based on bits
instead of bytes. This patch converts the 32 via CharUnits to bits to
compare the correct values.

Change-Id: Icf38a16470ad5ae3531374969c033557ddb0d323
------------------------------------------------------------------------

Modified:
    cfe/branches/release_80/   (props changed)
    cfe/branches/release_80/lib/CodeGen/CodeGenModule.cpp
    cfe/branches/release_80/test/CodeGen/microsoft-no-common-align.c

Propchange: cfe/branches/release_80/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Feb 12 02:56:21 2019
@@ -1,4 +1,4 @@
 /cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:351334,351340,351344,351360,351457,351459,351531,351579-351580,352040,352079,352099,352102,352105,352156,352221-352222,352229,352307,352323,352463,352539,352610,352672,352822,353142,353393,353495
+/cfe/trunk:351334,351340,351344,351360,351457,351459,351531,351579-351580,352040,352079,352099,352102,352105,352156,352221-352222,352229,352307,352323,352463,352539,352610,352672,352822,353142,353393,353411,353495
 /cfe/trunk/test:170344
 /cfe/trunk/test/SemaTemplate:126920

Modified: cfe/branches/release_80/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_80/lib/CodeGen/CodeGenModule.cpp?rev=353825&r1=353824&r2=353825&view=diff
==============================================================================
--- cfe/branches/release_80/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/branches/release_80/lib/CodeGen/CodeGenModule.cpp Tue Feb 12 02:56:21 2019
@@ -3762,13 +3762,15 @@ static bool isVarDeclStrongDefinition(co
     }
   }
 
-  // Microsoft's link.exe doesn't support alignments greater than 32 for common
-  // symbols, so symbols with greater alignment requirements cannot be common.
+  // Microsoft's link.exe doesn't support alignments greater than 32 bytes for
+  // common symbols, so symbols with greater alignment requirements cannot be
+  // common.
   // Other COFF linkers (ld.bfd and LLD) support arbitrary power-of-two
   // alignments for common symbols via the aligncomm directive, so this
   // restriction only applies to MSVC environments.
   if (Context.getTargetInfo().getTriple().isKnownWindowsMSVCEnvironment() &&
-      Context.getTypeAlignIfKnown(D->getType()) > 32)
+      Context.getTypeAlignIfKnown(D->getType()) >
+          Context.toBits(CharUnits::fromQuantity(32)))
     return true;
 
   return false;

Modified: cfe/branches/release_80/test/CodeGen/microsoft-no-common-align.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_80/test/CodeGen/microsoft-no-common-align.c?rev=353825&r1=353824&r2=353825&view=diff
==============================================================================
--- cfe/branches/release_80/test/CodeGen/microsoft-no-common-align.c (original)
+++ cfe/branches/release_80/test/CodeGen/microsoft-no-common-align.c Tue Feb 12 02:56:21 2019
@@ -6,3 +6,6 @@ TooLargeAlignment TooBig;
 // CHECK: @TooBig = dso_local global <16 x float>  zeroinitializer, align 64
 NormalAlignment JustRight;
 // CHECK: @JustRight = common dso_local global <1 x float>  zeroinitializer, align 4
+
+TooLargeAlignment *IsAPointer;
+// CHECK: @IsAPointer = common dso_local global <16 x float>* null, align 8




More information about the llvm-branch-commits mailing list