1 //===-- SkeletonTargetMachine.cpp - Define TargetMachine for Skeleton -----===//
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 //===----------------------------------------------------------------------===//
11 //===----------------------------------------------------------------------===//
13 #include "SkeletonTargetMachine.h"
15 #include "llvm/Module.h"
16 #include "llvm/PassManager.h"
17 #include "llvm/Target/TargetOptions.h"
18 #include "llvm/Target/TargetMachineRegistry.h"
19 #include "llvm/CodeGen/MachineFunction.h"
20 #include "llvm/CodeGen/Passes.h"
24 // Register the target.
25 RegisterTarget<SkeletonTargetMachine> X("skeleton",
26 " Target Skeleton (unusable)");
29 /// SkeletonTargetMachine ctor - Create an ILP32 architecture model
31 SkeletonTargetMachine::SkeletonTargetMachine(const Module &M,
32 IntrinsicLowering *IL)
33 : TargetMachine("Skeleton", IL, true, 4, 4, 4, 4, 4),
34 FrameInfo(TargetFrameInfo::StackGrowsDown, 8, -4), JITInfo(*this) {
37 /// addPassesToEmitAssembly - Add passes to the specified pass manager
38 /// to implement a static compiler for this target.
40 bool SkeletonTargetMachine::addPassesToEmitAssembly(PassManager &PM,
42 // <insert instruction selector passes here>
43 PM.add(createRegisterAllocator());
44 PM.add(createPrologEpilogCodeInserter());
45 // <insert assembly code output passes here>
46 PM.add(createMachineCodeDeleter());
47 return true; // change to `return false' when this actually works.
50 /// addPassesToJITCompile - Add passes to the specified pass manager to
51 /// implement a fast dynamic compiler for this target.
53 void SkeletonJITInfo::addPassesToJITCompile(FunctionPassManager &PM) {
54 // <insert instruction selector passes here>
55 PM.add(createRegisterAllocator());
56 PM.add(createPrologEpilogCodeInserter());