[PATCH] D77187: [lld][WebAssembly] Add initial support for -Map/--print-map

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 23 15:47:42 PDT 2020


MaskRay added inline comments.


================
Comment at: lld/test/ELF/map-file.s:14
 # RUN: ld.lld %t1.o %t2.o %t3.o %t4.a %t5.so -o %t -Map=%t.map
-# RUN: FileCheck -strict-whitespace %s < %t.map
+# RUN: FileCheck -match-full-lines -strict-whitespace %s < %t.map
 
----------------
I know some people prefer the double-dash options for `FileCheck` now. If you are going to add new lines or touching existing lines, you may use the double-dash form.


================
Comment at: lld/wasm/MapFile.cpp:132
+                    chunk->getSize());
+        os << indent8 << toString(chunk) << '\n';
+        for (Symbol *sym : sectionSyms[chunk])
----------------
`os.indent(8) << toString(chunk) << '\n'`


================
Comment at: lld/wasm/OutputSections.cpp:234
     section->outputSec = this;
+    section->outputOffset = payloadSize;
     payloadSize += section->getSize();
----------------
This order shuffle is not needed.


================
Comment at: lld/wasm/OutputSegment.h:41
   uint32_t startVA = 0;
+  OutputSection *outputSec = nullptr;
   std::vector<InputSegment *> inputSegments;
----------------
Add a comment what this means. It seems that `outputSec` is purely for debugging purposes (`-M`).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77187/new/

https://reviews.llvm.org/D77187





More information about the llvm-commits mailing list