add a new MachineModuleInfoMachO class, which is the per-module
[llvm/avr.git] / lib / MC / MCInst.cpp
blobd05031870add8487c8101a2f407505146d857648
1 //===- lib/MC/MCInst.cpp - MCInst implementation --------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
10 #include "llvm/MC/MCInst.h"
11 #include "llvm/MC/MCExpr.h"
12 #include "llvm/Support/raw_ostream.h"
14 using namespace llvm;
16 void MCOperand::print(raw_ostream &OS, const MCAsmInfo *MAI) const {
17 OS << "<MCOperand ";
18 if (!isValid())
19 OS << "INVALID";
20 else if (isReg())
21 OS << "Reg:" << getReg();
22 else if (isImm())
23 OS << "Imm:" << getImm();
24 else if (isExpr()) {
25 OS << "Expr:(";
26 getExpr()->print(OS, MAI);
27 OS << ")";
28 } else
29 OS << "UNDEFINED";
30 OS << ">";
33 void MCOperand::dump() const {
34 print(errs(), 0);
35 errs() << "\n";
38 void MCInst::print(raw_ostream &OS, const MCAsmInfo *MAI) const {
39 OS << "<MCInst " << getOpcode();
40 for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
41 OS << " ";
42 getOperand(i).print(OS, MAI);
44 OS << ">";
47 void MCInst::dump() const {
48 print(errs(), 0);
49 errs() << "\n";