35 lines · cpp
1//===- MCCodeEmitter.cpp - Instruction Encoding ---------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#include "llvm/MC/MCCodeEmitter.h"10#include "llvm/MC/MCInst.h"11#include "llvm/Support/ErrorHandling.h"12#include "llvm/Support/raw_ostream.h"13#include <string>14 15using namespace llvm;16 17MCCodeEmitter::MCCodeEmitter() = default;18 19MCCodeEmitter::~MCCodeEmitter() = default;20 21void MCCodeEmitter::reportUnsupportedInst(const MCInst &Inst) {22 std::string Msg;23 raw_string_ostream OS(Msg);24 OS << "Unsupported instruction : " << Inst;25 reportFatalInternalError(Msg.c_str());26}27 28void MCCodeEmitter::reportUnsupportedOperand(const MCInst &Inst,29 unsigned OpNum) {30 std::string Msg;31 raw_string_ostream OS(Msg);32 OS << "Unsupported instruction operand : \"" << Inst << "\"[" << OpNum << "]";33 reportFatalInternalError(Msg.c_str());34}35