1. Use SubtargetFeatures in llc/lli.
[oota-llvm.git] / lib / Target / Alpha / AlphaTargetMachine.h
1 //===-- AlphaTargetMachine.h - Define TargetMachine for Alpha ---*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file declares the Alpha-specific subclass of TargetMachine.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef ALPHA_TARGETMACHINE_H
15 #define ALPHA_TARGETMACHINE_H
16
17 #include "llvm/Target/TargetMachine.h"
18 #include "llvm/Target/TargetFrameInfo.h"
19 #include "llvm/PassManager.h"
20 #include "AlphaInstrInfo.h"
21 #include "AlphaJITInfo.h"
22
23 namespace llvm {
24
25 class GlobalValue;
26 class IntrinsicLowering;
27
28 class AlphaTargetMachine : public TargetMachine {
29   AlphaInstrInfo InstrInfo;
30   TargetFrameInfo FrameInfo;
31   AlphaJITInfo JITInfo;
32
33 public:
34   AlphaTargetMachine(const Module &M, IntrinsicLowering *IL,
35                      const std::string &FS);
36
37   virtual const AlphaInstrInfo *getInstrInfo() const { return &InstrInfo; }
38   virtual const TargetFrameInfo  *getFrameInfo() const { return &FrameInfo; }
39   virtual const MRegisterInfo *getRegisterInfo() const {
40     return &InstrInfo.getRegisterInfo();
41   }
42   virtual TargetJITInfo* getJITInfo() {
43     return &JITInfo;
44   }
45
46   static unsigned getJITMatchQuality();
47
48   /// addPassesToEmitMachineCode - Add passes to the specified pass manager to
49   /// get machine code emitted.  This uses a MachineCodeEmitter object to handle
50   /// actually outputting the machine code and resolving things like the address
51   /// of functions.  This method should returns true if machine code emission is
52   /// not supported.
53   ///
54   virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM,
55                                           MachineCodeEmitter &MCE);
56
57   virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
58                                    CodeGenFileType FileType);
59
60   static unsigned getModuleMatchQuality(const Module &M);
61 };
62
63 } // end namespace llvm
64
65 #endif