summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCContext.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2014-06-27 17:19:44 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2014-06-27 17:19:44 +0000
commitc57d0382402a0422a7cf9312c50a97b8be092943 (patch)
tree52097bd611a448d9bef0745f507464237b7461d8 /llvm/lib/MC/MCContext.cpp
parent05d761cf244c3a917285b51f84ee8bfd82286684 (diff)
downloadbcm5719-llvm-c57d0382402a0422a7cf9312c50a97b8be092943.tar.gz
bcm5719-llvm-c57d0382402a0422a7cf9312c50a97b8be092943.zip
MC: Fix associative sections on COFF
COFF sections in MC were represented by a tuple of section-name and COMDAT-name. This is not sufficient to represent a .text section associated with another .text section; we need a way to distinguish between the key section and the one marked associative. llvm-svn: 211913
Diffstat (limited to 'llvm/lib/MC/MCContext.cpp')
-rw-r--r--llvm/lib/MC/MCContext.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp
index bd2c4e960ac..cfdab0cba8b 100644
--- a/llvm/lib/MC/MCContext.cpp
+++ b/llvm/lib/MC/MCContext.cpp
@@ -284,8 +284,8 @@ const MCSectionCOFF *MCContext::getCOFFSection(StringRef Section,
int Selection) {
// Do the lookup, if we have a hit, return it.
- SectionGroupPair P(Section, COMDATSymName);
- auto IterBool = COFFUniquingMap.insert(std::make_pair(P, nullptr));
+ SectionGroupTriple T(Section, COMDATSymName, Selection);
+ auto IterBool = COFFUniquingMap.insert(std::make_pair(T, nullptr));
auto Iter = IterBool.first;
if (!IterBool.second)
return Iter->second;
@@ -294,7 +294,7 @@ const MCSectionCOFF *MCContext::getCOFFSection(StringRef Section,
if (!COMDATSymName.empty())
COMDATSymbol = GetOrCreateSymbol(COMDATSymName);
- StringRef CachedName = Iter->first.first;
+ StringRef CachedName = std::get<0>(Iter->first);
MCSectionCOFF *Result = new (*this)
MCSectionCOFF(CachedName, Characteristics, COMDATSymbol, Selection, Kind);
@@ -309,8 +309,8 @@ MCContext::getCOFFSection(StringRef Section, unsigned Characteristics,
}
const MCSectionCOFF *MCContext::getCOFFSection(StringRef Section) {
- SectionGroupPair P(Section, "");
- auto Iter = COFFUniquingMap.find(P);
+ SectionGroupTriple T(Section, "", 0);
+ auto Iter = COFFUniquingMap.find(T);
if (Iter == COFFUniquingMap.end())
return nullptr;
return Iter->second;
OpenPOWER on IntegriCloud