summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/TargetLoweringObjectFile.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2014-07-14 22:57:27 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2014-07-14 22:57:27 +0000
commit8bce66b09392b03ef73e0db8419dfd42aaf73c82 (patch)
tree2b9e0581fb34175f3e7862c3a4f9b2b505eb70d1 /llvm/lib/Target/TargetLoweringObjectFile.cpp
parent2034ac81816d6de20b9e0253a6a2a09414571e0e (diff)
downloadbcm5719-llvm-8bce66b09392b03ef73e0db8419dfd42aaf73c82.tar.gz
bcm5719-llvm-8bce66b09392b03ef73e0db8419dfd42aaf73c82.zip
CodeGen: Stick constant pool entries in COMDAT sections for WinCOFF
COFF lacks a feature that other object file formats support: mergeable sections. To work around this, MSVC sticks constant pool entries in special COMDAT sections so that each constant is in it's own section. This permits unused constants to be dropped and it also allows duplicate constants in different translation units to get merged together. This fixes PR20262. Differential Revision: http://reviews.llvm.org/D4482 llvm-svn: 213006
Diffstat (limited to 'llvm/lib/Target/TargetLoweringObjectFile.cpp')
-rw-r--r--llvm/lib/Target/TargetLoweringObjectFile.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Target/TargetLoweringObjectFile.cpp b/llvm/lib/Target/TargetLoweringObjectFile.cpp
index 39e045919ab..2569e922641 100644
--- a/llvm/lib/Target/TargetLoweringObjectFile.cpp
+++ b/llvm/lib/Target/TargetLoweringObjectFile.cpp
@@ -297,7 +297,8 @@ TargetLoweringObjectFile::SelectSectionForGlobal(const GlobalValue *GV,
/// specified size and relocation information, return a section that it
/// should be placed in.
const MCSection *
-TargetLoweringObjectFile::getSectionForConstant(SectionKind Kind) const {
+TargetLoweringObjectFile::getSectionForConstant(SectionKind Kind,
+ const Constant *C) const {
if (Kind.isReadOnly() && ReadOnlySection != nullptr)
return ReadOnlySection;
OpenPOWER on IntegriCloud