1 //===- lib/MC/MCInst.cpp - MCInst implementation --------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "llvm/MC/MCInst.h"
11 #include "llvm/MC/MCExpr.h"
12 #include "llvm/Support/raw_ostream.h"
16 void MCOperand::print(raw_ostream &OS, const MCAsmInfo *MAI) const {
21 OS << "Reg:" << getReg();
23 OS << "Imm:" << getImm();
24 else if (isMBBLabel())
25 OS << "MBB:(" << getMBBLabelFunction() << ","
26 << getMBBLabelBlock() << ")";
29 getExpr()->print(OS, MAI);
36 void MCOperand::dump() const {
41 void MCInst::print(raw_ostream &OS, const MCAsmInfo *MAI) const {
42 OS << "<MCInst " << getOpcode();
43 for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
45 getOperand(i).print(OS, MAI);
50 void MCInst::dump() const {