SecureLog = nullptr;
SecureLogUsed = false;
- if (SrcMgr && SrcMgr->getNumBuffers() > 0)
- MainFileName = SrcMgr->getMemoryBuffer(0)->getBufferIdentifier();
+ if (SrcMgr && SrcMgr->getNumBuffers())
+ MainFileName =
+ SrcMgr->getMemoryBuffer(SrcMgr->getMainFileID())->getBufferIdentifier();
}
MCContext::~MCContext() {
}
MCSymbol *MCContext::CreateLinkerPrivateTempSymbol() {
- small_string_ostream<128> NameSV;
- NameSV << MAI->getLinkerPrivateGlobalPrefix() << "tmp" << NextUniqueID++;
- return CreateSymbol(NameSV.str());
+ SmallString<128> NameSV;
+ raw_svector_ostream(NameSV)
+ << MAI->getLinkerPrivateGlobalPrefix() << "tmp" << NextUniqueID++;
+ return CreateSymbol(NameSV);
}
MCSymbol *MCContext::CreateTempSymbol() {
- small_string_ostream<128> NameSV;
- NameSV << MAI->getPrivateGlobalPrefix() << "tmp" << NextUniqueID++;
- return CreateSymbol(NameSV.str());
+ SmallString<128> NameSV;
+ raw_svector_ostream(NameSV)
+ << MAI->getPrivateGlobalPrefix() << "tmp" << NextUniqueID++;
+ return CreateSymbol(NameSV);
}
unsigned MCContext::NextInstance(unsigned LocalLabelVal) {
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;
- const MCSymbol *COMDATSymbol = nullptr;
+ MCSymbol *COMDATSymbol = nullptr;
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);
}
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;