summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCAsmStreamer.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-02-10 00:10:18 +0000
committerChris Lattner <sabre@nondot.org>2010-02-10 00:10:18 +0000
commit482bf69bfe033b5730f316d92d7503d4a99bd6b9 (patch)
treec6a5d6f11cc29dcea5ef56aa62268002bf718506 /llvm/lib/MC/MCAsmStreamer.cpp
parent509be1fe5ec243bfe9553bf2abaa53e239b34d69 (diff)
downloadbcm5719-llvm-482bf69bfe033b5730f316d92d7503d4a99bd6b9.tar.gz
bcm5719-llvm-482bf69bfe033b5730f316d92d7503d4a99bd6b9.zip
Add ability for MCInstPrinters to add comments for instructions.
Enhance the x86 backend to show the hex values of immediates in comments when they are large. For example: movl $1072693248, 4(%esp) ## imm = 0x3FF00000 llvm-svn: 95728
Diffstat (limited to 'llvm/lib/MC/MCAsmStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCAsmStreamer.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCAsmStreamer.cpp b/llvm/lib/MC/MCAsmStreamer.cpp
index 0abd485ac18..b63427ac187 100644
--- a/llvm/lib/MC/MCAsmStreamer.cpp
+++ b/llvm/lib/MC/MCAsmStreamer.cpp
@@ -48,7 +48,10 @@ public:
: MCStreamer(Context), OS(os), MAI(mai), InstPrinter(printer),
Emitter(emitter), CommentStream(CommentToEmit),
IsLittleEndian(isLittleEndian), IsVerboseAsm(isVerboseAsm),
- ShowFixups(showFixups), ShowInst(showInst) {}
+ ShowFixups(showFixups), ShowInst(showInst) {
+ if (InstPrinter && IsVerboseAsm)
+ InstPrinter->setCommentStream(CommentStream);
+ }
~MCAsmStreamer() {}
bool isLittleEndian() const { return IsLittleEndian; }
OpenPOWER on IntegriCloud