1 //===-- PIC16TargetMachine.h - Define TargetMachine for PIC16 ---*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file declares the PIC16 specific subclass of TargetMachine.
12 //===----------------------------------------------------------------------===//
15 #ifndef PIC16_TARGETMACHINE_H
16 #define PIC16_TARGETMACHINE_H
18 #include "PIC16InstrInfo.h"
19 #include "PIC16ISelLowering.h"
20 #include "PIC16Subtarget.h"
21 #include "llvm/Target/TargetData.h"
22 #include "llvm/Target/TargetFrameInfo.h"
23 #include "llvm/Target/TargetMachine.h"
27 /// PIC16TargetMachine
29 class PIC16TargetMachine : public LLVMTargetMachine {
30 PIC16Subtarget Subtarget;
31 const TargetData DataLayout; // Calculates type size & alignment
32 PIC16InstrInfo InstrInfo;
33 PIC16TargetLowering TLInfo;
34 TargetFrameInfo FrameInfo;
37 virtual const TargetAsmInfo *createTargetAsmInfo() const;
40 PIC16TargetMachine(const Module &M, const std::string &FS);
42 virtual const TargetFrameInfo *getFrameInfo() const
43 { return &FrameInfo; }
44 virtual const PIC16InstrInfo *getInstrInfo() const
45 { return &InstrInfo; }
46 virtual const TargetData *getTargetData() const
47 { return &DataLayout; }
48 virtual PIC16TargetLowering *getTargetLowering() const
49 { return const_cast<PIC16TargetLowering*>(&TLInfo); }
50 virtual const PIC16RegisterInfo *getRegisterInfo() const
51 { return &InstrInfo.getRegisterInfo(); }
53 virtual bool addInstSelector(PassManagerBase &PM, bool Fast);
54 virtual bool addPrologEpilogInserter(PassManagerBase &PM, bool Fast);
55 virtual bool addPreEmitPass(PassManagerBase &PM, bool Fast);
56 virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast,
59 } // end namespace llvm