You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.3 KiB
54 lines
1.3 KiB
//===- lib/MC/MCInst.cpp - MCInst implementation --------------------------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "llvm/MC/MCInst.h"
|
|
#include "llvm/MC/MCExpr.h"
|
|
#include "llvm/Support/Debug.h"
|
|
#include "llvm/Support/raw_ostream.h"
|
|
|
|
using namespace llvm_ks;
|
|
|
|
void MCOperand::print(raw_ostream &OS) const {
|
|
OS << "<MCOperand ";
|
|
if (!isValid())
|
|
OS << "INVALID";
|
|
else if (isReg())
|
|
OS << "Reg:" << getReg();
|
|
else if (isImm())
|
|
OS << "Imm:" << getImm();
|
|
else if (isFPImm())
|
|
OS << "FPImm:" << getFPImm();
|
|
else if (isExpr()) {
|
|
OS << "Expr:(" << *getExpr() << ")";
|
|
} else if (isInst()) {
|
|
OS << "Inst:(" << *getInst() << ")";
|
|
} else
|
|
OS << "UNDEFINED";
|
|
OS << ">";
|
|
}
|
|
|
|
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
|
|
LLVM_DUMP_METHOD void MCOperand::dump() const {
|
|
}
|
|
#endif
|
|
|
|
void MCInst::print(raw_ostream &OS) const {
|
|
OS << "<MCInst " << getOpcode();
|
|
for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
|
|
OS << " ";
|
|
getOperand(i).print(OS);
|
|
}
|
|
OS << ">";
|
|
}
|
|
|
|
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
|
|
LLVM_DUMP_METHOD void MCInst::dump() const {
|
|
}
|
|
#endif
|