1 //===-------- MipsELFStreamer.cpp - ELF Object Output ---------------------===//
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 "MipsELFStreamer.h"
11 #include "llvm/MC/MCInst.h"
14 void MipsELFStreamer::EmitInstruction(const MCInst &Inst,
15 const MCSubtargetInfo &STI) {
16 MCELFStreamer::EmitInstruction(Inst, STI);
18 MCContext &Context = getContext();
19 const MCRegisterInfo *MCRegInfo = Context.getRegisterInfo();
21 for (unsigned OpIndex = 0; OpIndex < Inst.getNumOperands(); ++OpIndex) {
22 const MCOperand &Op = Inst.getOperand(OpIndex);
27 unsigned Reg = Op.getReg();
28 RegInfoRecord->SetPhysRegUsed(Reg, MCRegInfo);
32 void MipsELFStreamer::EmitMipsOptionRecords() {
33 for (const auto &I : MipsOptionRecords)
34 I->EmitMipsOptionRecord();
38 MCELFStreamer *createMipsELFStreamer(MCContext &Context, MCAsmBackend &MAB,
39 raw_ostream &OS, MCCodeEmitter *Emitter,
40 const MCSubtargetInfo &STI, bool RelaxAll,
42 return new MipsELFStreamer(Context, MAB, OS, Emitter, STI);