[PATCH] D127164: [WebAssembly] Add WASM_SEC_LAST_KNOWN to BinaryFormat section types list [NFC]

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 6 16:57:01 PDT 2022


aheejin added inline comments.


================
Comment at: llvm/include/llvm/BinaryFormat/Wasm.h:256
+  WASM_SEC_TAG = 13,       // Tag declarations
+  WASM_SEC_LAST_KNOWN = 14,// Update this when adding new sections
 };
----------------
- Does this pass clang-format? Because we don't have a space after `,`.
- 14 is not actually the last section known, because we don't have a section whose section code is 14. How about doing something like
```
WAS_SEC_LAST_KNOWN = WASM_SEC_TAG;
```
?


================
Comment at: llvm/lib/ObjCopy/wasm/WasmReader.cpp:32-35
-    // If the section type is CUSTOM, it has a name already. If it's a new type
-    // of section that we don't explicitly handle here, it will have an empty
-    // name and objcopy won't be able to select it by name (e.g. for removal
-    // or dumping) but it will still be valid and able to be copied.
----------------
Why was this removed? It doesn't look like it's related to the last section thing.. It's just explaning custom sections have names already.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127164



More information about the llvm-commits mailing list