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
This commit is contained in:
Chris Lattner
2009-10-19 21:53:00 +00:00
parent 93bb60d379
commit 6f99776f6c
4 changed files with 94 additions and 22 deletions

View File

@@ -13,6 +13,7 @@
#include "llvm/Support/Compiler.h"
namespace llvm {
class MCAsmInfo;
class MCContext;
class MCInst;
class MCOperand;
@@ -26,24 +27,27 @@ namespace llvm {
/// ARMMCInstLower - This class is used to lower an MachineInstr into an MCInst.
class VISIBILITY_HIDDEN ARMMCInstLower {
MCContext &Ctx;
Mangler *Mang;
Mangler &Mang;
const unsigned CurFunctionNumber;
const MCAsmInfo &MAI;
//const ARMSubtarget &getSubtarget() const;
public:
ARMMCInstLower(MCContext &ctx, Mangler *mang)
: Ctx(ctx), Mang(mang) {}
ARMMCInstLower(MCContext &ctx, Mangler &mang, unsigned FuncNum,
const MCAsmInfo &mai)
: Ctx(ctx), Mang(mang), CurFunctionNumber(FuncNum), MAI(mai) {}
void Lower(const MachineInstr *MI, MCInst &OutMI) const;
/*
MCSymbol *GetPICBaseSymbol() const;
//MCSymbol *GetPICBaseSymbol() const;
MCSymbol *GetGlobalAddressSymbol(const MachineOperand &MO) const;
MCSymbol *GetExternalSymbolSymbol(const MachineOperand &MO) const;
//MCSymbol *GetExternalSymbolSymbol(const MachineOperand &MO) const;
MCSymbol *GetJumpTableSymbol(const MachineOperand &MO) const;
MCSymbol *GetConstantPoolIndexSymbol(const MachineOperand &MO) const;
MCOperand LowerSymbolOperand(const MachineOperand &MO, MCSymbol *Sym) const;
/*
private:
MachineModuleInfoMachO &getMachOMMI() const;
*/