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-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 #include "llvm/MC/MCCodeEmitter.h" 10 #include "llvm/Support/raw_ostream.h" 11 12 using namespace llvm; 13 14 MCCodeEmitter::MCCodeEmitter() = default; 15 16 MCCodeEmitter::~MCCodeEmitter() = default; 17 18 void MCCodeEmitter::encodeInstruction(const MCInst &Inst, 19 SmallVectorImpl<char> &CB, 20 SmallVectorImpl<MCFixup> &Fixups, 21 const MCSubtargetInfo &STI) const { 22 raw_svector_ostream OS(CB); 23 encodeInstruction(Inst, OS, Fixups, STI); 24 } 25