[PATCH] D44184: Write DWARF data into WASM object file

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 18 22:06:02 PDT 2018


sbc100 added inline comments.


================
Comment at: lib/MC/WasmObjectWriter.cpp:177
+  MCSectionWasm *Section;
+  bool IsDebug;
 
----------------
Looks like this field isn't used. Remove?


================
Comment at: lib/MC/WasmObjectWriter.cpp:401
   if (FixupSection.getKind().isMetadata())
-    return;
+    if (!FixupSection.getSectionName().startswith(".debug_"))
+      return;
----------------
Make this into a single condition?

In my simple test it looks like ".comment" is the only other section.. maybe we should allow that and just remove this condition? Or that can be a followup CL.


================
Comment at: lib/MC/WasmObjectWriter.cpp:1236
+
+    if (!SectionName.startswith(".debug_"))
+      continue;
----------------
Can we check for isMetadata here as well and perhaps copy the TODO about allowing all metadata sections from above?


================
Comment at: lib/MC/WasmObjectWriter.cpp:1242
+
+    auto SymbolName = (".Lsection_start" + SectionName).str();
+    MCSymbolWasm *SectionSym =
----------------
Is this what ELF calls these?  I thought it was just ".data" etc.  perhaps you can just use SectionName for this symbol name since it already starts with "." so can't conflict with a C/C++ symbol?




Repository:
  rL LLVM

https://reviews.llvm.org/D44184





More information about the llvm-commits mailing list