Use existing helper for adding a section. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237909 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2015-05-21 16:19:32 +00:00
parent 57f70578fa
commit f209e26fcc
2 changed files with 2 additions and 4 deletions

View File

@ -469,7 +469,7 @@ namespace llvm {
void setGenDwarfFileNumber(unsigned FileNumber) { void setGenDwarfFileNumber(unsigned FileNumber) {
GenDwarfFileNumber = FileNumber; GenDwarfFileNumber = FileNumber;
} }
MapVector<const MCSection *, std::pair<MCSymbol *, MCSymbol *>> & const MapVector<const MCSection *, std::pair<MCSymbol *, MCSymbol *>> &
getGenDwarfSectionSyms() { getGenDwarfSectionSyms() {
return SectionStartEndSyms; return SectionStartEndSyms;
} }

View File

@ -532,9 +532,7 @@ EndStmt:
getStreamer().SwitchSection(ELFSection, Subsection); getStreamer().SwitchSection(ELFSection, Subsection);
if (getContext().getGenDwarfForAssembly()) { if (getContext().getGenDwarfForAssembly()) {
auto &Sections = getContext().getGenDwarfSectionSyms(); auto InsertResult = getContext().addGenDwarfSection(ELFSection);
auto InsertResult = Sections.insert(
std::make_pair(ELFSection, std::make_pair(nullptr, nullptr)));
if (InsertResult.second) { if (InsertResult.second) {
if (getContext().getDwarfVersion() <= 2) if (getContext().getDwarfVersion() <= 2)
Warning(loc, "DWARF2 only supports one section per compilation unit"); Warning(loc, "DWARF2 only supports one section per compilation unit");