Make target asm info a property of the target machine.
[oota-llvm.git] / lib / Target / ARM / ARMTargetMachine.h
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"
21 #include "ARMInstrInfo.h"
22 #include "ARMFrameInfo.h"
23 #include "ARMTargetAsmInfo.h"
24
25 namespace llvm {
26
27 class Module;
28
29 class ARMTargetMachine : public LLVMTargetMachine {
30   const TargetData DataLayout;       // Calculates type size & alignment
31   ARMInstrInfo InstrInfo;
32   ARMFrameInfo FrameInfo;
33 public:
34   ARMTargetMachine(const Module &M, const std::string &FS);
35
36   virtual const ARMInstrInfo *getInstrInfo() const { return &InstrInfo; }
37   virtual const TargetFrameInfo  *getFrameInfo() const { return &FrameInfo; }
38   virtual const MRegisterInfo *getRegisterInfo() const {
39     return &InstrInfo.getRegisterInfo();
40   }
41   virtual const TargetData       *getTargetData() const { return &DataLayout; }
42   static unsigned getModuleMatchQuality(const Module &M);
43
44   virtual const TargetAsmInfo *createTargetAsmInfo() const {
45     return static_cast<const TargetAsmInfo *>(new ARMTargetAsmInfo(*this));
46   }
47
48   // Pass Pipeline Configuration
49   virtual bool addInstSelector(FunctionPassManager &PM, bool Fast);
50   virtual bool addAssemblyEmitter(FunctionPassManager &PM, bool Fast, 
51                                   std::ostream &Out);
52 };
53
54 } // end namespace llvm
55
56 #endif