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"
13 void MipsELFStreamer::EmitInstruction(const MCInst &Inst,
14 const MCSubtargetInfo &STI) {
15 MCELFStreamer::EmitInstruction(Inst, STI);
17 MCContext &Context = getContext();
18 const MCRegisterInfo *MCRegInfo = Context.getRegisterInfo();
20 for (unsigned OpIndex = 0; OpIndex < Inst.getNumOperands(); ++OpIndex) {
21 const MCOperand &Op = Inst.getOperand(OpIndex);
26 unsigned Reg = Op.getReg();
27 RegInfoRecord->SetPhysRegUsed(Reg, MCRegInfo);
31 void MipsELFStreamer::EmitMipsOptionRecords() {
32 for (const auto &I : MipsOptionRecords)
33 I->EmitMipsOptionRecord();
37 MCELFStreamer *createMipsELFStreamer(MCContext &Context, MCAsmBackend &MAB,
38 raw_ostream &OS, MCCodeEmitter *Emitter,
39 const MCSubtargetInfo &STI, bool RelaxAll,
41 return new MipsELFStreamer(Context, MAB, OS, Emitter, STI);