[MC] Factor MCObjectStreamer::addFragmentAtoms out of MachO streamer.
This code previously existed only in MCMachOStreamer but is
useful for WebAssembly too. See: D46335
Differential Revision: https://reviews.llvm.org/D46297
llvm-svn: 331412
diff --git a/llvm/lib/MC/MCWasmStreamer.cpp b/llvm/lib/MC/MCWasmStreamer.cpp
index 2c77624..504c72c 100644
--- a/llvm/lib/MC/MCWasmStreamer.cpp
+++ b/llvm/lib/MC/MCWasmStreamer.cpp
@@ -198,6 +198,9 @@
void MCWasmStreamer::FinishImpl() {
EmitFrames(nullptr);
+ // Set fragment atoms so we can map from code fragment to defining symbol
+ addFragmentAtoms();
+
this->MCObjectStreamer::FinishImpl();
}