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 "PIC16SelectionDAGInfo.h"
21 #include "PIC16RegisterInfo.h"
22 #include "PIC16Subtarget.h"
23 #include "llvm/Target/TargetData.h"
24 #include "llvm/Target/TargetFrameInfo.h"
25 #include "llvm/Target/TargetMachine.h"
29 /// PIC16TargetMachine
31 class PIC16TargetMachine : public LLVMTargetMachine {
32 PIC16Subtarget Subtarget;
33 const TargetData DataLayout; // Calculates type size & alignment
34 PIC16InstrInfo InstrInfo;
35 PIC16TargetLowering TLInfo;
36 PIC16SelectionDAGInfo TSInfo;
38 // PIC16 does not have any call stack frame, therefore not having
39 // any PIC16 specific FrameInfo class.
40 TargetFrameInfo FrameInfo;
43 PIC16TargetMachine(const Target &T, const std::string &TT,
44 const std::string &FS, bool Cooper = false);
46 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
47 virtual const PIC16InstrInfo *getInstrInfo() const { return &InstrInfo; }
48 virtual const TargetData *getTargetData() const { return &DataLayout;}
49 virtual const PIC16Subtarget *getSubtargetImpl() const { return &Subtarget; }
51 virtual const PIC16RegisterInfo *getRegisterInfo() const {
52 return &(InstrInfo.getRegisterInfo());
55 virtual const PIC16TargetLowering *getTargetLowering() const {
59 virtual const PIC16SelectionDAGInfo* getSelectionDAGInfo() const {
63 virtual bool addInstSelector(PassManagerBase &PM,
64 CodeGenOpt::Level OptLevel);
65 virtual bool addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
66 }; // PIC16TargetMachine.
68 } // end namespace llvm