Fix some dwarf register numbers.
[oota-llvm.git] / lib / Target / Sparc / SparcTargetMachine.h
1 //===-- SparcTargetMachine.h - Define TargetMachine for Sparc ---*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file declares the Sparc specific subclass of TargetMachine.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef SPARCTARGETMACHINE_H
15 #define SPARCTARGETMACHINE_H
16
17 #include "SparcInstrInfo.h"
18 #include "SparcISelLowering.h"
19 #include "SparcFrameLowering.h"
20 #include "SparcSelectionDAGInfo.h"
21 #include "SparcSubtarget.h"
22 #include "llvm/Target/TargetMachine.h"
23 #include "llvm/Target/TargetData.h"
24 #include "llvm/Target/TargetFrameLowering.h"
25
26 namespace llvm {
27
28 class SparcTargetMachine : public LLVMTargetMachine {
29   SparcSubtarget Subtarget;
30   const TargetData DataLayout;       // Calculates type size & alignment
31   SparcTargetLowering TLInfo;
32   SparcSelectionDAGInfo TSInfo;
33   SparcInstrInfo InstrInfo;
34   SparcFrameLowering FrameLowering;
35 public:
36   SparcTargetMachine(const Target &T, const std::string &TT,
37                      const std::string &FS, bool is64bit);
38
39   virtual const SparcInstrInfo *getInstrInfo() const { return &InstrInfo; }
40   virtual const TargetFrameLowering  *getFrameLowering() const {
41     return &FrameLowering;
42   }
43   virtual const SparcSubtarget   *getSubtargetImpl() const{ return &Subtarget; }
44   virtual const SparcRegisterInfo *getRegisterInfo() const {
45     return &InstrInfo.getRegisterInfo();
46   }
47   virtual const SparcTargetLowering* getTargetLowering() const {
48     return &TLInfo;
49   }
50   virtual const SparcSelectionDAGInfo* getSelectionDAGInfo() const {
51     return &TSInfo;
52   }
53   virtual const TargetData       *getTargetData() const { return &DataLayout; }
54
55   // Pass Pipeline Configuration
56   virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
57   virtual bool addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
58 };
59
60 /// SparcV8TargetMachine - Sparc 32-bit target machine
61 ///
62 class SparcV8TargetMachine : public SparcTargetMachine {
63 public:
64   SparcV8TargetMachine(const Target &T, const std::string &TT,
65                        const std::string &FS);
66 };
67
68 /// SparcV9TargetMachine - Sparc 64-bit target machine
69 ///
70 class SparcV9TargetMachine : public SparcTargetMachine {
71 public:
72   SparcV9TargetMachine(const Target &T, const std::string &TT,
73                        const std::string &FS);
74 };
75
76 } // end namespace llvm
77
78 #endif