[PATCH] D72291: Reimplement BoundaryAlign mechanism (mostly, but not quite NFC)

Kan Shengchen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 6 19:01:35 PST 2020


skan added inline comments.


================
Comment at: llvm/include/llvm/MC/MCFragment.h:541-542
   uint64_t getSize() const { return Size; }
-  void setSize(uint64_t Value) { Size = Value; }
+  void setSize(uint64_t Value) {
+    assert(Value == (uint64_t)((uint16_t)Value));
+    Size = Value;
----------------
I think using `uint64_t` as the type of `Size` is good enough here. And the maximum size of the BoundaryAlignFragment is 30 (15+15, 15 is the maximum of an instruction) indeed.  So if you really want `Size` is more space-saving, I suggest `uint8_t`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72291





More information about the llvm-commits mailing list