1 //===-- PIC16TargetMachine.cpp - Define TargetMachine for PIC16 -----------===//
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 // Top-level implementation for the PIC16 target.
12 //===----------------------------------------------------------------------===//
15 #include "PIC16TargetAsmInfo.h"
16 #include "PIC16TargetMachine.h"
17 #include "llvm/Module.h"
18 #include "llvm/PassManager.h"
19 #include "llvm/Target/TargetAsmInfo.h"
20 #include "llvm/Target/TargetMachineRegistry.h"
25 // Register the targets
26 RegisterTarget<PIC16TargetMachine> X("pic16", " PIC16 14-bit");
30 PIC16TargetMachine(const Module &M, const std::string &FS) :
31 Subtarget(*this, M, FS), DataLayout("e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8"),
32 InstrInfo(*this), TLInfo(*this),
33 FrameInfo(TargetFrameInfo::StackGrowsUp, 8, 0) { }
36 const TargetAsmInfo *PIC16TargetMachine::createTargetAsmInfo() const
38 return new PIC16TargetAsmInfo(*this);
41 //===----------------------------------------------------------------------===//
42 // Pass Pipeline Configuration
43 //===----------------------------------------------------------------------===//
45 bool PIC16TargetMachine::addInstSelector(PassManagerBase &PM, bool Fast)
47 // Install an instruction selector.
48 PM.add(createPIC16ISelDag(*this));
52 bool PIC16TargetMachine::
53 addPrologEpilogInserter(PassManagerBase &PM, bool Fast)
58 bool PIC16TargetMachine::addPreEmitPass(PassManagerBase &PM, bool Fast)
63 bool PIC16TargetMachine::
64 addAssemblyEmitter(PassManagerBase &PM, bool Fast, std::ostream &Out)
66 // Output assembly language.
67 PM.add(createPIC16CodePrinterPass(Out, *this));