blob: b9a3d9809d2eed1dc995816b23f14c73aa7c92d5 [file] [log] [blame]
Rafael Espindola7bc59bc2006-05-14 22:18:28 +00001//===-- 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 Espindola7bc59bc2006-05-14 22:18:28 +000021#include "ARMInstrInfo.h"
Rafael Espindolaec46ea32006-08-16 14:43:33 +000022#include "ARMFrameInfo.h"
Rafael Espindola7bc59bc2006-05-14 22:18:28 +000023
24namespace llvm {
25
26class Module;
27
Chris Lattner1911fd42006-09-04 04:14:57 +000028class ARMTargetMachine : public LLVMTargetMachine {
Rafael Espindola7bc59bc2006-05-14 22:18:28 +000029 const TargetData DataLayout; // Calculates type size & alignment
30 ARMInstrInfo InstrInfo;
Rafael Espindolaec46ea32006-08-16 14:43:33 +000031 ARMFrameInfo FrameInfo;
Jim Laskeyfde1b3b2006-09-07 23:39:26 +000032
33protected:
34 virtual const TargetAsmInfo *createTargetAsmInfo() const;
35
Rafael Espindola7bc59bc2006-05-14 22:18:28 +000036public:
37 ARMTargetMachine(const Module &M, const std::string &FS);
38
39 virtual const ARMInstrInfo *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 const TargetData *getTargetData() const { return &DataLayout; }
45 static unsigned getModuleMatchQuality(const Module &M);
46
Chris Lattner1911fd42006-09-04 04:14:57 +000047 // Pass Pipeline Configuration
48 virtual bool addInstSelector(FunctionPassManager &PM, bool Fast);
Rafael Espindola71f3b942006-09-19 15:49:25 +000049 virtual bool addPostRegAlloc(FunctionPassManager &PM, bool Fast);
Chris Lattner1911fd42006-09-04 04:14:57 +000050 virtual bool addAssemblyEmitter(FunctionPassManager &PM, bool Fast,
51 std::ostream &Out);
Rafael Espindola7bc59bc2006-05-14 22:18:28 +000052};
53
54} // end namespace llvm
55
56#endif