blob: 0399d1a19a0a5053b4a6864b4fc6e3ca15f87d25 [file] [log] [blame]
Misha Brukmanbc9ccf62005-02-04 20:25:52 +00001//===-- AlphaTargetMachine.h - Define TargetMachine for Alpha ---*- C++ -*-===//
Misha Brukman4633f1c2005-04-21 23:13:11 +00002//
Andrew Lenharth304d0f32005-01-22 23:41:55 +00003// The LLVM Compiler Infrastructure
4//
Chris Lattner4ee451d2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Misha Brukman4633f1c2005-04-21 23:13:11 +00007//
Andrew Lenharth304d0f32005-01-22 23:41:55 +00008//===----------------------------------------------------------------------===//
Misha Brukman4633f1c2005-04-21 23:13:11 +00009//
Andrew Lenharth304d0f32005-01-22 23:41:55 +000010// 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"
Owen Anderson07000c62006-05-12 06:33:49 +000018#include "llvm/Target/TargetData.h"
Andrew Lenharth304d0f32005-01-22 23:41:55 +000019#include "llvm/Target/TargetFrameInfo.h"
Andrew Lenharth304d0f32005-01-22 23:41:55 +000020#include "AlphaInstrInfo.h"
Andrew Lenharth0934ae02005-07-22 20:52:16 +000021#include "AlphaJITInfo.h"
Andrew Lenharth82c3d8f2006-10-11 04:29:42 +000022#include "AlphaISelLowering.h"
Andrew Lenharth120ab482005-09-29 22:54:56 +000023#include "AlphaSubtarget.h"
Andrew Lenharth304d0f32005-01-22 23:41:55 +000024
25namespace llvm {
26
27class GlobalValue;
Andrew Lenharth304d0f32005-01-22 23:41:55 +000028
Chris Lattner1911fd42006-09-04 04:14:57 +000029class AlphaTargetMachine : public LLVMTargetMachine {
Owen Andersona69571c2006-05-03 01:29:57 +000030 const TargetData DataLayout; // Calculates type size & alignment
Andrew Lenharth304d0f32005-01-22 23:41:55 +000031 AlphaInstrInfo InstrInfo;
32 TargetFrameInfo FrameInfo;
Andrew Lenharth0934ae02005-07-22 20:52:16 +000033 AlphaJITInfo JITInfo;
Andrew Lenharth120ab482005-09-29 22:54:56 +000034 AlphaSubtarget Subtarget;
Andrew Lenharth82c3d8f2006-10-11 04:29:42 +000035 AlphaTargetLowering TLInfo;
Jim Laskeyfde1b3b2006-09-07 23:39:26 +000036
37protected:
38 virtual const TargetAsmInfo *createTargetAsmInfo() const;
Owen Andersona69571c2006-05-03 01:29:57 +000039
Andrew Lenharth304d0f32005-01-22 23:41:55 +000040public:
Chris Lattnerbc641b92006-03-23 05:43:16 +000041 AlphaTargetMachine(const Module &M, const std::string &FS);
Misha Brukman4633f1c2005-04-21 23:13:11 +000042
43 virtual const AlphaInstrInfo *getInstrInfo() const { return &InstrInfo; }
Andrew Lenharth304d0f32005-01-22 23:41:55 +000044 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
Andrew Lenharth120ab482005-09-29 22:54:56 +000045 virtual const TargetSubtarget *getSubtargetImpl() const{ return &Subtarget; }
Andrew Lenharth304d0f32005-01-22 23:41:55 +000046 virtual const MRegisterInfo *getRegisterInfo() const {
47 return &InstrInfo.getRegisterInfo();
48 }
Andrew Lenharth82c3d8f2006-10-11 04:29:42 +000049 virtual TargetLowering* getTargetLowering() const {
50 return const_cast<AlphaTargetLowering*>(&TLInfo);
51 }
Owen Andersona69571c2006-05-03 01:29:57 +000052 virtual const TargetData *getTargetData() const { return &DataLayout; }
Andrew Lenharth0934ae02005-07-22 20:52:16 +000053 virtual TargetJITInfo* getJITInfo() {
54 return &JITInfo;
55 }
56
57 static unsigned getJITMatchQuality();
Andrew Lenharth2f401632005-02-01 20:35:11 +000058 static unsigned getModuleMatchQuality(const Module &M);
Chris Lattner1911fd42006-09-04 04:14:57 +000059
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 Cheng8bd60352007-07-20 21:56:13 +000066 bool DumpAsm, MachineCodeEmitter &MCE);
Bill Wendling50e4e882007-02-08 01:38:33 +000067 virtual bool addSimpleCodeEmitter(FunctionPassManager &PM, bool Fast,
Evan Cheng8bd60352007-07-20 21:56:13 +000068 bool DumpAsm, MachineCodeEmitter &MCE);
Andrew Lenharth304d0f32005-01-22 23:41:55 +000069};
70
71} // end namespace llvm
72
73#endif