blob: 4b4d2c548c5819145172533e0db77a9f156efd4c [file] [log] [blame]
Misha Brukmand022a5a2004-08-11 00:09:42 +00001//===-- PPC32TargetMachine.h - PowerPC/Darwin TargetMachine ---*- 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/Darwin specific subclass of TargetMachine.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef POWERPC_DARWIN_TARGETMACHINE_H
15#define POWERPC_DARWIN_TARGETMACHINE_H
16
17#include "llvm/Target/TargetMachine.h"
18#include "llvm/Target/TargetFrameInfo.h"
19#include "llvm/PassManager.h"
20#include "PowerPCTargetMachine.h"
21#include <set>
22
23namespace llvm {
24
25class GlobalValue;
26class IntrinsicLowering;
27
28class PPC32TargetMachine : public PowerPCTargetMachine {
29public:
30 PPC32TargetMachine(const Module &M, IntrinsicLowering *IL);
31
32 /// addPassesToEmitMachineCode - Add passes to the specified pass manager to
33 /// get machine code emitted. This uses a MachineCodeEmitter object to handle
34 /// actually outputting the machine code and resolving things like the address
35 /// of functions. This method should returns true if machine code emission is
36 /// not supported.
37 ///
38 virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM,
39 MachineCodeEmitter &MCE);
40
41 virtual bool addPassesToEmitAssembly(PassManager &PM, std::ostream &Out);
42
43 static unsigned getModuleMatchQuality(const Module &M);
44
45 // Two shared sets between the instruction selector and the printer allow for
46 // correct linkage on Darwin
47 std::set<GlobalValue*> CalledFunctions;
48 std::set<GlobalValue*> AddressTaken;
49};
50
51} // end namespace llvm
52
53#endif