Jake-Egan marked 6 inline comments as done.
Jake-Egan added inline comments.


================
Comment at: llvm/lib/MC/MCAsmStreamer.cpp:1022
+  if (PaddingSize) {
+    assert(PaddedSize - Index == WordSize);
+    std::array<uint8_t, WordSize> LastWord = {0};
----------------
I changed the assert that you requested because it would always fail:

```
assert(Length - Index == MetadataPaddingSize);
```



================
Comment at: llvm/lib/MC/MCAsmStreamer.cpp:980
+  size_t MetadataSize = Metadata.size();
+  uint32_t MetadataPaddingSize = 3 - (MetadataSize - 1) % 4;
+
----------------
scott.linder wrote:
> scott.linder wrote:
> > I couldn't quickly find a reference for the alignment requirement, but it 
> > seems like there is an additional requirement that the length must also be 
> > non-zero, not just even?
> > 
> > If so, can you update the comment?
> > 
> > I would also rather explicitly use `alignTo` and `max` to express this (see 
> > suggestion), but if we don't expect the optimizer to clean it up I'm fine 
> > with the more terse version.
> Can you factor this out at function scope? It gets repeated below
The length can be zero. See second paragraph of the comment section: 
https://www.ibm.com/docs/en/aix/7.2?topic=formats-xcoff-object-file-format#XCOFF__a1pyfk2b4joyc__title__1


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

https://reviews.llvm.org/D153600

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to