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" |
Owen Anderson | 07000c6 | 2006-05-12 06:33:49 +0000 | [diff] [blame^] | 18 | #include "llvm/Target/TargetData.h" |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 19 | #include "llvm/Target/TargetFrameInfo.h" |
| 20 | #include "llvm/PassManager.h" |
| 21 | #include "AlphaInstrInfo.h" |
Andrew Lenharth | 0934ae0 | 2005-07-22 20:52:16 +0000 | [diff] [blame] | 22 | #include "AlphaJITInfo.h" |
Andrew Lenharth | 120ab48 | 2005-09-29 22:54:56 +0000 | [diff] [blame] | 23 | #include "AlphaSubtarget.h" |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 24 | |
| 25 | namespace llvm { |
| 26 | |
| 27 | class GlobalValue; |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 28 | |
| 29 | class AlphaTargetMachine : public TargetMachine { |
Owen Anderson | a69571c | 2006-05-03 01:29:57 +0000 | [diff] [blame] | 30 | const TargetData DataLayout; // Calculates type size & alignment |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 31 | AlphaInstrInfo InstrInfo; |
| 32 | TargetFrameInfo FrameInfo; |
Andrew Lenharth | 0934ae0 | 2005-07-22 20:52:16 +0000 | [diff] [blame] | 33 | AlphaJITInfo JITInfo; |
Andrew Lenharth | 120ab48 | 2005-09-29 22:54:56 +0000 | [diff] [blame] | 34 | AlphaSubtarget Subtarget; |
Owen Anderson | a69571c | 2006-05-03 01:29:57 +0000 | [diff] [blame] | 35 | |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 36 | public: |
Chris Lattner | bc641b9 | 2006-03-23 05:43:16 +0000 | [diff] [blame] | 37 | AlphaTargetMachine(const Module &M, const std::string &FS); |
Misha Brukman | 4633f1c | 2005-04-21 23:13:11 +0000 | [diff] [blame] | 38 | |
| 39 | virtual const AlphaInstrInfo *getInstrInfo() const { return &InstrInfo; } |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 40 | virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; } |
Andrew Lenharth | 120ab48 | 2005-09-29 22:54:56 +0000 | [diff] [blame] | 41 | virtual const TargetSubtarget *getSubtargetImpl() const{ return &Subtarget; } |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 42 | virtual const MRegisterInfo *getRegisterInfo() const { |
| 43 | return &InstrInfo.getRegisterInfo(); |
| 44 | } |
Owen Anderson | a69571c | 2006-05-03 01:29:57 +0000 | [diff] [blame] | 45 | virtual const TargetData *getTargetData() const { return &DataLayout; } |
Andrew Lenharth | 0934ae0 | 2005-07-22 20:52:16 +0000 | [diff] [blame] | 46 | virtual TargetJITInfo* getJITInfo() { |
| 47 | return &JITInfo; |
| 48 | } |
| 49 | |
| 50 | static unsigned getJITMatchQuality(); |
| 51 | |
Andrew Lenharth | 0934ae0 | 2005-07-22 20:52:16 +0000 | [diff] [blame] | 52 | virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM, |
| 53 | MachineCodeEmitter &MCE); |
Misha Brukman | 4633f1c | 2005-04-21 23:13:11 +0000 | [diff] [blame] | 54 | |
Chris Lattner | 0431c96 | 2005-06-25 02:48:37 +0000 | [diff] [blame] | 55 | virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out, |
Chris Lattner | ce8eb0c | 2005-11-08 02:11:51 +0000 | [diff] [blame] | 56 | CodeGenFileType FileType, bool Fast); |
Andrew Lenharth | 2f40163 | 2005-02-01 20:35:11 +0000 | [diff] [blame] | 57 | |
| 58 | static unsigned getModuleMatchQuality(const Module &M); |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 59 | }; |
| 60 | |
| 61 | } // end namespace llvm |
| 62 | |
| 63 | #endif |