mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
get fancy: support basic block operands. Yay for jumps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84579 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
233917c072
commit
96bc2173bb
@ -1311,7 +1311,7 @@ extern "C" void LLVMInitializeARMAsmPrinter() {
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
void ARMAsmPrinter::printInstructionThroughMCStreamer(const MachineInstr *MI) {
|
||||
ARMMCInstLower MCInstLowering(OutContext, *Mang, getFunctionNumber(), *MAI);
|
||||
ARMMCInstLower MCInstLowering(OutContext, *Mang, *this);
|
||||
switch (MI->getOpcode()) {
|
||||
default: break;
|
||||
case TargetInstrInfo::DBG_LABEL:
|
||||
|
@ -14,7 +14,8 @@
|
||||
|
||||
#include "ARMMCInstLower.h"
|
||||
//#include "llvm/CodeGen/MachineModuleInfoImpls.h"
|
||||
#include "llvm/CodeGen/MachineInstr.h"
|
||||
#include "llvm/CodeGen/AsmPrinter.h"
|
||||
#include "llvm/CodeGen/MachineBasicBlock.h"
|
||||
#include "llvm/MC/MCAsmInfo.h"
|
||||
#include "llvm/MC/MCContext.h"
|
||||
#include "llvm/MC/MCExpr.h"
|
||||
@ -57,8 +58,8 @@ GetGlobalAddressSymbol(const MachineOperand &MO) const {
|
||||
MCSymbol *ARMMCInstLower::
|
||||
GetJumpTableSymbol(const MachineOperand &MO) const {
|
||||
SmallString<256> Name;
|
||||
raw_svector_ostream(Name) << MAI.getPrivateGlobalPrefix() << "JTI"
|
||||
<< CurFunctionNumber << '_' << MO.getIndex();
|
||||
raw_svector_ostream(Name) << Printer.MAI->getPrivateGlobalPrefix() << "JTI"
|
||||
<< Printer.getFunctionNumber() << '_' << MO.getIndex();
|
||||
|
||||
#if 0
|
||||
switch (MO.getTargetFlags()) {
|
||||
@ -73,8 +74,8 @@ GetJumpTableSymbol(const MachineOperand &MO) const {
|
||||
MCSymbol *ARMMCInstLower::
|
||||
GetConstantPoolIndexSymbol(const MachineOperand &MO) const {
|
||||
SmallString<256> Name;
|
||||
raw_svector_ostream(Name) << MAI.getPrivateGlobalPrefix() << "CPI"
|
||||
<< CurFunctionNumber << '_' << MO.getIndex();
|
||||
raw_svector_ostream(Name) << Printer.MAI->getPrivateGlobalPrefix() << "CPI"
|
||||
<< Printer.getFunctionNumber() << '_' << MO.getIndex();
|
||||
|
||||
#if 0
|
||||
switch (MO.getTargetFlags()) {
|
||||
@ -125,12 +126,10 @@ void ARMMCInstLower::Lower(const MachineInstr *MI, MCInst &OutMI) const {
|
||||
case MachineOperand::MO_Immediate:
|
||||
MCOp = MCOperand::CreateImm(MO.getImm());
|
||||
break;
|
||||
#if 0
|
||||
case MachineOperand::MO_MachineBasicBlock:
|
||||
MCOp = MCOperand::CreateExpr(MCSymbolRefExpr::Create(
|
||||
AsmPrinter.GetMBBSymbol(MO.getMBB()->getNumber()), Ctx));
|
||||
Printer.GetMBBSymbol(MO.getMBB()->getNumber()), Ctx));
|
||||
break;
|
||||
#endif
|
||||
case MachineOperand::MO_GlobalAddress:
|
||||
MCOp = LowerSymbolOperand(MO, GetGlobalAddressSymbol(MO));
|
||||
break;
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "llvm/Support/Compiler.h"
|
||||
|
||||
namespace llvm {
|
||||
class AsmPrinter;
|
||||
class MCAsmInfo;
|
||||
class MCContext;
|
||||
class MCInst;
|
||||
@ -28,15 +29,12 @@ namespace llvm {
|
||||
class VISIBILITY_HIDDEN ARMMCInstLower {
|
||||
MCContext &Ctx;
|
||||
Mangler &Mang;
|
||||
|
||||
const unsigned CurFunctionNumber;
|
||||
const MCAsmInfo &MAI;
|
||||
AsmPrinter &Printer;
|
||||
|
||||
//const ARMSubtarget &getSubtarget() const;
|
||||
public:
|
||||
ARMMCInstLower(MCContext &ctx, Mangler &mang, unsigned FuncNum,
|
||||
const MCAsmInfo &mai)
|
||||
: Ctx(ctx), Mang(mang), CurFunctionNumber(FuncNum), MAI(mai) {}
|
||||
ARMMCInstLower(MCContext &ctx, Mangler &mang, AsmPrinter &printer)
|
||||
: Ctx(ctx), Mang(mang), Printer(printer) {}
|
||||
|
||||
void Lower(const MachineInstr *MI, MCInst &OutMI) const;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user