Rafael Espindola | 7bc59bc | 2006-05-14 22:18:28 +0000 | [diff] [blame] | 1 | //===-- ARMTargetMachine.h - Define TargetMachine for ARM -------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file was developed by the "Instituto Nokia de Tecnologia" and |
| 6 | // is distributed under the University of Illinois Open Source |
| 7 | // License. See LICENSE.TXT for details. |
| 8 | // |
| 9 | //===----------------------------------------------------------------------===// |
| 10 | // |
| 11 | // This file declares the ARM specific subclass of TargetMachine. |
| 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
| 15 | #ifndef ARMTARGETMACHINE_H |
| 16 | #define ARMTARGETMACHINE_H |
| 17 | |
| 18 | #include "llvm/Target/TargetMachine.h" |
| 19 | #include "llvm/Target/TargetData.h" |
| 20 | #include "llvm/Target/TargetFrameInfo.h" |
Rafael Espindola | 7bc59bc | 2006-05-14 22:18:28 +0000 | [diff] [blame] | 21 | #include "ARMInstrInfo.h" |
Rafael Espindola | ec46ea3 | 2006-08-16 14:43:33 +0000 | [diff] [blame] | 22 | #include "ARMFrameInfo.h" |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame^] | 23 | #include "ARMSubtarget.h" |
Rafael Espindola | 7bc59bc | 2006-05-14 22:18:28 +0000 | [diff] [blame] | 24 | |
| 25 | namespace llvm { |
| 26 | |
| 27 | class Module; |
| 28 | |
Chris Lattner | 1911fd4 | 2006-09-04 04:14:57 +0000 | [diff] [blame] | 29 | class ARMTargetMachine : public LLVMTargetMachine { |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame^] | 30 | ARMSubtarget Subtarget; |
| 31 | const TargetData DataLayout; // Calculates type size & alignment |
| 32 | ARMInstrInfo InstrInfo; |
| 33 | ARMFrameInfo FrameInfo; |
Rafael Espindola | 7bc59bc | 2006-05-14 22:18:28 +0000 | [diff] [blame] | 34 | public: |
| 35 | ARMTargetMachine(const Module &M, const std::string &FS); |
| 36 | |
| 37 | virtual const ARMInstrInfo *getInstrInfo() const { return &InstrInfo; } |
| 38 | virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; } |
| 39 | virtual const MRegisterInfo *getRegisterInfo() const { |
| 40 | return &InstrInfo.getRegisterInfo(); |
| 41 | } |
| 42 | virtual const TargetData *getTargetData() const { return &DataLayout; } |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame^] | 43 | virtual const ARMSubtarget *getSubtargetImpl() const { return &Subtarget; } |
Rafael Espindola | 7bc59bc | 2006-05-14 22:18:28 +0000 | [diff] [blame] | 44 | static unsigned getModuleMatchQuality(const Module &M); |
| 45 | |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame^] | 46 | virtual const TargetAsmInfo *createTargetAsmInfo() const; |
| 47 | |
Chris Lattner | 1911fd4 | 2006-09-04 04:14:57 +0000 | [diff] [blame] | 48 | // Pass Pipeline Configuration |
| 49 | virtual bool addInstSelector(FunctionPassManager &PM, bool Fast); |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame^] | 50 | virtual bool addPreEmitPass(FunctionPassManager &PM, bool Fast); |
Chris Lattner | 1911fd4 | 2006-09-04 04:14:57 +0000 | [diff] [blame] | 51 | virtual bool addAssemblyEmitter(FunctionPassManager &PM, bool Fast, |
| 52 | std::ostream &Out); |
Rafael Espindola | 7bc59bc | 2006-05-14 22:18:28 +0000 | [diff] [blame] | 53 | }; |
| 54 | |
| 55 | } // end namespace llvm |
| 56 | |
| 57 | #endif |