Misha Brukman | d71295a | 2003-12-17 22:04:00 +0000 | [diff] [blame^] | 1 | //===-- SparcTargetMachine.h - Define TargetMachine for Sparc ---*- 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 primary interface to machine description for the |
| 11 | // UltraSPARC. |
| 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
| 15 | #ifndef SPARC_TARGETMACHINE_H |
| 16 | #define SPARC_TARGETMACHINE_H |
| 17 | |
| 18 | #include "llvm/PassManager.h" |
| 19 | #include "llvm/Target/TargetFrameInfo.h" |
| 20 | #include "llvm/Target/TargetMachine.h" |
| 21 | #include "SparcInstrInfo.h" |
| 22 | #include "SparcInternals.h" |
| 23 | #include "SparcRegInfo.h" |
| 24 | #include "SparcFrameInfo.h" |
| 25 | |
| 26 | namespace llvm { |
| 27 | |
| 28 | class SparcTargetMachine : public TargetMachine { |
| 29 | SparcInstrInfo instrInfo; |
| 30 | SparcSchedInfo schedInfo; |
| 31 | SparcRegInfo regInfo; |
| 32 | SparcFrameInfo frameInfo; |
| 33 | SparcCacheInfo cacheInfo; |
| 34 | public: |
| 35 | SparcTargetMachine(); |
| 36 | |
| 37 | virtual const TargetInstrInfo &getInstrInfo() const { return instrInfo; } |
| 38 | virtual const TargetSchedInfo &getSchedInfo() const { return schedInfo; } |
| 39 | virtual const TargetRegInfo &getRegInfo() const { return regInfo; } |
| 40 | virtual const TargetFrameInfo &getFrameInfo() const { return frameInfo; } |
| 41 | virtual const TargetCacheInfo &getCacheInfo() const { return cacheInfo; } |
| 42 | |
| 43 | virtual bool addPassesToEmitAssembly(PassManager &PM, std::ostream &Out); |
| 44 | virtual bool addPassesToJITCompile(FunctionPassManager &PM); |
| 45 | virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM, |
| 46 | MachineCodeEmitter &MCE); |
| 47 | virtual void replaceMachineCodeForFunction(void *Old, void *New); |
| 48 | |
| 49 | /// getJITStubForFunction - Create or return a stub for the specified |
| 50 | /// function. This stub acts just like the specified function, except that it |
| 51 | /// allows the "address" of the function to be taken without having to |
| 52 | /// generate code for it. |
| 53 | /// |
| 54 | ///virtual void *getJITStubForFunction(Function *F, MachineCodeEmitter &MCE); |
| 55 | }; |
| 56 | |
| 57 | } // End llvm namespace |
| 58 | |
| 59 | #endif |