blob: c00e71c87531e87b55074f883615899b5f16800f [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//
5// This file was developed by the LLVM research group and is distributed under
6// the University of Illinois Open Source 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 Lenharth120ab482005-09-29 22:54:56 +000022#include "AlphaSubtarget.h"
Andrew Lenharth304d0f32005-01-22 23:41:55 +000023
24namespace llvm {
25
26class GlobalValue;
Andrew Lenharth304d0f32005-01-22 23:41:55 +000027
Chris Lattner1911fd42006-09-04 04:14:57 +000028class AlphaTargetMachine : public LLVMTargetMachine {
Owen Andersona69571c2006-05-03 01:29:57 +000029 const TargetData DataLayout; // Calculates type size & alignment
Andrew Lenharth304d0f32005-01-22 23:41:55 +000030 AlphaInstrInfo InstrInfo;
31 TargetFrameInfo FrameInfo;
Andrew Lenharth0934ae02005-07-22 20:52:16 +000032 AlphaJITInfo JITInfo;
Andrew Lenharth120ab482005-09-29 22:54:56 +000033 AlphaSubtarget Subtarget;
Jim Laskeyfde1b3b2006-09-07 23:39:26 +000034
35protected:
36 virtual const TargetAsmInfo *createTargetAsmInfo() const;
Owen Andersona69571c2006-05-03 01:29:57 +000037
Andrew Lenharth304d0f32005-01-22 23:41:55 +000038public:
Chris Lattnerbc641b92006-03-23 05:43:16 +000039 AlphaTargetMachine(const Module &M, const std::string &FS);
Misha Brukman4633f1c2005-04-21 23:13:11 +000040
41 virtual const AlphaInstrInfo *getInstrInfo() const { return &InstrInfo; }
Andrew Lenharth304d0f32005-01-22 23:41:55 +000042 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
Andrew Lenharth120ab482005-09-29 22:54:56 +000043 virtual const TargetSubtarget *getSubtargetImpl() const{ return &Subtarget; }
Andrew Lenharth304d0f32005-01-22 23:41:55 +000044 virtual const MRegisterInfo *getRegisterInfo() const {
45 return &InstrInfo.getRegisterInfo();
46 }
Owen Andersona69571c2006-05-03 01:29:57 +000047 virtual const TargetData *getTargetData() const { return &DataLayout; }
Andrew Lenharth0934ae02005-07-22 20:52:16 +000048 virtual TargetJITInfo* getJITInfo() {
49 return &JITInfo;
50 }
51
52 static unsigned getJITMatchQuality();
Andrew Lenharth2f401632005-02-01 20:35:11 +000053 static unsigned getModuleMatchQuality(const Module &M);
Chris Lattner1911fd42006-09-04 04:14:57 +000054
55 // Pass Pipeline Configuration
56 virtual bool addInstSelector(FunctionPassManager &PM, bool Fast);
57 virtual bool addPreEmitPass(FunctionPassManager &PM, bool Fast);
58 virtual bool addAssemblyEmitter(FunctionPassManager &PM, bool Fast,
59 std::ostream &Out);
60 virtual bool addCodeEmitter(FunctionPassManager &PM, bool Fast,
61 MachineCodeEmitter &MCE);
Andrew Lenharth304d0f32005-01-22 23:41:55 +000062};
63
64} // end namespace llvm
65
66#endif