[PATCH] D126509: [Objcopy][Wasm] Allow selecting known sections by name

Derek Schuff via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 6 13:48:16 PDT 2022


dschuff added inline comments.


================
Comment at: llvm/lib/ObjCopy/wasm/WasmReader.cpp:30
+    if (ReaderSec.SectionType > WASM_SEC_CUSTOM &&
+        ReaderSec.SectionType <= WASM_SEC_TAG)
+      ReaderSec.Name = sectionTypeToString(ReaderSec.SectionType);
----------------
aheejin wrote:
> Maybe create `WASM_LAST_SEC` or something?
Yeah, I noticed that we don't have that anywhere else in BinaryFormat/Wasm.h but you're right that it's used elsewhere in LLVM. Maybe we should add it for this case anyway. There are 2 other places in the code where we compare this way and it does seem like it's a bug waiting to happen. I'll go ahead and do that in a followup.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126509



More information about the llvm-commits mailing list