2014-03-27 11:39:03 +00:00
|
|
|
//===-------- MipsELFStreamer.cpp - ELF Object Output ---------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "MipsELFStreamer.h"
|
2014-07-21 13:30:55 +00:00
|
|
|
#include "llvm/MC/MCInst.h"
|
2014-09-03 21:04:12 +00:00
|
|
|
using namespace llvm;
|
2014-07-21 13:30:55 +00:00
|
|
|
|
|
|
|
void MipsELFStreamer::EmitInstruction(const MCInst &Inst,
|
|
|
|
const MCSubtargetInfo &STI) {
|
|
|
|
MCELFStreamer::EmitInstruction(Inst, STI);
|
|
|
|
|
|
|
|
MCContext &Context = getContext();
|
|
|
|
const MCRegisterInfo *MCRegInfo = Context.getRegisterInfo();
|
|
|
|
|
|
|
|
for (unsigned OpIndex = 0; OpIndex < Inst.getNumOperands(); ++OpIndex) {
|
|
|
|
const MCOperand &Op = Inst.getOperand(OpIndex);
|
|
|
|
|
|
|
|
if (!Op.isReg())
|
|
|
|
continue;
|
|
|
|
|
|
|
|
unsigned Reg = Op.getReg();
|
|
|
|
RegInfoRecord->SetPhysRegUsed(Reg, MCRegInfo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void MipsELFStreamer::EmitMipsOptionRecords() {
|
|
|
|
for (const auto &I : MipsOptionRecords)
|
|
|
|
I->EmitMipsOptionRecord();
|
|
|
|
}
|
2014-03-27 11:39:03 +00:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
MCELFStreamer *createMipsELFStreamer(MCContext &Context, MCAsmBackend &MAB,
|
|
|
|
raw_ostream &OS, MCCodeEmitter *Emitter,
|
|
|
|
const MCSubtargetInfo &STI, bool RelaxAll,
|
|
|
|
bool NoExecStack) {
|
|
|
|
return new MipsELFStreamer(Context, MAB, OS, Emitter, STI);
|
|
|
|
}
|
|
|
|
}
|