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; |
| 27 | class IntrinsicLowering; |
| 28 | |
| 29 | class AlphaTargetMachine : public TargetMachine { |
| 30 | AlphaInstrInfo InstrInfo; |
| 31 | TargetFrameInfo FrameInfo; |
Andrew Lenharth | 0934ae0 | 2005-07-22 20:52:16 +0000 | [diff] [blame] | 32 | AlphaJITInfo JITInfo; |
Andrew Lenharth | 120ab48 | 2005-09-29 22:54:56 +0000 | [diff] [blame^] | 33 | AlphaSubtarget Subtarget; |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 34 | |
| 35 | public: |
Jim Laskey | b1e1180 | 2005-09-01 21:38:21 +0000 | [diff] [blame] | 36 | AlphaTargetMachine(const Module &M, IntrinsicLowering *IL, |
| 37 | 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 | } |
Andrew Lenharth | 0934ae0 | 2005-07-22 20:52:16 +0000 | [diff] [blame] | 45 | virtual TargetJITInfo* getJITInfo() { |
| 46 | return &JITInfo; |
| 47 | } |
| 48 | |
| 49 | static unsigned getJITMatchQuality(); |
| 50 | |
| 51 | /// addPassesToEmitMachineCode - Add passes to the specified pass manager to |
| 52 | /// get machine code emitted. This uses a MachineCodeEmitter object to handle |
| 53 | /// actually outputting the machine code and resolving things like the address |
| 54 | /// of functions. This method should returns true if machine code emission is |
| 55 | /// not supported. |
| 56 | /// |
| 57 | virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM, |
| 58 | MachineCodeEmitter &MCE); |
Misha Brukman | 4633f1c | 2005-04-21 23:13:11 +0000 | [diff] [blame] | 59 | |
Chris Lattner | 0431c96 | 2005-06-25 02:48:37 +0000 | [diff] [blame] | 60 | virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out, |
| 61 | CodeGenFileType FileType); |
Andrew Lenharth | 2f40163 | 2005-02-01 20:35:11 +0000 | [diff] [blame] | 62 | |
| 63 | static unsigned getModuleMatchQuality(const Module &M); |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 64 | }; |
| 65 | |
| 66 | } // end namespace llvm |
| 67 | |
| 68 | #endif |