blob: d518c2ba72a3fb8994eb2a3cb55661a321608d1a [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
Misha Brukman01458812004-08-11 00:11:25 +000014#ifndef POWERPC_TARGETMACHINE_H
15#define POWERPC_TARGETMACHINE_H
Misha Brukman5dfe3a92004-06-21 16:55:25 +000016
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 Brukman01458812004-08-11 00:11:25 +000034protected:
35 PowerPCTargetMachine(const std::string &name, IntrinsicLowering *IL,
36 const TargetData &TD, const TargetFrameInfo &TFI,
Misha Brukman1d3527e2004-08-11 23:47:08 +000037 const PowerPCJITInfo &TJI, bool is64b);
Misha Brukman5dfe3a92004-06-21 16:55:25 +000038public:
Misha Brukman5dfe3a92004-06-21 16:55:25 +000039 virtual const PowerPCInstrInfo *getInstrInfo() const { return &InstrInfo; }
40 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
41 virtual const MRegisterInfo *getRegisterInfo() const {
42 return &InstrInfo.getRegisterInfo();
43 }
44 virtual TargetJITInfo *getJITInfo() {
45 return &JITInfo;
46 }
47
Misha Brukman01eca8d2004-07-12 23:36:12 +000048 static unsigned getJITMatchQuality();
Nate Begeman7a4fe9b2004-08-11 07:40:04 +000049
50 virtual bool addPassesToEmitAssembly(PassManager &PM, std::ostream &Out);
51
52 // Two shared sets between the instruction selector and the printer allow for
53 // correct linkage on Darwin
54 std::set<GlobalValue*> CalledFunctions;
55 std::set<GlobalValue*> AddressTaken;
Misha Brukman5dfe3a92004-06-21 16:55:25 +000056};
57
58} // end namespace llvm
59
60#endif