2009-10-19 20:21:05 +00:00
|
|
|
//===-- ARMMCInstLower.h - Lower MachineInstr to MCInst -------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef ARM_MCINSTLOWER_H
|
|
|
|
#define ARM_MCINSTLOWER_H
|
|
|
|
|
|
|
|
#include "llvm/Support/Compiler.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
2009-10-20 00:52:47 +00:00
|
|
|
class AsmPrinter;
|
add jump tables, constant pools and some trivial global
lowering stuff. We can now compile hello world to:
_main:
stm ,
mov r7, sp
sub sp, sp, #4
mov r0, #0
str r0,
ldr r0,
bl _printf
ldr r0,
mov sp, r7
ldm ,
Almost looks like arm code :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84542 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 21:53:00 +00:00
|
|
|
class MCAsmInfo;
|
2009-10-19 20:21:05 +00:00
|
|
|
class MCContext;
|
|
|
|
class MCInst;
|
|
|
|
class MCOperand;
|
|
|
|
class MCSymbol;
|
|
|
|
class MachineInstr;
|
|
|
|
class MachineModuleInfoMachO;
|
|
|
|
class MachineOperand;
|
|
|
|
class Mangler;
|
|
|
|
//class ARMSubtarget;
|
|
|
|
|
|
|
|
/// ARMMCInstLower - This class is used to lower an MachineInstr into an MCInst.
|
2010-05-11 20:16:09 +00:00
|
|
|
class LLVM_LIBRARY_VISIBILITY ARMMCInstLower {
|
2009-10-19 20:21:05 +00:00
|
|
|
MCContext &Ctx;
|
add jump tables, constant pools and some trivial global
lowering stuff. We can now compile hello world to:
_main:
stm ,
mov r7, sp
sub sp, sp, #4
mov r0, #0
str r0,
ldr r0,
bl _printf
ldr r0,
mov sp, r7
ldm ,
Almost looks like arm code :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84542 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 21:53:00 +00:00
|
|
|
Mangler &Mang;
|
2009-10-20 00:52:47 +00:00
|
|
|
AsmPrinter &Printer;
|
2009-10-19 20:21:05 +00:00
|
|
|
|
|
|
|
//const ARMSubtarget &getSubtarget() const;
|
|
|
|
public:
|
2009-10-20 00:52:47 +00:00
|
|
|
ARMMCInstLower(MCContext &ctx, Mangler &mang, AsmPrinter &printer)
|
|
|
|
: Ctx(ctx), Mang(mang), Printer(printer) {}
|
2009-10-19 20:21:05 +00:00
|
|
|
|
|
|
|
void Lower(const MachineInstr *MI, MCInst &OutMI) const;
|
|
|
|
|
add jump tables, constant pools and some trivial global
lowering stuff. We can now compile hello world to:
_main:
stm ,
mov r7, sp
sub sp, sp, #4
mov r0, #0
str r0,
ldr r0,
bl _printf
ldr r0,
mov sp, r7
ldm ,
Almost looks like arm code :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84542 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 21:53:00 +00:00
|
|
|
//MCSymbol *GetPICBaseSymbol() const;
|
2009-10-19 20:21:05 +00:00
|
|
|
MCSymbol *GetGlobalAddressSymbol(const MachineOperand &MO) const;
|
2009-10-20 00:56:16 +00:00
|
|
|
MCSymbol *GetExternalSymbolSymbol(const MachineOperand &MO) const;
|
2009-10-19 20:21:05 +00:00
|
|
|
MCSymbol *GetJumpTableSymbol(const MachineOperand &MO) const;
|
|
|
|
MCSymbol *GetConstantPoolIndexSymbol(const MachineOperand &MO) const;
|
|
|
|
MCOperand LowerSymbolOperand(const MachineOperand &MO, MCSymbol *Sym) const;
|
|
|
|
|
add jump tables, constant pools and some trivial global
lowering stuff. We can now compile hello world to:
_main:
stm ,
mov r7, sp
sub sp, sp, #4
mov r0, #0
str r0,
ldr r0,
bl _printf
ldr r0,
mov sp, r7
ldm ,
Almost looks like arm code :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84542 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 21:53:00 +00:00
|
|
|
/*
|
2009-10-19 20:21:05 +00:00
|
|
|
private:
|
|
|
|
MachineModuleInfoMachO &getMachOMMI() const;
|
|
|
|
*/
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|