blob: 413a99464a634682046f5343920c34f2521097f9 [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"
20#include "llvm/PassManager.h"
21#include "AlphaInstrInfo.h"
Andrew Lenharth0934ae02005-07-22 20:52:16 +000022#include "AlphaJITInfo.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
29class AlphaTargetMachine : public TargetMachine {
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;
Owen Andersona69571c2006-05-03 01:29:57 +000035
Andrew Lenharth304d0f32005-01-22 23:41:55 +000036public:
Chris Lattnerbc641b92006-03-23 05:43:16 +000037 AlphaTargetMachine(const Module &M, const std::string &FS);
Misha Brukman4633f1c2005-04-21 23:13:11 +000038
39 virtual const AlphaInstrInfo *getInstrInfo() const { return &InstrInfo; }
Andrew Lenharth304d0f32005-01-22 23:41:55 +000040 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
Andrew Lenharth120ab482005-09-29 22:54:56 +000041 virtual const TargetSubtarget *getSubtargetImpl() const{ return &Subtarget; }
Andrew Lenharth304d0f32005-01-22 23:41:55 +000042 virtual const MRegisterInfo *getRegisterInfo() const {
43 return &InstrInfo.getRegisterInfo();
44 }
Owen Andersona69571c2006-05-03 01:29:57 +000045 virtual const TargetData *getTargetData() const { return &DataLayout; }
Andrew Lenharth0934ae02005-07-22 20:52:16 +000046 virtual TargetJITInfo* getJITInfo() {
47 return &JITInfo;
48 }
49
50 static unsigned getJITMatchQuality();
51
Andrew Lenharth0934ae02005-07-22 20:52:16 +000052 virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM,
53 MachineCodeEmitter &MCE);
Misha Brukman4633f1c2005-04-21 23:13:11 +000054
Chris Lattner0431c962005-06-25 02:48:37 +000055 virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
Chris Lattnerce8eb0c2005-11-08 02:11:51 +000056 CodeGenFileType FileType, bool Fast);
Andrew Lenharth2f401632005-02-01 20:35:11 +000057
58 static unsigned getModuleMatchQuality(const Module &M);
Andrew Lenharth304d0f32005-01-22 23:41:55 +000059};
60
61} // end namespace llvm
62
63#endif