blob: 322c82afbd57ff8b1d38f52f562b583d05e2c1a9 [file] [log] [blame]
Chris Lattner7c90f732006-02-05 05:50:24 +00001//===-- SparcTargetMachine.h - Define TargetMachine for Sparc ---*- C++ -*-===//
Misha Brukmanb5f662f2005-04-21 23:30:14 +00002//
Brian Gaekee785e532004-02-25 19:28:19 +00003// The LLVM Compiler Infrastructure
4//
Chris Lattner4ee451d2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Misha Brukmanb5f662f2005-04-21 23:30:14 +00007//
Brian Gaekee785e532004-02-25 19:28:19 +00008//===----------------------------------------------------------------------===//
Misha Brukmanb5f662f2005-04-21 23:30:14 +00009//
Chris Lattner7c90f732006-02-05 05:50:24 +000010// This file declares the Sparc specific subclass of TargetMachine.
Brian Gaekee785e532004-02-25 19:28:19 +000011//
12//===----------------------------------------------------------------------===//
13
Chris Lattner7c90f732006-02-05 05:50:24 +000014#ifndef SPARCTARGETMACHINE_H
15#define SPARCTARGETMACHINE_H
Brian Gaekee785e532004-02-25 19:28:19 +000016
17#include "llvm/Target/TargetMachine.h"
Owen Anderson07000c62006-05-12 06:33:49 +000018#include "llvm/Target/TargetData.h"
Brian Gaekee785e532004-02-25 19:28:19 +000019#include "llvm/Target/TargetFrameInfo.h"
Chris Lattner7c90f732006-02-05 05:50:24 +000020#include "SparcInstrInfo.h"
21#include "SparcSubtarget.h"
Dan Gohmanda8ac5f2008-10-03 16:55:19 +000022#include "SparcISelLowering.h"
Dan Gohmanff7a5622010-05-11 17:31:57 +000023#include "SparcSelectionDAGInfo.h"
Brian Gaekee785e532004-02-25 19:28:19 +000024
25namespace llvm {
26
Chris Lattner1911fd42006-09-04 04:14:57 +000027class SparcTargetMachine : public LLVMTargetMachine {
Chris Lattner7c90f732006-02-05 05:50:24 +000028 SparcSubtarget Subtarget;
Chris Lattner87c06d62010-02-04 06:34:01 +000029 const TargetData DataLayout; // Calculates type size & alignment
Dan Gohmanda8ac5f2008-10-03 16:55:19 +000030 SparcTargetLowering TLInfo;
Dan Gohmanff7a5622010-05-11 17:31:57 +000031 SparcSelectionDAGInfo TSInfo;
Chris Lattner7c90f732006-02-05 05:50:24 +000032 SparcInstrInfo InstrInfo;
Brian Gaekee785e532004-02-25 19:28:19 +000033 TargetFrameInfo FrameInfo;
Brian Gaekee785e532004-02-25 19:28:19 +000034public:
Daniel Dunbare28039c2009-08-02 23:37:13 +000035 SparcTargetMachine(const Target &T, const std::string &TT,
Chris Lattner87c06d62010-02-04 06:34:01 +000036 const std::string &FS, bool is64bit);
Brian Gaekee785e532004-02-25 19:28:19 +000037
Chris Lattner7c90f732006-02-05 05:50:24 +000038 virtual const SparcInstrInfo *getInstrInfo() const { return &InstrInfo; }
Chris Lattner143e0ea2004-06-02 05:47:26 +000039 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
Dan Gohmanc9f5f3f2008-05-14 01:58:56 +000040 virtual const SparcSubtarget *getSubtargetImpl() const{ return &Subtarget; }
41 virtual const SparcRegisterInfo *getRegisterInfo() const {
Brian Gaekee785e532004-02-25 19:28:19 +000042 return &InstrInfo.getRegisterInfo();
43 }
Dan Gohmand858e902010-04-17 15:26:15 +000044 virtual const SparcTargetLowering* getTargetLowering() const {
45 return &TLInfo;
Dan Gohmanda8ac5f2008-10-03 16:55:19 +000046 }
Dan Gohmanff7a5622010-05-11 17:31:57 +000047 virtual const SparcSelectionDAGInfo* getSelectionDAGInfo() const {
48 return &TSInfo;
49 }
Owen Andersona69571c2006-05-03 01:29:57 +000050 virtual const TargetData *getTargetData() const { return &DataLayout; }
Misha Brukmanb5f662f2005-04-21 23:30:14 +000051
Chris Lattner1911fd42006-09-04 04:14:57 +000052 // Pass Pipeline Configuration
Bill Wendling98a366d2009-04-29 23:29:43 +000053 virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
54 virtual bool addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
Brian Gaekee785e532004-02-25 19:28:19 +000055};
56
Chris Lattner87c06d62010-02-04 06:34:01 +000057/// SparcV8TargetMachine - Sparc 32-bit target machine
58///
59class SparcV8TargetMachine : public SparcTargetMachine {
60public:
61 SparcV8TargetMachine(const Target &T, const std::string &TT,
62 const std::string &FS);
63};
64
65/// SparcV9TargetMachine - Sparc 64-bit target machine
66///
67class SparcV9TargetMachine : public SparcTargetMachine {
68public:
69 SparcV9TargetMachine(const Target &T, const std::string &TT,
70 const std::string &FS);
71};
72
Brian Gaekee785e532004-02-25 19:28:19 +000073} // end namespace llvm
74
75#endif