blob: f26c85bd739272e655975bc56d62625fa0ba16ab [file] [log] [blame]
Chris Lattner5ad021c2004-07-16 07:11:15 +00001//===-- SkeletonTargetMachine.cpp - Define TargetMachine for Skeleton -----===//
Misha Brukmanb5f662f2005-04-21 23:30:14 +00002//
Chris Lattner5ad021c2004-07-16 07:11:15 +00003// The LLVM Compiler Infrastructure
4//
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.
Misha Brukmanb5f662f2005-04-21 23:30:14 +00007//
Chris Lattner5ad021c2004-07-16 07:11:15 +00008//===----------------------------------------------------------------------===//
Misha Brukmanb5f662f2005-04-21 23:30:14 +00009//
Chris Lattner5ad021c2004-07-16 07:11:15 +000010//
11//===----------------------------------------------------------------------===//
12
13#include "SkeletonTargetMachine.h"
14#include "Skeleton.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"
21using namespace llvm;
22
23namespace {
24 // Register the target.
25 RegisterTarget<SkeletonTargetMachine> X("skeleton",
26 " Target Skeleton (unusable)");
27}
28
29/// SkeletonTargetMachine ctor - Create an ILP32 architecture model
30///
31SkeletonTargetMachine::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) {
35}
36
37/// addPassesToEmitAssembly - Add passes to the specified pass manager
38/// to implement a static compiler for this target.
39///
40bool SkeletonTargetMachine::addPassesToEmitAssembly(PassManager &PM,
41 std::ostream &Out) {
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.
48}
49
50/// addPassesToJITCompile - Add passes to the specified pass manager to
51/// implement a fast dynamic compiler for this target.
52///
53void SkeletonJITInfo::addPassesToJITCompile(FunctionPassManager &PM) {
54 // <insert instruction selector passes here>
55 PM.add(createRegisterAllocator());
56 PM.add(createPrologEpilogCodeInserter());
57}
58