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/Debug.h"
13 #include "llvm/Support/raw_ostream.h"
17 void MCOperand::print(raw_ostream &OS, const MCAsmInfo *MAI) const {
22 OS << "Reg:" << getReg();
24 OS << "Imm:" << getImm();
26 OS << "Expr:(" << *getExpr() << ")";
32 void MCOperand::dump() const {
37 void MCInst::print(raw_ostream &OS, const MCAsmInfo *MAI) const {
38 OS << "<MCInst " << getOpcode();
39 for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
41 getOperand(i).print(OS, MAI);
46 void MCInst::dump() const {