blob: 0f8e7fb4d5336c8e2a0fea0845bf6db9d24516d5 [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//
Misha Brukmanf2f8cfb2004-08-17 05:08:44 +000010// This file declares the PowerPC-specific subclass of TargetMachine.
Misha Brukman5dfe3a92004-06-21 16:55:25 +000011//
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"
Nate Begemanca068e82004-08-14 22:16:36 +000018#include "PowerPCJITInfo.h"
Misha Brukman5dfe3a92004-06-21 16:55:25 +000019#include "llvm/Target/TargetMachine.h"
Misha Brukman5dfe3a92004-06-21 16:55:25 +000020#include "llvm/PassManager.h"
Nate Begemaned428532004-09-04 05:00:00 +000021#include <set>
Misha Brukman5dfe3a92004-06-21 16:55:25 +000022
23namespace llvm {
24
Misha Brukmane2eceb52004-07-23 16:08:20 +000025class GlobalValue;
Misha Brukman5dfe3a92004-06-21 16:55:25 +000026class IntrinsicLowering;
27
28class PowerPCTargetMachine : public TargetMachine {
Nate Begemanca068e82004-08-14 22:16:36 +000029 PowerPCFrameInfo FrameInfo;
Misha Brukman5dfe3a92004-06-21 16:55:25 +000030 PowerPCJITInfo JITInfo;
Misha Brukmane2eceb52004-07-23 16:08:20 +000031
Misha Brukman01458812004-08-11 00:11:25 +000032protected:
33 PowerPCTargetMachine(const std::string &name, IntrinsicLowering *IL,
Nate Begemanca068e82004-08-14 22:16:36 +000034 const TargetData &TD, const PowerPCFrameInfo &TFI,
Misha Brukmanf2f8cfb2004-08-17 05:08:44 +000035 const PowerPCJITInfo &TJI);
Misha Brukman5dfe3a92004-06-21 16:55:25 +000036public:
Misha Brukman5dfe3a92004-06-21 16:55:25 +000037 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
Misha Brukman5dfe3a92004-06-21 16:55:25 +000038 virtual TargetJITInfo *getJITInfo() {
39 return &JITInfo;
40 }
41
Misha Brukman01eca8d2004-07-12 23:36:12 +000042 static unsigned getJITMatchQuality();
Nate Begeman7a4fe9b2004-08-11 07:40:04 +000043
44 virtual bool addPassesToEmitAssembly(PassManager &PM, std::ostream &Out);
Nate Begemaned428532004-09-04 05:00:00 +000045
46 // Two shared sets between the instruction selector and the printer allow for
47 // correct linkage on Darwin
48 std::set<GlobalValue*> CalledFunctions;
49 std::set<GlobalValue*> AddressTaken;
Misha Brukman5dfe3a92004-06-21 16:55:25 +000050};
51
52} // end namespace llvm
53
54#endif