summaryrefslogtreecommitdiffstats
path: root/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
commit5d672cfab096390690a1a5f33b0057c4cf252c55 (patch)
tree8b302847f85f74e88fce57840961a054fae60ae3 /lib/MC/MCAsmStreamer.cpp
parent51898d7a8948f7d9b1b498cf22609241945e994e (diff)
downloadexternal_llvm-5d672cfab096390690a1a5f33b0057c4cf252c55.zip
external_llvm-5d672cfab096390690a1a5f33b0057c4cf252c55.tar.gz
external_llvm-5d672cfab096390690a1a5f33b0057c4cf252c55.tar.bz2
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95728 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCAsmStreamer.cpp')
-rw-r--r--lib/MC/MCAsmStreamer.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp
index 0abd485..b63427a 100644
--- a/lib/MC/MCAsmStreamer.cpp
+++ b/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; }