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

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 5 10:32:26 PDT 2018


ABataev marked an inline comment as done.
ABataev added 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:
> 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?
It is not possible at the moment. We have the same problem for all the overloaded functions in MCTargetStreamer. The main problem is that not all targets define their own target streamer and sometimes `getTargetStreamer()` may return `nullptr`. But we still need some default behavior here. 


Repository:
  rL LLVM

https://reviews.llvm.org/D45822





More information about the llvm-commits mailing list