1 //===-- AlphaTargetMachine.h - Define TargetMachine for Alpha ---*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
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.
8 //===----------------------------------------------------------------------===//
10 // This file declares the Alpha-specific subclass of TargetMachine.
12 //===----------------------------------------------------------------------===//
14 #ifndef ALPHA_TARGETMACHINE_H
15 #define ALPHA_TARGETMACHINE_H
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 "AlphaSubtarget.h"
23 #include "AlphaTargetAsmInfo.h"
29 class AlphaTargetMachine : public LLVMTargetMachine {
30 const TargetData DataLayout; // Calculates type size & alignment
31 AlphaInstrInfo InstrInfo;
32 TargetFrameInfo FrameInfo;
34 AlphaSubtarget Subtarget;
35 AlphaTargetAsmInfo *AsmInfo;
38 AlphaTargetMachine(const Module &M, const std::string &FS);
39 ~AlphaTargetMachine() {
40 if (AsmInfo) delete AsmInfo;
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();
49 virtual const TargetData *getTargetData() const { return &DataLayout; }
50 virtual TargetJITInfo* getJITInfo() {
54 virtual const TargetAsmInfo *createTargetAsmInfo() const {
55 return static_cast<const TargetAsmInfo *>(new AlphaTargetAsmInfo(*this));
58 static unsigned getJITMatchQuality();
59 static unsigned getModuleMatchQuality(const Module &M);
61 // Pass Pipeline Configuration
62 virtual bool addInstSelector(FunctionPassManager &PM, bool Fast);
63 virtual bool addPreEmitPass(FunctionPassManager &PM, bool Fast);
64 virtual bool addAssemblyEmitter(FunctionPassManager &PM, bool Fast,
66 virtual bool addCodeEmitter(FunctionPassManager &PM, bool Fast,
67 MachineCodeEmitter &MCE);
70 } // end namespace llvm