Don't use PassInfo* as a type identifier for passes. Instead, use the address of...
[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 "llvm/Target/TargetMachine.h"
18 #include "llvm/Target/TargetData.h"
19 #include "llvm/Target/TargetFrameInfo.h"
20 #include "SparcInstrInfo.h"
21 #include "SparcSubtarget.h"
22 #include "SparcISelLowering.h"
23 #include "SparcSelectionDAGInfo.h"
24
25 namespace llvm {
26
27 class SparcTargetMachine : public LLVMTargetMachine {
28   SparcSubtarget Subtarget;
29   const TargetData DataLayout;       // Calculates type size & alignment
30   SparcTargetLowering TLInfo;
31   SparcSelectionDAGInfo TSInfo;
32   SparcInstrInfo InstrInfo;
33   TargetFrameInfo FrameInfo;
34 public:
35   SparcTargetMachine(const Target &T, const std::string &TT,
36                      const std::string &FS, bool is64bit);
37
38   virtual const SparcInstrInfo *getInstrInfo() const { return &InstrInfo; }
39   virtual const TargetFrameInfo  *getFrameInfo() const { return &FrameInfo; }
40   virtual const SparcSubtarget   *getSubtargetImpl() const{ return &Subtarget; }
41   virtual const SparcRegisterInfo *getRegisterInfo() const {
42     return &InstrInfo.getRegisterInfo();
43   }
44   virtual const SparcTargetLowering* getTargetLowering() const {
45     return &TLInfo;
46   }
47   virtual const SparcSelectionDAGInfo* getSelectionDAGInfo() const {
48     return &TSInfo;
49   }
50   virtual const TargetData       *getTargetData() const { return &DataLayout; }
51
52   // Pass Pipeline Configuration
53   virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
54   virtual bool addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
55 };
56
57 /// SparcV8TargetMachine - Sparc 32-bit target machine
58 ///
59 class SparcV8TargetMachine : public SparcTargetMachine {
60 public:
61   SparcV8TargetMachine(const Target &T, const std::string &TT,
62                        const std::string &FS);
63 };
64
65 /// SparcV9TargetMachine - Sparc 64-bit target machine
66 ///
67 class SparcV9TargetMachine : public SparcTargetMachine {
68 public:
69   SparcV9TargetMachine(const Target &T, const std::string &TT,
70                        const std::string &FS);
71 };
72
73 } // end namespace llvm
74
75 #endif