1 //===-- ARMTargetMachine.h - Define TargetMachine for ARM -------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file declares the ARM specific subclass of TargetMachine.
12 //===----------------------------------------------------------------------===//
14 #ifndef ARMTARGETMACHINE_H
15 #define ARMTARGETMACHINE_H
17 #include "llvm/Target/TargetMachine.h"
18 #include "llvm/Target/TargetData.h"
19 #include "llvm/Target/TargetFrameInfo.h"
20 #include "ARMInstrInfo.h"
21 #include "ARMFrameInfo.h"
22 #include "ARMJITInfo.h"
23 #include "ARMSubtarget.h"
24 #include "ARMISelLowering.h"
30 class ARMTargetMachine : public LLVMTargetMachine {
31 ARMSubtarget Subtarget;
32 const TargetData DataLayout; // Calculates type size & alignment
33 ARMInstrInfo InstrInfo;
34 ARMFrameInfo FrameInfo;
36 ARMTargetLowering TLInfo;
39 ARMTargetMachine(const Module &M, const std::string &FS, bool isThumb = false);
41 virtual const ARMInstrInfo *getInstrInfo() const { return &InstrInfo; }
42 virtual const ARMFrameInfo *getFrameInfo() const { return &FrameInfo; }
43 virtual ARMJITInfo *getJITInfo() { return &JITInfo; }
44 virtual const ARMRegisterInfo *getRegisterInfo() const {
45 return &InstrInfo.getRegisterInfo();
47 virtual const TargetData *getTargetData() const { return &DataLayout; }
48 virtual const ARMSubtarget *getSubtargetImpl() const { return &Subtarget; }
49 virtual ARMTargetLowering *getTargetLowering() const {
50 return const_cast<ARMTargetLowering*>(&TLInfo);
52 static unsigned getModuleMatchQuality(const Module &M);
53 static unsigned getJITMatchQuality();
55 virtual const TargetAsmInfo *createTargetAsmInfo() const;
57 // Pass Pipeline Configuration
58 virtual bool addInstSelector(PassManagerBase &PM, bool Fast);
59 virtual bool addPreEmitPass(PassManagerBase &PM, bool Fast);
60 virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast,
62 virtual bool addCodeEmitter(PassManagerBase &PM, bool Fast,
63 bool DumpAsm, MachineCodeEmitter &MCE);
64 virtual bool addSimpleCodeEmitter(PassManagerBase &PM, bool Fast,
65 bool DumpAsm, MachineCodeEmitter &MCE);
68 /// ThumbTargetMachine - Thumb target machine.
70 class ThumbTargetMachine : public ARMTargetMachine {
72 ThumbTargetMachine(const Module &M, const std::string &FS);
74 static unsigned getJITMatchQuality();
75 static unsigned getModuleMatchQuality(const Module &M);
78 } // end namespace llvm