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