From f209e26fcc1f3479b861aeb295b739e3631bb86e Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 21 May 2015 16:19:32 +0000 Subject: [PATCH] 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 --- include/llvm/MC/MCContext.h | 2 +- lib/MC/MCParser/ELFAsmParser.cpp | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/include/llvm/MC/MCContext.h b/include/llvm/MC/MCContext.h index fd0181e66ab..9dbb7b382e6 100644 --- a/include/llvm/MC/MCContext.h +++ b/include/llvm/MC/MCContext.h @@ -469,7 +469,7 @@ namespace llvm { void setGenDwarfFileNumber(unsigned FileNumber) { GenDwarfFileNumber = FileNumber; } - MapVector> & + const MapVector> & getGenDwarfSectionSyms() { return SectionStartEndSyms; } diff --git a/lib/MC/MCParser/ELFAsmParser.cpp b/lib/MC/MCParser/ELFAsmParser.cpp index 9cee2e60696..d99a6c4836b 100644 --- a/lib/MC/MCParser/ELFAsmParser.cpp +++ b/lib/MC/MCParser/ELFAsmParser.cpp @@ -532,9 +532,7 @@ EndStmt: getStreamer().SwitchSection(ELFSection, Subsection); if (getContext().getGenDwarfForAssembly()) { - auto &Sections = getContext().getGenDwarfSectionSyms(); - auto InsertResult = Sections.insert( - std::make_pair(ELFSection, std::make_pair(nullptr, nullptr))); + auto InsertResult = getContext().addGenDwarfSection(ELFSection); if (InsertResult.second) { if (getContext().getDwarfVersion() <= 2) Warning(loc, "DWARF2 only supports one section per compilation unit");