LLVM API Documentation

AlphaTargetMachine.h

Go to the documentation of this file.
00001 //===-- AlphaTargetMachine.h - Define TargetMachine for Alpha ---*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file declares the Alpha-specific subclass of TargetMachine.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #ifndef ALPHA_TARGETMACHINE_H
00015 #define ALPHA_TARGETMACHINE_H
00016 
00017 #include "llvm/Target/TargetMachine.h"
00018 #include "llvm/Target/TargetData.h"
00019 #include "llvm/Target/TargetFrameInfo.h"
00020 #include "AlphaInstrInfo.h"
00021 #include "AlphaJITInfo.h"
00022 #include "AlphaISelLowering.h"
00023 #include "AlphaSubtarget.h"
00024 
00025 namespace llvm {
00026 
00027 class GlobalValue;
00028 
00029 class AlphaTargetMachine : public LLVMTargetMachine {
00030   const TargetData DataLayout;       // Calculates type size & alignment
00031   AlphaInstrInfo InstrInfo;
00032   TargetFrameInfo FrameInfo;
00033   AlphaJITInfo JITInfo;
00034   AlphaSubtarget Subtarget;
00035   AlphaTargetLowering TLInfo;
00036 
00037 public:
00038   AlphaTargetMachine(const Target &T, const std::string &TT,
00039                      const std::string &FS);
00040 
00041   virtual const AlphaInstrInfo *getInstrInfo() const { return &InstrInfo; }
00042   virtual const TargetFrameInfo  *getFrameInfo() const { return &FrameInfo; }
00043   virtual const AlphaSubtarget   *getSubtargetImpl() const{ return &Subtarget; }
00044   virtual const AlphaRegisterInfo *getRegisterInfo() const {
00045     return &InstrInfo.getRegisterInfo();
00046   }
00047   virtual AlphaTargetLowering* getTargetLowering() const {
00048     return const_cast<AlphaTargetLowering*>(&TLInfo);
00049   }
00050   virtual const TargetData       *getTargetData() const { return &DataLayout; }
00051   virtual AlphaJITInfo* getJITInfo() {
00052     return &JITInfo;
00053   }
00054 
00055   // Pass Pipeline Configuration
00056   virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
00057   virtual bool addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
00058   virtual bool addCodeEmitter(PassManagerBase &PM, CodeGenOpt::Level OptLevel,
00059                               MachineCodeEmitter &MCE);
00060   virtual bool addCodeEmitter(PassManagerBase &PM, CodeGenOpt::Level OptLevel,
00061                               JITCodeEmitter &JCE);
00062   virtual bool addCodeEmitter(PassManagerBase &PM, CodeGenOpt::Level OptLevel,
00063                               ObjectCodeEmitter &JCE);
00064   virtual bool addSimpleCodeEmitter(PassManagerBase &PM,
00065                                     CodeGenOpt::Level OptLevel,
00066                                     MachineCodeEmitter &MCE);
00067   virtual bool addSimpleCodeEmitter(PassManagerBase &PM,
00068                                     CodeGenOpt::Level OptLevel,
00069                                     JITCodeEmitter &JCE);
00070   virtual bool addSimpleCodeEmitter(PassManagerBase &PM,
00071                                     CodeGenOpt::Level OptLevel,
00072                                     ObjectCodeEmitter &OCE);
00073 };
00074 
00075 } // end namespace llvm
00076 
00077 #endif