Support multiple ValueTypes per RegisterClass, needed for upcoming vector
[oota-llvm.git] / lib / Target / SparcV9 / SparcV9TargetMachine.h
1 //===-- SparcV9TargetMachine.h - Define TargetMachine for SparcV9 -*- 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 top-level SparcV9 target machine.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef SPARCV9TARGETMACHINE_H
15 #define SPARCV9TARGETMACHINE_H
16
17 #include "llvm/Target/TargetFrameInfo.h"
18 #include "llvm/Target/TargetMachine.h"
19 #include "SparcV9InstrInfo.h"
20 #include "SparcV9Internals.h"
21 #include "SparcV9RegInfo.h"
22 #include "SparcV9FrameInfo.h"
23 #include "SparcV9JITInfo.h"
24
25 namespace llvm {
26   class PassManager;
27
28 class SparcV9TargetMachine : public TargetMachine {
29   SparcV9InstrInfo instrInfo;
30   SparcV9SchedInfo schedInfo;
31   SparcV9RegInfo   regInfo;
32   SparcV9FrameInfo frameInfo;
33   SparcV9JITInfo   jitInfo;
34 public:
35   SparcV9TargetMachine(const Module &M, IntrinsicLowering *IL,
36                        const std::string &FS);
37
38   virtual const TargetInstrInfo  *getInstrInfo() const { return &instrInfo; }
39   virtual const TargetSchedInfo  *getSchedInfo() const { return &schedInfo; }
40   virtual const SparcV9RegInfo   *getRegInfo()   const { return &regInfo; }
41   virtual const TargetFrameInfo  *getFrameInfo() const { return &frameInfo; }
42   virtual       TargetJITInfo    *getJITInfo()         { return &jitInfo; }
43   virtual const MRegisterInfo    *getRegisterInfo() const {
44     return &instrInfo.getRegisterInfo();
45   }
46
47   virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
48                                    CodeGenFileType FileType, bool Fast);
49   virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM,
50                                           MachineCodeEmitter &MCE);
51
52   static unsigned getModuleMatchQuality(const Module &M);
53   static unsigned getJITMatchQuality();
54 };
55
56 } // End llvm namespace
57
58 #endif