aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/MC/MCStreamer.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-01-22 07:29:22 +0000
committerChris Lattner <sabre@nondot.org>2010-01-22 07:29:22 +0000
commit86e2211d0a496f470ea1d320161c8dc43593c5c6 (patch)
tree37ffb8045c5d840590e19e56933f20e1f409fbcb /include/llvm/MC/MCStreamer.h
parent07404415ab97883b80d0dd87f1c5308e4eccbfd4 (diff)
downloadexternal_llvm-86e2211d0a496f470ea1d320161c8dc43593c5c6.zip
external_llvm-86e2211d0a496f470ea1d320161c8dc43593c5c6.tar.gz
external_llvm-86e2211d0a496f470ea1d320161c8dc43593c5c6.tar.bz2
Add the ability for MCStreamer to emit comments on the same line as directives.
Switch over the asm-verbose comment for double values to use it. We now get: _x: .long 343597384 ## double 1.231200e+02 .long 1079953326 For example, note that the comment is on the same line as the .long. Woo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94166 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/MC/MCStreamer.h')
-rw-r--r--include/llvm/MC/MCStreamer.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/llvm/MC/MCStreamer.h b/include/llvm/MC/MCStreamer.h
index 1afa6dc..6afe1bf 100644
--- a/include/llvm/MC/MCStreamer.h
+++ b/include/llvm/MC/MCStreamer.h
@@ -26,7 +26,9 @@ namespace llvm {
class MCSection;
class MCSymbol;
class StringRef;
+ class Twine;
class raw_ostream;
+ class formatted_raw_ostream;
/// MCStreamer - Streaming machine code generation interface. This interface
/// is intended to provide a programatic interface that is very similar to the
@@ -79,6 +81,15 @@ namespace llvm {
MCContext &getContext() const { return Context; }
+ /// addComment - Add a comment that can be emitted to the generated .s
+ /// file if applicable as a QoI issue to make the output of the compiler
+ /// more readable. This only affects the MCAsmStreamer, and only when
+ /// verbose assembly output is enabled.
+ ///
+ /// If the comment includes embedded \n's, they will each get the comment
+ /// prefix as appropriate. The added comment should not end with a \n.
+ virtual void addComment(const Twine &T) {}
+
/// @name Symbol & Section Management
/// @{
@@ -234,7 +245,7 @@ namespace llvm {
/// createAsmStreamer - Create a machine code streamer which will print out
/// assembly for the native target, suitable for compiling with a native
/// assembler.
- MCStreamer *createAsmStreamer(MCContext &Ctx, raw_ostream &OS,
+ MCStreamer *createAsmStreamer(MCContext &Ctx, formatted_raw_ostream &OS,
const MCAsmInfo &MAI, bool isLittleEndian,
bool isVerboseAsm,
MCInstPrinter *InstPrint = 0,