blob: 1f56c08c6ddc20b8f3bc745dffb394b53e8650ee [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
Nate Begemanca068e82004-08-14 22:16:36 +000017#include "PowerPCFrameInfo.h"
18#include "PowerPCInstrInfo.h"
19#include "PowerPCJITInfo.h"
Misha Brukman5dfe3a92004-06-21 16:55:25 +000020#include "llvm/Target/TargetMachine.h"
21#include "llvm/Target/TargetFrameInfo.h"
22#include "llvm/PassManager.h"
Misha Brukmane2eceb52004-07-23 16:08:20 +000023#include <set>
Misha Brukman5dfe3a92004-06-21 16:55:25 +000024
25namespace llvm {
26
Misha Brukmane2eceb52004-07-23 16:08:20 +000027class GlobalValue;
Misha Brukman5dfe3a92004-06-21 16:55:25 +000028class IntrinsicLowering;
29
30class PowerPCTargetMachine : public TargetMachine {
31 PowerPCInstrInfo InstrInfo;
Nate Begemanca068e82004-08-14 22:16:36 +000032 PowerPCFrameInfo FrameInfo;
Misha Brukman5dfe3a92004-06-21 16:55:25 +000033 PowerPCJITInfo JITInfo;
Misha Brukmane2eceb52004-07-23 16:08:20 +000034
Misha Brukman01458812004-08-11 00:11:25 +000035protected:
36 PowerPCTargetMachine(const std::string &name, IntrinsicLowering *IL,
Nate Begemanca068e82004-08-14 22:16:36 +000037 const TargetData &TD, const PowerPCFrameInfo &TFI,
Misha Brukman1d3527e2004-08-11 23:47:08 +000038 const PowerPCJITInfo &TJI, bool is64b);
Misha Brukman5dfe3a92004-06-21 16:55:25 +000039public:
Misha Brukman5dfe3a92004-06-21 16:55:25 +000040 virtual const PowerPCInstrInfo *getInstrInfo() const { return &InstrInfo; }
41 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
42 virtual const MRegisterInfo *getRegisterInfo() const {
43 return &InstrInfo.getRegisterInfo();
44 }
45 virtual TargetJITInfo *getJITInfo() {
46 return &JITInfo;
47 }
48
Misha Brukman01eca8d2004-07-12 23:36:12 +000049 static unsigned getJITMatchQuality();
Nate Begeman7a4fe9b2004-08-11 07:40:04 +000050
51 virtual bool addPassesToEmitAssembly(PassManager &PM, std::ostream &Out);
52
53 // Two shared sets between the instruction selector and the printer allow for
54 // correct linkage on Darwin
55 std::set<GlobalValue*> CalledFunctions;
56 std::set<GlobalValue*> AddressTaken;
Misha Brukman5dfe3a92004-06-21 16:55:25 +000057};
58
59} // end namespace llvm
60
61#endif