Use existing helper for adding a section. NFC.
authorRafael Espindola <rafael.espindola@gmail.com>
Thu, 21 May 2015 16:19:32 +0000 (16:19 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Thu, 21 May 2015 16:19:32 +0000 (16:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237909 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/MC/MCContext.h
lib/MC/MCParser/ELFAsmParser.cpp

index fd0181e66ab0521768b3373ead92b5c15dec9c2a..9dbb7b382e6b7e333e7c9b83bb9f9169dc578168 100644 (file)
@@ -469,7 +469,7 @@ namespace llvm {
     void setGenDwarfFileNumber(unsigned FileNumber) {
       GenDwarfFileNumber = FileNumber;
     }
-    MapVector<const MCSection *, std::pair<MCSymbol *, MCSymbol *>> &
+    const MapVector<const MCSection *, std::pair<MCSymbol *, MCSymbol *>> &
     getGenDwarfSectionSyms() {
       return SectionStartEndSyms;
     }
index 9cee2e606966cc5b762d9ca94655c231bf9f78a9..d99a6c4836bc1e836f10d25697c3ed1b78714b3b 100644 (file)
@@ -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");