Proper patterns for thumb2 shift and rotate instructions.
[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)(raw_ostream &o,
40                                             IA64TargetMachine &tm,
41                                             CodeGenOpt::Level OptLevel,
42                                             bool verbose);
43   static AsmPrinterCtorFn AsmPrinterCtor;
44
45 public:
46   IA64TargetMachine(const Module &M, const std::string &FS);
47
48   virtual const IA64InstrInfo      *getInstrInfo() const { return &InstrInfo; }
49   virtual const TargetFrameInfo    *getFrameInfo() const { return &FrameInfo; }
50   virtual const IA64Subtarget  *getSubtargetImpl() const { return &Subtarget; }
51   virtual       IA64TargetLowering *getTargetLowering() const {
52     return const_cast<IA64TargetLowering*>(&TLInfo);
53   }
54   virtual const IA64RegisterInfo   *getRegisterInfo() const {
55     return &InstrInfo.getRegisterInfo();
56   }
57   virtual const TargetData       *getTargetData() const { return &DataLayout; }
58
59   static unsigned getModuleMatchQuality(const Module &M);
60
61   // Pass Pipeline Configuration
62   virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
63   virtual bool addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
64   virtual bool addAssemblyEmitter(PassManagerBase &PM,
65                                   CodeGenOpt::Level OptLevel,
66                                   bool Verbose, raw_ostream &Out);
67
68   static void registerAsmPrinter(AsmPrinterCtorFn F) {
69     AsmPrinterCtor = F;
70   }
71 };
72 } // End llvm namespace
73
74 #endif
75
76