[PATCH] D74531: [WebAssembly] Emit clangast in custom section aligned by 4 bytes

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 18 09:18:41 PDT 2021


sbc100 added inline comments.


================
Comment at: llvm/lib/MC/WasmObjectWriter.cpp:374
+  // Custom sections in wasm also have a string identifier with extra paddings
+  // for alignment for special sections.
+  // TODO: support section alignment at asm and llvm level?
----------------
I would leave the first sentence alone which that applies to all custom sections.    The second part of this sentence (the new part) is maybe not needed since you have a comment already on line 378.

Also, how about keeping the simpler form in the default case, and putting this new code in a new method. e.g.:

```
if (Name != "__clangast") {
  writeString(Name);
} else {
  writeStringWithAlignment(Name, 4);
}
```

Then the entire new method can be marked with the TODO to remove it if/when we change the section mapping.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74531



More information about the llvm-commits mailing list