[PATCH] D20020: Provide support for preserving assembly comments

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 6 08:18:59 PDT 2016

rnk added a comment.

Hm, sorry, I never hit submit.

In http://reviews.llvm.org/D20020#452579, @niravd wrote:

> In http://reviews.llvm.org/D20020#452526, @majnemer wrote:
> > What is the rationale behind adding this functionality to MC?
> There are some projects which rely on emitted comments from inline assembly, e.g., Seabios. As a result when compiling with clang they turn off the integrated assembler.

I think we should support this functionality so that we can give a reasonable workaround to the Linux kernel people for this: https://llvm.org/bugs/show_bug.cgi?id=18891

Comment at: include/llvm/MC/MCStreamer.h:281
@@ +280,3 @@
+  /// \brief emit explicit comments
+  virtual void outputExplicitComments();
This is only called from MCAsmStreamer. Should we sink it down there and devirtualize it, or do we think there will be clients other than EmitEOL?

Comment at: include/llvm/Target/TargetOptions.h:191
@@ +190,3 @@
+    /// Disable the integrated assembler.
+    unsigned PreserveAsmComments : 1;
This should really live in MCTargetOptions next to AsmVerbose, IMO.

Comment at: lib/MC/MCAsmInfo.cpp:110
@@ -109,2 +109,3 @@
   UseIntegratedAssembler = false;
+  PreserveAsmComments = true;
Why default to true?


More information about the llvm-commits mailing list