[PATCH] D56466: [CodeGen] Clarify comment about COFF common symbol alignment
Shoaib Meenai via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 8 17:05:46 PST 2019
smeenai updated this revision to Diff 180771.
smeenai added a comment.
Refer to link.exe, and then also refer to other linkers in the second half of the comment to match
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56466/new/
https://reviews.llvm.org/D56466
Files:
lib/CodeGen/CodeGenModule.cpp
Index: lib/CodeGen/CodeGenModule.cpp
===================================================================
--- lib/CodeGen/CodeGenModule.cpp
+++ lib/CodeGen/CodeGenModule.cpp
@@ -3761,8 +3761,12 @@
}
}
}
- // COFF doesn't support alignments greater than 32, so these cannot be
- // in common.
+
+ // Microsoft's link.exe doesn't support alignments greater than 32 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)
return true;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56466.180771.patch
Type: text/x-patch
Size: 821 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190109/6b58168c/attachment.bin>
More information about the cfe-commits
mailing list