summaryrefslogtreecommitdiff
path: root/lib/MC/MCAsmStreamer.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-08-31 08:08:38 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-08-31 08:08:38 +0000
commit8c2eebe4074ef218b30d94358f6b2e45c079605c (patch)
treee44c45883a8e8d40ba8b2529f467378cb0233538 /lib/MC/MCAsmStreamer.cpp
parentc18274ba9cabd5699452870daae3c2d9accecc37 (diff)
downloadllvm-8c2eebe4074ef218b30d94358f6b2e45c079605c.tar.gz
llvm-8c2eebe4074ef218b30d94358f6b2e45c079605c.tar.bz2
llvm-8c2eebe4074ef218b30d94358f6b2e45c079605c.tar.xz
llvm-mc: Switch MCInst to storing an MCExpr* instead of an MCValue.
Also, use MCInst::print instead of custom code in MCAsmPrinter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80575 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCAsmStreamer.cpp')
-rw-r--r--lib/MC/MCAsmStreamer.cpp26
1 files changed, 4 insertions, 22 deletions
diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp
index e5899fc899..d0a2ebbc30 100644
--- a/lib/MC/MCAsmStreamer.cpp
+++ b/lib/MC/MCAsmStreamer.cpp
@@ -10,13 +10,14 @@
#include "llvm/MC/MCStreamer.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/CodeGen/AsmPrinter.h"
+#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCCodeEmitter.h"
#include "llvm/MC/MCContext.h"
+#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCInst.h"
#include "llvm/MC/MCSectionMachO.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/MC/MCValue.h"
-#include "llvm/MC/MCAsmInfo.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/Format.h"
@@ -271,18 +272,6 @@ void MCAsmStreamer::EmitValueToOffset(const MCValue &Offset,
OS << ".org " << Offset << ", " << (unsigned) Value << '\n';
}
-static raw_ostream &operator<<(raw_ostream &OS, const MCOperand &Op) {
- if (Op.isReg())
- return OS << "reg:" << Op.getReg();
- if (Op.isImm())
- return OS << "imm:" << Op.getImm();
- if (Op.isMBBLabel())
- return OS << "mbblabel:("
- << Op.getMBBLabelFunction() << ", " << Op.getMBBLabelBlock();
- assert(Op.isMCValue() && "Invalid operand!");
- return OS << "val:" << Op.getMCValue();
-}
-
void MCAsmStreamer::EmitInstruction(const MCInst &Inst) {
assert(CurSection && "Cannot emit contents before setting section!");
@@ -312,15 +301,8 @@ void MCAsmStreamer::EmitInstruction(const MCInst &Inst) {
// Otherwise fall back to a structural printing for now. Eventually we should
// always have access to the target specific printer.
- OS << "MCInst("
- << "opcode=" << Inst.getOpcode() << ", "
- << "operands=[";
- for (unsigned i = 0, e = Inst.getNumOperands(); i != e; ++i) {
- if (i)
- OS << ", ";
- OS << Inst.getOperand(i);
- }
- OS << "])\n";
+ Inst.print(OS);
+ OS << '\n';
}
void MCAsmStreamer::Finish() {