Move if-conversion after all passes that may use register scavenger.
[oota-llvm.git] / lib / Target / ARM / ARMTargetMachine.h
1 //===-- ARMTargetMachine.h - Define TargetMachine for ARM -------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file was developed by the "Instituto Nokia de Tecnologia" and
6 // is distributed under the University of Illinois Open Source
7 // License. See LICENSE.TXT for details.
8 //
9 //===----------------------------------------------------------------------===//
10 //
11 // This file declares the ARM specific subclass of TargetMachine.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef ARMTARGETMACHINE_H
16 #define ARMTARGETMACHINE_H
17
18 #include "llvm/Target/TargetMachine.h"
19 #include "llvm/Target/TargetData.h"
20 #include "llvm/Target/TargetFrameInfo.h"
21 #include "ARMInstrInfo.h"
22 #include "ARMFrameInfo.h"
23 #include "ARMSubtarget.h"
24 #include "ARMISelLowering.h"
25
26 namespace llvm {
27
28 class Module;
29
30 class ARMTargetMachine : public LLVMTargetMachine {
31   ARMSubtarget      Subtarget;
32   const TargetData  DataLayout;       // Calculates type size & alignment
33   ARMInstrInfo      InstrInfo;
34   ARMFrameInfo      FrameInfo;
35   ARMTargetLowering TLInfo;
36
37 public:
38   ARMTargetMachine(const Module &M, const std::string &FS, bool isThumb = false);
39
40   virtual const ARMInstrInfo *getInstrInfo() const { return &InstrInfo; }
41   virtual const TargetFrameInfo  *getFrameInfo() const { return &FrameInfo; }
42   virtual const MRegisterInfo *getRegisterInfo() const {
43     return &InstrInfo.getRegisterInfo();
44   }
45   virtual const TargetData       *getTargetData() const { return &DataLayout; }
46   virtual const ARMSubtarget  *getSubtargetImpl() const { return &Subtarget; }
47   virtual       ARMTargetLowering *getTargetLowering() const { 
48     return const_cast<ARMTargetLowering*>(&TLInfo); 
49   }
50   static unsigned getModuleMatchQuality(const Module &M);
51
52   virtual const TargetAsmInfo *createTargetAsmInfo() const;
53   
54   // Pass Pipeline Configuration
55   virtual bool addInstSelector(FunctionPassManager &PM, bool Fast);
56   virtual bool addPreEmitPass(FunctionPassManager &PM, bool Fast);
57   virtual bool addAssemblyEmitter(FunctionPassManager &PM, bool Fast, 
58                                   std::ostream &Out);
59 };
60
61 /// ThumbTargetMachine - Thumb target machine.
62 ///
63 class ThumbTargetMachine : public ARMTargetMachine {
64 public:
65   ThumbTargetMachine(const Module &M, const std::string &FS);
66
67   static unsigned getModuleMatchQuality(const Module &M);
68 };
69
70 } // end namespace llvm
71
72 #endif