mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-23 15:29:51 +00:00
c91cbb9b0c
but I cannot reproduce the problem and have scrubed my sources and even tested with llvm-lit -v --vg. Support for Mips register information sections. Mips ELF object files have a section that is dedicated to register use info. Some of this information such as the assumed Global Pointer value is used by the linker in relocation resolution. The register info file is .reginfo in o32 and .MIPS.options in 64 and n32 abi files. This patch contains the changes needed to create the sections, but leaves the actual register accounting for a future patch. Contributer: Jack Carter git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172847 91177308-0d34-0410-b5e6-96231b3b80d8
91 lines
3.1 KiB
C++
91 lines
3.1 KiB
C++
//===-- MipsAsmPrinter.h - Mips LLVM Assembly Printer ----------*- C++ -*--===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// Mips Assembly printer class.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef MIPSASMPRINTER_H
|
|
#define MIPSASMPRINTER_H
|
|
|
|
#include "MipsMCInstLower.h"
|
|
#include "MipsMachineFunction.h"
|
|
#include "MipsSubtarget.h"
|
|
#include "llvm/CodeGen/AsmPrinter.h"
|
|
#include "llvm/Support/Compiler.h"
|
|
#include "llvm/Target/TargetMachine.h"
|
|
|
|
namespace llvm {
|
|
class MCStreamer;
|
|
class MachineInstr;
|
|
class MachineBasicBlock;
|
|
class Module;
|
|
class raw_ostream;
|
|
|
|
class LLVM_LIBRARY_VISIBILITY MipsAsmPrinter : public AsmPrinter {
|
|
|
|
void EmitInstrWithMacroNoAT(const MachineInstr *MI);
|
|
|
|
private:
|
|
// tblgen'erated function.
|
|
bool emitPseudoExpansionLowering(MCStreamer &OutStreamer,
|
|
const MachineInstr *MI);
|
|
|
|
// lowerOperand - Convert a MachineOperand into the equivalent MCOperand.
|
|
bool lowerOperand(const MachineOperand &MO, MCOperand &MCOp);
|
|
|
|
public:
|
|
|
|
const MipsSubtarget *Subtarget;
|
|
const MipsFunctionInfo *MipsFI;
|
|
MipsMCInstLower MCInstLowering;
|
|
|
|
explicit MipsAsmPrinter(TargetMachine &TM, MCStreamer &Streamer)
|
|
: AsmPrinter(TM, Streamer), MCInstLowering(*this) {
|
|
Subtarget = &TM.getSubtarget<MipsSubtarget>();
|
|
}
|
|
|
|
virtual const char *getPassName() const {
|
|
return "Mips Assembly Printer";
|
|
}
|
|
|
|
virtual bool runOnMachineFunction(MachineFunction &MF);
|
|
|
|
void EmitInstruction(const MachineInstr *MI);
|
|
void printSavedRegsBitmask(raw_ostream &O);
|
|
void printHex32(unsigned int Value, raw_ostream &O);
|
|
void emitFrameDirective();
|
|
const char *getCurrentABIString() const;
|
|
virtual void EmitFunctionEntryLabel();
|
|
virtual void EmitFunctionBodyStart();
|
|
virtual void EmitFunctionBodyEnd();
|
|
virtual bool isBlockOnlyReachableByFallthrough(const MachineBasicBlock*
|
|
MBB) const;
|
|
bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
|
|
unsigned AsmVariant, const char *ExtraCode,
|
|
raw_ostream &O);
|
|
bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNum,
|
|
unsigned AsmVariant, const char *ExtraCode,
|
|
raw_ostream &O);
|
|
void printOperand(const MachineInstr *MI, int opNum, raw_ostream &O);
|
|
void printUnsignedImm(const MachineInstr *MI, int opNum, raw_ostream &O);
|
|
void printMemOperand(const MachineInstr *MI, int opNum, raw_ostream &O);
|
|
void printMemOperandEA(const MachineInstr *MI, int opNum, raw_ostream &O);
|
|
void printFCCOperand(const MachineInstr *MI, int opNum, raw_ostream &O,
|
|
const char *Modifier = 0);
|
|
void EmitStartOfAsmFile(Module &M);
|
|
void EmitEndOfAsmFile(Module &M);
|
|
virtual MachineLocation getDebugValueLocation(const MachineInstr *MI) const;
|
|
void PrintDebugValueComment(const MachineInstr *MI, raw_ostream &OS);
|
|
};
|
|
}
|
|
|
|
#endif
|
|
|