Misha Brukman | 5dfe3a9 | 2004-06-21 16:55:25 +0000 | [diff] [blame] | 1 | //===-- PowerPCTargetMachine.h - Define TargetMachine for PowerPC -*- C++ -*-=// |
| 2 | // |
| 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. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file declares the PowerPC specific subclass of TargetMachine. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
Misha Brukman | 0145881 | 2004-08-11 00:11:25 +0000 | [diff] [blame] | 14 | #ifndef POWERPC_TARGETMACHINE_H |
| 15 | #define POWERPC_TARGETMACHINE_H |
Misha Brukman | 5dfe3a9 | 2004-06-21 16:55:25 +0000 | [diff] [blame] | 16 | |
Nate Begeman | ca068e8 | 2004-08-14 22:16:36 +0000 | [diff] [blame^] | 17 | #include "PowerPCFrameInfo.h" |
| 18 | #include "PowerPCInstrInfo.h" |
| 19 | #include "PowerPCJITInfo.h" |
Misha Brukman | 5dfe3a9 | 2004-06-21 16:55:25 +0000 | [diff] [blame] | 20 | #include "llvm/Target/TargetMachine.h" |
| 21 | #include "llvm/Target/TargetFrameInfo.h" |
| 22 | #include "llvm/PassManager.h" |
Misha Brukman | e2eceb5 | 2004-07-23 16:08:20 +0000 | [diff] [blame] | 23 | #include <set> |
Misha Brukman | 5dfe3a9 | 2004-06-21 16:55:25 +0000 | [diff] [blame] | 24 | |
| 25 | namespace llvm { |
| 26 | |
Misha Brukman | e2eceb5 | 2004-07-23 16:08:20 +0000 | [diff] [blame] | 27 | class GlobalValue; |
Misha Brukman | 5dfe3a9 | 2004-06-21 16:55:25 +0000 | [diff] [blame] | 28 | class IntrinsicLowering; |
| 29 | |
| 30 | class PowerPCTargetMachine : public TargetMachine { |
| 31 | PowerPCInstrInfo InstrInfo; |
Nate Begeman | ca068e8 | 2004-08-14 22:16:36 +0000 | [diff] [blame^] | 32 | PowerPCFrameInfo FrameInfo; |
Misha Brukman | 5dfe3a9 | 2004-06-21 16:55:25 +0000 | [diff] [blame] | 33 | PowerPCJITInfo JITInfo; |
Misha Brukman | e2eceb5 | 2004-07-23 16:08:20 +0000 | [diff] [blame] | 34 | |
Misha Brukman | 0145881 | 2004-08-11 00:11:25 +0000 | [diff] [blame] | 35 | protected: |
| 36 | PowerPCTargetMachine(const std::string &name, IntrinsicLowering *IL, |
Nate Begeman | ca068e8 | 2004-08-14 22:16:36 +0000 | [diff] [blame^] | 37 | const TargetData &TD, const PowerPCFrameInfo &TFI, |
Misha Brukman | 1d3527e | 2004-08-11 23:47:08 +0000 | [diff] [blame] | 38 | const PowerPCJITInfo &TJI, bool is64b); |
Misha Brukman | 5dfe3a9 | 2004-06-21 16:55:25 +0000 | [diff] [blame] | 39 | public: |
Misha Brukman | 5dfe3a9 | 2004-06-21 16:55:25 +0000 | [diff] [blame] | 40 | virtual const PowerPCInstrInfo *getInstrInfo() const { return &InstrInfo; } |
| 41 | virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; } |
| 42 | virtual const MRegisterInfo *getRegisterInfo() const { |
| 43 | return &InstrInfo.getRegisterInfo(); |
| 44 | } |
| 45 | virtual TargetJITInfo *getJITInfo() { |
| 46 | return &JITInfo; |
| 47 | } |
| 48 | |
Misha Brukman | 01eca8d | 2004-07-12 23:36:12 +0000 | [diff] [blame] | 49 | static unsigned getJITMatchQuality(); |
Nate Begeman | 7a4fe9b | 2004-08-11 07:40:04 +0000 | [diff] [blame] | 50 | |
| 51 | virtual bool addPassesToEmitAssembly(PassManager &PM, std::ostream &Out); |
| 52 | |
| 53 | // Two shared sets between the instruction selector and the printer allow for |
| 54 | // correct linkage on Darwin |
| 55 | std::set<GlobalValue*> CalledFunctions; |
| 56 | std::set<GlobalValue*> AddressTaken; |
Misha Brukman | 5dfe3a9 | 2004-06-21 16:55:25 +0000 | [diff] [blame] | 57 | }; |
| 58 | |
| 59 | } // end namespace llvm |
| 60 | |
| 61 | #endif |