[PATCH] D132508: [MC] Omit fill value if it's zero when emitting code alignment

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 24 11:53:46 PDT 2022


efriedma added inline comments.


================
Comment at: llvm/lib/MC/MCAsmStreamer.cpp:248
 
+  void emitValueToAlignmentIfNotOmit(unsigned ByteAlignment, int64_t Value,
+                                     unsigned ValueSize,
----------------
The name "emitValueToAlignmentIfNotOmit" doesn't make any sense; the "IfNotOmit" part isn't related to the rest of the name.  Maybe just "emitAlignmentDirective"?


================
Comment at: llvm/lib/MC/MCAsmStreamer.cpp:251
+                                     unsigned MaxBytesToEmit,
+                                     bool OmitValueIfZero);
+
----------------
The logic around OmitValueIfZero is sort of hard to understand.  Maybe pass in an `Optional<int64_t> Value`, and make the caller figure out whether the value should be omitted?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132508



More information about the llvm-commits mailing list