2006-05-15 06:18:28 +08:00
|
|
|
//===-- ARMTargetMachine.h - Define TargetMachine for ARM -------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-30 04:36:04 +08:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
2006-05-15 06:18:28 +08:00
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file declares the ARM specific subclass of TargetMachine.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef ARMTARGETMACHINE_H
|
|
|
|
#define ARMTARGETMACHINE_H
|
|
|
|
|
|
|
|
#include "llvm/Target/TargetMachine.h"
|
|
|
|
#include "llvm/Target/TargetData.h"
|
|
|
|
#include "llvm/Target/TargetFrameInfo.h"
|
|
|
|
#include "ARMInstrInfo.h"
|
2006-08-16 22:43:33 +08:00
|
|
|
#include "ARMFrameInfo.h"
|
2007-07-06 05:15:40 +08:00
|
|
|
#include "ARMJITInfo.h"
|
2007-01-19 15:51:42 +08:00
|
|
|
#include "ARMSubtarget.h"
|
2007-03-13 09:20:42 +08:00
|
|
|
#include "ARMISelLowering.h"
|
2006-05-15 06:18:28 +08:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
class Module;
|
|
|
|
|
2006-09-04 12:14:57 +08:00
|
|
|
class ARMTargetMachine : public LLVMTargetMachine {
|
2007-01-19 15:51:42 +08:00
|
|
|
ARMSubtarget Subtarget;
|
|
|
|
const TargetData DataLayout; // Calculates type size & alignment
|
|
|
|
ARMInstrInfo InstrInfo;
|
|
|
|
ARMFrameInfo FrameInfo;
|
2007-07-06 05:15:40 +08:00
|
|
|
ARMJITInfo JITInfo;
|
2007-03-13 09:20:42 +08:00
|
|
|
ARMTargetLowering TLInfo;
|
|
|
|
|
2006-05-15 06:18:28 +08:00
|
|
|
public:
|
2007-02-23 11:14:31 +08:00
|
|
|
ARMTargetMachine(const Module &M, const std::string &FS, bool isThumb = false);
|
2006-05-15 06:18:28 +08:00
|
|
|
|
|
|
|
virtual const ARMInstrInfo *getInstrInfo() const { return &InstrInfo; }
|
|
|
|
virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
|
2007-07-06 05:15:40 +08:00
|
|
|
virtual TargetJITInfo *getJITInfo() { return &JITInfo; }
|
2006-05-15 06:18:28 +08:00
|
|
|
virtual const MRegisterInfo *getRegisterInfo() const {
|
|
|
|
return &InstrInfo.getRegisterInfo();
|
|
|
|
}
|
|
|
|
virtual const TargetData *getTargetData() const { return &DataLayout; }
|
2007-01-19 15:51:42 +08:00
|
|
|
virtual const ARMSubtarget *getSubtargetImpl() const { return &Subtarget; }
|
2007-03-13 09:20:42 +08:00
|
|
|
virtual ARMTargetLowering *getTargetLowering() const {
|
|
|
|
return const_cast<ARMTargetLowering*>(&TLInfo);
|
|
|
|
}
|
2006-05-15 06:18:28 +08:00
|
|
|
static unsigned getModuleMatchQuality(const Module &M);
|
2007-07-06 05:15:40 +08:00
|
|
|
static unsigned getJITMatchQuality();
|
2006-05-15 06:18:28 +08:00
|
|
|
|
2007-01-19 15:51:42 +08:00
|
|
|
virtual const TargetAsmInfo *createTargetAsmInfo() const;
|
|
|
|
|
2006-09-04 12:14:57 +08:00
|
|
|
// Pass Pipeline Configuration
|
|
|
|
virtual bool addInstSelector(FunctionPassManager &PM, bool Fast);
|
2007-01-19 15:51:42 +08:00
|
|
|
virtual bool addPreEmitPass(FunctionPassManager &PM, bool Fast);
|
2006-09-04 12:14:57 +08:00
|
|
|
virtual bool addAssemblyEmitter(FunctionPassManager &PM, bool Fast,
|
|
|
|
std::ostream &Out);
|
2007-07-06 05:15:40 +08:00
|
|
|
virtual bool addCodeEmitter(FunctionPassManager &PM, bool Fast,
|
2007-07-21 05:56:13 +08:00
|
|
|
bool DumpAsm, MachineCodeEmitter &MCE);
|
2007-07-06 05:15:40 +08:00
|
|
|
virtual bool addSimpleCodeEmitter(FunctionPassManager &PM, bool Fast,
|
2007-07-21 05:56:13 +08:00
|
|
|
bool DumpAsm, MachineCodeEmitter &MCE);
|
2006-05-15 06:18:28 +08:00
|
|
|
};
|
|
|
|
|
2007-02-23 11:14:31 +08:00
|
|
|
/// ThumbTargetMachine - Thumb target machine.
|
|
|
|
///
|
|
|
|
class ThumbTargetMachine : public ARMTargetMachine {
|
|
|
|
public:
|
|
|
|
ThumbTargetMachine(const Module &M, const std::string &FS);
|
|
|
|
|
2007-07-06 05:15:40 +08:00
|
|
|
static unsigned getJITMatchQuality();
|
2007-02-23 11:14:31 +08:00
|
|
|
static unsigned getModuleMatchQuality(const Module &M);
|
|
|
|
};
|
|
|
|
|
2006-05-15 06:18:28 +08:00
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|