[PATCH] D38588: Clear LastMappingSymbols and LastEMS(Info) when resetting the ARM(AArch64)ELFStreamer

Yichao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 25 08:10:48 PDT 2017


yuyichao updated this revision to Diff 120259.
yuyichao added a comment.

Thanks for the review. Test removed and patch updated. I'll merge some time tomorrow.


https://reviews.llvm.org/D38588

Files:
  lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp
  lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp


Index: lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
===================================================================
--- lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
+++ lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
@@ -1171,6 +1171,8 @@
   ATS.reset();
   MappingSymbolCounter = 0;
   MCELFStreamer::reset();
+  LastMappingSymbols.clear();
+  LastEMSInfo.reset();
   // MCELFStreamer clear's the assembler's e_flags. However, for
   // arm we manually set the ABI version on streamer creation, so
   // do the same here
Index: lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp
===================================================================
--- lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp
+++ lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp
@@ -102,6 +102,14 @@
     MCELFStreamer::ChangeSection(Section, Subsection);
   }
 
+  // Reset state between object emissions
+  void reset() override {
+    MappingSymbolCounter = 0;
+    MCELFStreamer::reset();
+    LastMappingSymbols.clear();
+    LastEMS = EMS_None;
+  }
+
   /// This function is the one used to emit instruction data into the ELF
   /// streamer. We override it to add the appropriate mapping symbol if
   /// necessary.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38588.120259.patch
Type: text/x-patch
Size: 1222 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171025/0a21f387/attachment.bin>


More information about the llvm-commits mailing list