[PATCH] D45340: [WebAssembly] Add support for user-defined custom sections

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 9 16:05:22 PDT 2018


ruiu added inline comments.


================
Comment at: wasm/OutputSections.h:116
 
+class CustomSection : public OutputSection {
+public:
----------------
ruiu wrote:
> Please add a class comment.
Can you expand the comment so that those who don't really now what "custom section" is can understand this comment? Currently, in order to understand this comment, you need to know what custom section is before reading this comment.

You need to explain that in wasm, text, data, and some other sections are special sections that are identified by type, and unlike other file formats, they don't have name. However, you can still add sections that don't have special type and have name just like normal sections in other file formats, and such sections are called "custom sections" in wasm.


================
Comment at: wasm/Writer.cpp:304-305
+  log("createCustomSections");
+  for (ObjFile *File : Symtab->ObjectFiles) {
+    for (InputSection *Section : File->CustomSections) {
+      CustomSectionMapping[Section->getName()].push_back(Section);
----------------
nit: we omit `{` if the content is only one line.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D45340





More information about the llvm-commits mailing list