2006-05-14 22:18:28 +00:00
|
|
|
//===-- ARMTargetMachine.h - Define TargetMachine for ARM -------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file was developed by the "Instituto Nokia de Tecnologia" and
|
|
|
|
// is distributed under the University of Illinois Open Source
|
|
|
|
// 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 14:43:33 +00:00
|
|
|
#include "ARMFrameInfo.h"
|
2007-01-19 07:51:42 +00:00
|
|
|
#include "ARMSubtarget.h"
|
2007-03-13 01:20:42 +00:00
|
|
|
#include "ARMISelLowering.h"
|
2006-05-14 22:18:28 +00:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
class Module;
|
|
|
|
|
2006-09-04 04:14:57 +00:00
|
|
|
class ARMTargetMachine : public LLVMTargetMachine {
|
2007-01-19 07:51:42 +00:00
|
|
|
ARMSubtarget Subtarget;
|
|
|
|
const TargetData DataLayout; // Calculates type size & alignment
|
|
|
|
ARMInstrInfo InstrInfo;
|
|
|
|
ARMFrameInfo FrameInfo;
|
2007-03-13 01:20:42 +00:00
|
|
|
ARMTargetLowering TLInfo;
|
|
|
|
|
2006-05-14 22:18:28 +00:00
|
|
|
public:
|
2007-02-23 03:14:31 +00:00
|
|
|
ARMTargetMachine(const Module &M, const std::string &FS, bool isThumb = false);
|
2006-05-14 22:18:28 +00:00
|
|
|
|
|
|
|
virtual const ARMInstrInfo *getInstrInfo() const { return &InstrInfo; }
|
|
|
|
virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
|
|
|
|
virtual const MRegisterInfo *getRegisterInfo() const {
|
|
|
|
return &InstrInfo.getRegisterInfo();
|
|
|
|
}
|
|
|
|
virtual const TargetData *getTargetData() const { return &DataLayout; }
|
2007-01-19 07:51:42 +00:00
|
|
|
virtual const ARMSubtarget *getSubtargetImpl() const { return &Subtarget; }
|
2007-03-13 01:20:42 +00:00
|
|
|
virtual ARMTargetLowering *getTargetLowering() const {
|
|
|
|
return const_cast<ARMTargetLowering*>(&TLInfo);
|
|
|
|
}
|
2006-05-14 22:18:28 +00:00
|
|
|
static unsigned getModuleMatchQuality(const Module &M);
|
|
|
|
|
2007-01-19 07:51:42 +00:00
|
|
|
virtual const TargetAsmInfo *createTargetAsmInfo() const;
|
|
|
|
|
2006-09-04 04:14:57 +00:00
|
|
|
// Pass Pipeline Configuration
|
|
|
|
virtual bool addInstSelector(FunctionPassManager &PM, bool Fast);
|
2007-01-19 07:51:42 +00:00
|
|
|
virtual bool addPreEmitPass(FunctionPassManager &PM, bool Fast);
|
2006-09-04 04:14:57 +00:00
|
|
|
virtual bool addAssemblyEmitter(FunctionPassManager &PM, bool Fast,
|
|
|
|
std::ostream &Out);
|
2006-05-14 22:18:28 +00:00
|
|
|
};
|
|
|
|
|
2007-02-23 03:14:31 +00:00
|
|
|
/// ThumbTargetMachine - Thumb target machine.
|
|
|
|
///
|
|
|
|
class ThumbTargetMachine : public ARMTargetMachine {
|
|
|
|
public:
|
|
|
|
ThumbTargetMachine(const Module &M, const std::string &FS);
|
|
|
|
|
|
|
|
static unsigned getModuleMatchQuality(const Module &M);
|
|
|
|
};
|
|
|
|
|
2006-05-14 22:18:28 +00:00
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|