blob: 0399d1a19a0a5053b4a6864b4fc6e3ca15f87d25 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001//===-- AlphaTargetMachine.h - Define TargetMachine for Alpha ---*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner081ce942007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Dan Gohmanf17a25c2007-07-18 16:29:46 +00007//
8//===----------------------------------------------------------------------===//
9//
10// This file declares the Alpha-specific subclass of TargetMachine.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef ALPHA_TARGETMACHINE_H
15#define ALPHA_TARGETMACHINE_H
16
17#include "llvm/Target/TargetMachine.h"
18#include "llvm/Target/TargetData.h"
19#include "llvm/Target/TargetFrameInfo.h"
20#include "AlphaInstrInfo.h"
21#include "AlphaJITInfo.h"
22#include "AlphaISelLowering.h"
23#include "AlphaSubtarget.h"
24
25namespace llvm {
26
27class GlobalValue;
28
29class AlphaTargetMachine : public LLVMTargetMachine {
30 const TargetData DataLayout; // Calculates type size & alignment
31 AlphaInstrInfo InstrInfo;
32 TargetFrameInfo FrameInfo;
33 AlphaJITInfo JITInfo;
34 AlphaSubtarget Subtarget;
35 AlphaTargetLowering TLInfo;
36
37protected:
38 virtual const TargetAsmInfo *createTargetAsmInfo() const;
39
40public:
41 AlphaTargetMachine(const Module &M, const std::string &FS);
42
43 virtual const AlphaInstrInfo *getInstrInfo() const { return &InstrInfo; }
44 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
45 virtual const TargetSubtarget *getSubtargetImpl() const{ return &Subtarget; }
46 virtual const MRegisterInfo *getRegisterInfo() const {
47 return &InstrInfo.getRegisterInfo();
48 }
49 virtual TargetLowering* getTargetLowering() const {
50 return const_cast<AlphaTargetLowering*>(&TLInfo);
51 }
52 virtual const TargetData *getTargetData() const { return &DataLayout; }
53 virtual TargetJITInfo* getJITInfo() {
54 return &JITInfo;
55 }
56
57 static unsigned getJITMatchQuality();
58 static unsigned getModuleMatchQuality(const Module &M);
59
60 // Pass Pipeline Configuration
61 virtual bool addInstSelector(FunctionPassManager &PM, bool Fast);
62 virtual bool addPreEmitPass(FunctionPassManager &PM, bool Fast);
63 virtual bool addAssemblyEmitter(FunctionPassManager &PM, bool Fast,
64 std::ostream &Out);
65 virtual bool addCodeEmitter(FunctionPassManager &PM, bool Fast,
Evan Cheng77547212007-07-20 21:56:13 +000066 bool DumpAsm, MachineCodeEmitter &MCE);
Dan Gohmanf17a25c2007-07-18 16:29:46 +000067 virtual bool addSimpleCodeEmitter(FunctionPassManager &PM, bool Fast,
Evan Cheng77547212007-07-20 21:56:13 +000068 bool DumpAsm, MachineCodeEmitter &MCE);
Dan Gohmanf17a25c2007-07-18 16:29:46 +000069};
70
71} // end namespace llvm
72
73#endif