mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-23 15:29:51 +00:00
f0644b42a7
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217077 91177308-0d34-0410-b5e6-96231b3b80d8
45 lines
1.4 KiB
C++
45 lines
1.4 KiB
C++
//===-------- 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"
|
|
#include "llvm/MC/MCInst.h"
|
|
using namespace llvm;
|
|
|
|
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();
|
|
}
|
|
|
|
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);
|
|
}
|
|
}
|