Kill off old (TargetMachine level, not Target level) match quality functions.
[oota-llvm.git] / lib / Target / IA64 / IA64TargetMachine.h
1 //===-- IA64TargetMachine.h - Define TargetMachine for IA64 ---*- 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 IA64 specific subclass of TargetMachine.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_TARGET_IA64TARGETMACHINE_H
15 #define LLVM_TARGET_IA64TARGETMACHINE_H
16
17 #include "llvm/Target/TargetMachine.h"
18 #include "llvm/Target/TargetData.h"
19 #include "llvm/Target/TargetFrameInfo.h"
20 #include "IA64InstrInfo.h"
21 #include "IA64ISelLowering.h"
22 #include "IA64Subtarget.h"
23
24 namespace llvm {
25
26 class IA64TargetMachine : public LLVMTargetMachine {
27   IA64Subtarget    Subtarget;
28   const TargetData DataLayout;       // Calculates type size & alignment
29   IA64InstrInfo      InstrInfo;
30   TargetFrameInfo    FrameInfo;
31   //IA64JITInfo      JITInfo;
32   IA64TargetLowering TLInfo;
33
34 protected:
35   virtual const TargetAsmInfo *createTargetAsmInfo() const;
36
37   // To avoid having target depend on the asmprinter stuff libraries, asmprinter
38   // set this functions to ctor pointer at startup time if they are linked in.
39   typedef FunctionPass *(*AsmPrinterCtorFn)(formatted_raw_ostream &o,
40                                             TargetMachine &tm,
41                                             bool verbose);
42   static AsmPrinterCtorFn AsmPrinterCtor;
43
44 public:
45   IA64TargetMachine(const Target &T, const Module &M, const std::string &FS);
46
47   virtual const IA64InstrInfo      *getInstrInfo() const { return &InstrInfo; }
48   virtual const TargetFrameInfo    *getFrameInfo() const { return &FrameInfo; }
49   virtual const IA64Subtarget  *getSubtargetImpl() const { return &Subtarget; }
50   virtual       IA64TargetLowering *getTargetLowering() const {
51     return const_cast<IA64TargetLowering*>(&TLInfo);
52   }
53   virtual const IA64RegisterInfo   *getRegisterInfo() const {
54     return &InstrInfo.getRegisterInfo();
55   }
56   virtual const TargetData       *getTargetData() const { return &DataLayout; }
57
58   // Pass Pipeline Configuration
59   virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
60   virtual bool addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
61   virtual bool addAssemblyEmitter(PassManagerBase &PM,
62                                   CodeGenOpt::Level OptLevel,
63                                   bool Verbose, formatted_raw_ostream &Out);
64
65   static void registerAsmPrinter(AsmPrinterCtorFn F) {
66     AsmPrinterCtor = F;
67   }
68 };
69 } // End llvm namespace
70
71 #endif
72
73