mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
45889821e7
Differential Revision: http://llvm-reviews.chandlerc.com/D3134 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204921 91177308-0d34-0410-b5e6-96231b3b80d8
93 lines
2.7 KiB
C++
93 lines
2.7 KiB
C++
//===-- MipsAsmBackend.h - Mips Asm Backend ------------------------------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file defines the MipsAsmBackend class.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
|
|
#ifndef MIPSASMBACKEND_H
|
|
#define MIPSASMBACKEND_H
|
|
|
|
#include "MCTargetDesc/MipsFixupKinds.h"
|
|
#include "llvm/MC/MCAsmBackend.h"
|
|
#include "llvm/ADT/Triple.h"
|
|
|
|
namespace llvm {
|
|
|
|
class MCAssembler;
|
|
class MCFixupKindInfo;
|
|
class Target;
|
|
class MCObjectWriter;
|
|
|
|
class MipsAsmBackend : public MCAsmBackend {
|
|
Triple::OSType OSType;
|
|
bool IsLittle; // Big or little endian
|
|
bool Is64Bit; // 32 or 64 bit words
|
|
|
|
public:
|
|
MipsAsmBackend(const Target &T, Triple::OSType _OSType, bool _isLittle,
|
|
bool _is64Bit)
|
|
: MCAsmBackend(), OSType(_OSType), IsLittle(_isLittle),
|
|
Is64Bit(_is64Bit) {}
|
|
|
|
MCObjectWriter *createObjectWriter(raw_ostream &OS) const;
|
|
|
|
void applyFixup(const MCFixup &Fixup, char *Data, unsigned DataSize,
|
|
uint64_t Value) const;
|
|
|
|
const MCFixupKindInfo &getFixupKindInfo(MCFixupKind Kind) const;
|
|
|
|
unsigned getNumFixupKinds() const {
|
|
return Mips::NumTargetFixupKinds;
|
|
}
|
|
|
|
/// @name Target Relaxation Interfaces
|
|
/// @{
|
|
|
|
/// MayNeedRelaxation - Check whether the given instruction may need
|
|
/// relaxation.
|
|
///
|
|
/// \param Inst - The instruction to test.
|
|
bool mayNeedRelaxation(const MCInst &Inst) const {
|
|
return false;
|
|
}
|
|
|
|
/// fixupNeedsRelaxation - Target specific predicate for whether a given
|
|
/// fixup requires the associated instruction to be relaxed.
|
|
bool fixupNeedsRelaxation(const MCFixup &Fixup, uint64_t Value,
|
|
const MCRelaxableFragment *DF,
|
|
const MCAsmLayout &Layout) const {
|
|
// FIXME.
|
|
assert(0 && "RelaxInstruction() unimplemented");
|
|
return false;
|
|
}
|
|
|
|
/// RelaxInstruction - Relax the instruction in the given fragment
|
|
/// to the next wider instruction.
|
|
///
|
|
/// \param Inst - The instruction to relax, which may be the same
|
|
/// as the output.
|
|
/// \param [out] Res On return, the relaxed instruction.
|
|
void relaxInstruction(const MCInst &Inst, MCInst &Res) const {}
|
|
|
|
/// @}
|
|
|
|
bool writeNopData(uint64_t Count, MCObjectWriter *OW) const;
|
|
|
|
void processFixupValue(const MCAssembler &Asm, const MCAsmLayout &Layout,
|
|
const MCFixup &Fixup, const MCFragment *DF,
|
|
MCValue &Target, uint64_t &Value, bool &IsResolved);
|
|
|
|
}; // class MipsAsmBackend
|
|
|
|
} // namespace
|
|
|
|
#endif
|