summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2018-07-25 18:35:42 +0000
committerMartin Storsjo <martin@martin.st>2018-07-25 18:35:42 +0000
commitff33a95ed44b9c146d3b58517717a4163b479b02 (patch)
tree1a5ce9e0ec6d53b7fcd6bd3739919d19d432c4a5 /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
parentd2662c32fbb8ded38cd48fea954aea66864eb37d (diff)
downloadbcm5719-llvm-ff33a95ed44b9c146d3b58517717a4163b479b02.tar.gz
bcm5719-llvm-ff33a95ed44b9c146d3b58517717a4163b479b02.zip
[COFF] Use comdat shared constants for MinGW as well
GNU binutils tools have no problems with this kind of shared constants, provided that we actually hook it up completely in AsmPrinter and produce a global symbol. This effectively reverts SVN r335918 by hooking the rest of it up properly. This feature was implemented originally in SVN r213006, with no reason for why it can't be used for MinGW other than the fact that GCC doesn't do it while MSVC does. Differential Revision: https://reviews.llvm.org/D49646 llvm-svn: 337951
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index b5dd2d4cca8..149cec26411 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -1396,12 +1396,7 @@ static std::string scalarConstantToHexString(const Constant *C) {
MCSection *TargetLoweringObjectFileCOFF::getSectionForConstant(
const DataLayout &DL, SectionKind Kind, const Constant *C,
unsigned &Align) const {
- if (Kind.isMergeableConst() && C &&
- getContext().getAsmInfo()->hasCOFFComdatConstants()) {
- // This creates comdat sections with the given symbol name, but unless
- // AsmPrinter::GetCPISymbol actually makes the symbol global, the symbol
- // will be created with a null storage class, which makes GNU binutils
- // error out.
+ if (Kind.isMergeableConst() && C) {
const unsigned Characteristics = COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
COFF::IMAGE_SCN_MEM_READ |
COFF::IMAGE_SCN_LNK_COMDAT;
OpenPOWER on IntegriCloud