blob: aa6698e2d029f16c7ba7ba64470e04ec9c569f97 [file] [log] [blame]
Misha Brukman5dfe3a92004-06-21 16:55:25 +00001//===-- PowerPCTargetMachine.h - Define TargetMachine for PowerPC -*- C++ -*-=//
2//
3// 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.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file declares the PowerPC specific subclass of TargetMachine.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef POWERPCTARGETMACHINE_H
15#define POWERPCTARGETMACHINE_H
16
17#include "llvm/Target/TargetMachine.h"
18#include "llvm/Target/TargetFrameInfo.h"
19#include "llvm/PassManager.h"
20#include "PowerPCInstrInfo.h"
21#include "PowerPCJITInfo.h"
Misha Brukmane2eceb52004-07-23 16:08:20 +000022#include <set>
Misha Brukman5dfe3a92004-06-21 16:55:25 +000023
24namespace llvm {
25
Misha Brukmane2eceb52004-07-23 16:08:20 +000026class GlobalValue;
Misha Brukman5dfe3a92004-06-21 16:55:25 +000027class IntrinsicLowering;
28
29class PowerPCTargetMachine : public TargetMachine {
30 PowerPCInstrInfo InstrInfo;
31 TargetFrameInfo FrameInfo;
32 PowerPCJITInfo JITInfo;
Misha Brukmane2eceb52004-07-23 16:08:20 +000033
Misha Brukman5dfe3a92004-06-21 16:55:25 +000034public:
35 PowerPCTargetMachine(const Module &M, IntrinsicLowering *IL);
36
37 virtual const PowerPCInstrInfo *getInstrInfo() const { return &InstrInfo; }
38 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
39 virtual const MRegisterInfo *getRegisterInfo() const {
40 return &InstrInfo.getRegisterInfo();
41 }
42 virtual TargetJITInfo *getJITInfo() {
43 return &JITInfo;
44 }
45
46 /// addPassesToEmitMachineCode - Add passes to the specified pass manager to
47 /// get machine code emitted. This uses a MachineCodeEmitter object to handle
48 /// actually outputting the machine code and resolving things like the address
49 /// of functions. This method should returns true if machine code emission is
50 /// not supported.
51 ///
52 virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM,
53 MachineCodeEmitter &MCE);
54
55 virtual bool addPassesToEmitAssembly(PassManager &PM, std::ostream &Out);
Misha Brukman01eca8d2004-07-12 23:36:12 +000056
57 static unsigned getModuleMatchQuality(const Module &M);
58 static unsigned getJITMatchQuality();
Misha Brukmane2eceb52004-07-23 16:08:20 +000059
60 // Two shared sets between the instruction selector and the printer allow for
61 // correct linkage on Darwin
62 std::set<GlobalValue*> CalledFunctions;
63 std::set<GlobalValue*> AddressTaken;
Misha Brukman5dfe3a92004-06-21 16:55:25 +000064};
65
66} // end namespace llvm
67
68#endif