[PATCH] D45822: [DEBUGINFO, NVPTX] Try to pack bytes data into a single string.

Eric Christopher via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 4 16:25:30 PDT 2018


echristo added a comment.

Some inline comments.



================
Comment at: lib/MC/MCAsmStreamer.cpp:862-883
+    if (const char *DirectiveSeparator = MAI->getDirectiveSeparator()) {
+      unsigned NumElements = Data.size();
+      unsigned MaxLen = MAI->getMaxNumberOfElements()
+                            ? MAI->getMaxNumberOfElements()
+                            : NumElements;
+      unsigned NumChunks = 1 + (NumElements - 1) / MaxLen;
+      // Split the very long directives into several parts if the limit is
----------------
echristo wrote:
> I'd prefer all of this (and basically the function) be sunk down into a target function for EmitBytes.
This now has duplicated code between here and emitRawBytes in the MCStreamer. Can you unify this please?


================
Comment at: lib/Target/NVPTX/MCTargetDesc/NVPTXTargetStreamer.cpp:101
+  const unsigned MaxLen = 40;
+  unsigned NumChunks = 1 + (NumElements - 1) / MaxLen;
+  // Split the very long directives into several parts if the limit is
----------------
Can you add some more parens for readability please?


Repository:
  rL LLVM

https://reviews.llvm.org/D45822





More information about the llvm-commits mailing list