Misha Brukman | bc9ccf6 | 2005-02-04 20:25:52 +0000 | [diff] [blame] | 1 | //===-- AlphaTargetMachine.h - Define TargetMachine for Alpha ---*- C++ -*-===// |
Misha Brukman | 4633f1c | 2005-04-21 23:13:11 +0000 | [diff] [blame] | 2 | // |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file was developed by the LLVM research group and is distributed under |
| 6 | // the University of Illinois Open Source License. See LICENSE.TXT for details. |
Misha Brukman | 4633f1c | 2005-04-21 23:13:11 +0000 | [diff] [blame] | 7 | // |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 8 | //===----------------------------------------------------------------------===// |
Misha Brukman | 4633f1c | 2005-04-21 23:13:11 +0000 | [diff] [blame] | 9 | // |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 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/TargetFrameInfo.h" |
| 19 | #include "llvm/PassManager.h" |
| 20 | #include "AlphaInstrInfo.h" |
Andrew Lenharth | 0934ae0 | 2005-07-22 20:52:16 +0000 | [diff] [blame] | 21 | #include "AlphaJITInfo.h" |
Andrew Lenharth | 120ab48 | 2005-09-29 22:54:56 +0000 | [diff] [blame] | 22 | #include "AlphaSubtarget.h" |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 23 | |
| 24 | namespace llvm { |
| 25 | |
| 26 | class GlobalValue; |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 27 | |
| 28 | class AlphaTargetMachine : public TargetMachine { |
| 29 | AlphaInstrInfo InstrInfo; |
| 30 | TargetFrameInfo FrameInfo; |
Andrew Lenharth | 0934ae0 | 2005-07-22 20:52:16 +0000 | [diff] [blame] | 31 | AlphaJITInfo JITInfo; |
Andrew Lenharth | 120ab48 | 2005-09-29 22:54:56 +0000 | [diff] [blame] | 32 | AlphaSubtarget Subtarget; |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 33 | |
| 34 | public: |
Chris Lattner | bc641b9 | 2006-03-23 05:43:16 +0000 | [diff] [blame] | 35 | AlphaTargetMachine(const Module &M, const std::string &FS); |
Misha Brukman | 4633f1c | 2005-04-21 23:13:11 +0000 | [diff] [blame] | 36 | |
| 37 | virtual const AlphaInstrInfo *getInstrInfo() const { return &InstrInfo; } |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 38 | virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; } |
Andrew Lenharth | 120ab48 | 2005-09-29 22:54:56 +0000 | [diff] [blame] | 39 | virtual const TargetSubtarget *getSubtargetImpl() const{ return &Subtarget; } |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 40 | virtual const MRegisterInfo *getRegisterInfo() const { |
| 41 | return &InstrInfo.getRegisterInfo(); |
| 42 | } |
Andrew Lenharth | 0934ae0 | 2005-07-22 20:52:16 +0000 | [diff] [blame] | 43 | virtual TargetJITInfo* getJITInfo() { |
| 44 | return &JITInfo; |
| 45 | } |
| 46 | |
| 47 | static unsigned getJITMatchQuality(); |
| 48 | |
Andrew Lenharth | 0934ae0 | 2005-07-22 20:52:16 +0000 | [diff] [blame] | 49 | virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM, |
| 50 | MachineCodeEmitter &MCE); |
Misha Brukman | 4633f1c | 2005-04-21 23:13:11 +0000 | [diff] [blame] | 51 | |
Chris Lattner | 0431c96 | 2005-06-25 02:48:37 +0000 | [diff] [blame] | 52 | virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out, |
Chris Lattner | ce8eb0c | 2005-11-08 02:11:51 +0000 | [diff] [blame] | 53 | CodeGenFileType FileType, bool Fast); |
Andrew Lenharth | 2f40163 | 2005-02-01 20:35:11 +0000 | [diff] [blame] | 54 | |
| 55 | static unsigned getModuleMatchQuality(const Module &M); |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 56 | }; |
| 57 | |
| 58 | } // end namespace llvm |
| 59 | |
| 60 | #endif |