Use abs64 instead abs; some platforms don't have a 64-bit abs overload. Noticed by...
[oota-llvm.git] / lib / Target / Alpha / AlphaTargetMachine.h
1 //===-- AlphaTargetMachine.h - Define TargetMachine for Alpha ---*- 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 Alpha-specific subclass of TargetMachine.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef ALPHA_TARGETMACHINE_H
15 #define ALPHA_TARGETMACHINE_H
16
17 #include "llvm/Target/TargetMachine.h"
18 #include "llvm/Target/TargetData.h"
19 #include "llvm/Target/TargetFrameInfo.h"
20 #include "AlphaInstrInfo.h"
21 #include "AlphaJITInfo.h"
22 #include "AlphaISelLowering.h"
23 #include "AlphaSubtarget.h"
24
25 namespace llvm {
26
27 class GlobalValue;
28
29 class AlphaTargetMachine : public LLVMTargetMachine {
30   const TargetData DataLayout;       // Calculates type size & alignment
31   AlphaInstrInfo InstrInfo;
32   TargetFrameInfo FrameInfo;
33   AlphaJITInfo JITInfo;
34   AlphaSubtarget Subtarget;
35   AlphaTargetLowering TLInfo;
36
37 protected:
38   virtual const TargetAsmInfo *createTargetAsmInfo() const;
39
40 public:
41   AlphaTargetMachine(const Target &T, const std::string &TT,
42                      const std::string &FS);
43
44   virtual const AlphaInstrInfo *getInstrInfo() const { return &InstrInfo; }
45   virtual const TargetFrameInfo  *getFrameInfo() const { return &FrameInfo; }
46   virtual const AlphaSubtarget   *getSubtargetImpl() const{ return &Subtarget; }
47   virtual const AlphaRegisterInfo *getRegisterInfo() const {
48     return &InstrInfo.getRegisterInfo();
49   }
50   virtual AlphaTargetLowering* getTargetLowering() const {
51     return const_cast<AlphaTargetLowering*>(&TLInfo);
52   }
53   virtual const TargetData       *getTargetData() const { return &DataLayout; }
54   virtual AlphaJITInfo* getJITInfo() {
55     return &JITInfo;
56   }
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 addCodeEmitter(PassManagerBase &PM, CodeGenOpt::Level OptLevel,
62                               MachineCodeEmitter &MCE);
63   virtual bool addCodeEmitter(PassManagerBase &PM, CodeGenOpt::Level OptLevel,
64                               JITCodeEmitter &JCE);
65   virtual bool addCodeEmitter(PassManagerBase &PM, CodeGenOpt::Level OptLevel,
66                               ObjectCodeEmitter &JCE);
67   virtual bool addSimpleCodeEmitter(PassManagerBase &PM,
68                                     CodeGenOpt::Level OptLevel,
69                                     MachineCodeEmitter &MCE);
70   virtual bool addSimpleCodeEmitter(PassManagerBase &PM,
71                                     CodeGenOpt::Level OptLevel,
72                                     JITCodeEmitter &JCE);
73   virtual bool addSimpleCodeEmitter(PassManagerBase &PM,
74                                     CodeGenOpt::Level OptLevel,
75                                     ObjectCodeEmitter &OCE);
76 };
77
78 } // end namespace llvm
79
80 #endif