blob: b7f824e20e85540fd5c2cdf7f6fc72a206d4574d [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"
18#include "llvm/Target/TargetFrameInfo.h"
19#include "llvm/PassManager.h"
20#include "AlphaInstrInfo.h"
Andrew Lenharth0934ae02005-07-22 20:52:16 +000021#include "AlphaJITInfo.h"
Andrew Lenharth304d0f32005-01-22 23:41:55 +000022
23namespace llvm {
24
25class GlobalValue;
26class IntrinsicLowering;
27
28class AlphaTargetMachine : public TargetMachine {
29 AlphaInstrInfo InstrInfo;
30 TargetFrameInfo FrameInfo;
Andrew Lenharth0934ae02005-07-22 20:52:16 +000031 AlphaJITInfo JITInfo;
Andrew Lenharth304d0f32005-01-22 23:41:55 +000032
33public:
34 AlphaTargetMachine(const Module &M, IntrinsicLowering *IL);
Misha Brukman4633f1c2005-04-21 23:13:11 +000035
36 virtual const AlphaInstrInfo *getInstrInfo() const { return &InstrInfo; }
Andrew Lenharth304d0f32005-01-22 23:41:55 +000037 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
38 virtual const MRegisterInfo *getRegisterInfo() const {
39 return &InstrInfo.getRegisterInfo();
40 }
Andrew Lenharth0934ae02005-07-22 20:52:16 +000041 virtual TargetJITInfo* getJITInfo() {
42 return &JITInfo;
43 }
44
45 static unsigned getJITMatchQuality();
46
47 /// addPassesToEmitMachineCode - Add passes to the specified pass manager to
48 /// get machine code emitted. This uses a MachineCodeEmitter object to handle
49 /// actually outputting the machine code and resolving things like the address
50 /// of functions. This method should returns true if machine code emission is
51 /// not supported.
52 ///
53 virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM,
54 MachineCodeEmitter &MCE);
Misha Brukman4633f1c2005-04-21 23:13:11 +000055
Chris Lattner0431c962005-06-25 02:48:37 +000056 virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
57 CodeGenFileType FileType);
Andrew Lenharth2f401632005-02-01 20:35:11 +000058
59 static unsigned getModuleMatchQuality(const Module &M);
Andrew Lenharth304d0f32005-01-22 23:41:55 +000060};
61
62} // end namespace llvm
63
64#endif