blob: b2cc624e454cbb862c41a49da8d34492c91b2aae [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
Anton Korobeynikov33464912010-11-15 00:06:54 +000017#include "SparcInstrInfo.h"
18#include "SparcISelLowering.h"
Anton Korobeynikov16c29b52011-01-10 12:39:04 +000019#include "SparcFrameLowering.h"
Anton Korobeynikov33464912010-11-15 00:06:54 +000020#include "SparcSelectionDAGInfo.h"
21#include "SparcSubtarget.h"
Brian Gaekee785e532004-02-25 19:28:19 +000022#include "llvm/Target/TargetMachine.h"
Owen Anderson07000c62006-05-12 06:33:49 +000023#include "llvm/Target/TargetData.h"
Anton Korobeynikov16c29b52011-01-10 12:39:04 +000024#include "llvm/Target/TargetFrameLowering.h"
Brian Gaekee785e532004-02-25 19:28:19 +000025
26namespace llvm {
27
Chris Lattner1911fd42006-09-04 04:14:57 +000028class SparcTargetMachine : public LLVMTargetMachine {
Chris Lattner7c90f732006-02-05 05:50:24 +000029 SparcSubtarget Subtarget;
Chris Lattner87c06d62010-02-04 06:34:01 +000030 const TargetData DataLayout; // Calculates type size & alignment
Jakob Stoklund Olesened277f32012-05-04 02:16:39 +000031 SparcInstrInfo InstrInfo;
Dan Gohmanda8ac5f2008-10-03 16:55:19 +000032 SparcTargetLowering TLInfo;
Dan Gohmanff7a5622010-05-11 17:31:57 +000033 SparcSelectionDAGInfo TSInfo;
Anton Korobeynikov16c29b52011-01-10 12:39:04 +000034 SparcFrameLowering FrameLowering;
Brian Gaekee785e532004-02-25 19:28:19 +000035public:
Evan Cheng43966132011-07-19 06:37:02 +000036 SparcTargetMachine(const Target &T, StringRef TT,
Nick Lewycky8a8d4792011-12-02 22:16:29 +000037 StringRef CPU, StringRef FS, const TargetOptions &Options,
Evan Chengb95fc312011-11-16 08:38:26 +000038 Reloc::Model RM, CodeModel::Model CM,
Nick Lewycky8a8d4792011-12-02 22:16:29 +000039 CodeGenOpt::Level OL, bool is64bit);
Brian Gaekee785e532004-02-25 19:28:19 +000040
Chris Lattner7c90f732006-02-05 05:50:24 +000041 virtual const SparcInstrInfo *getInstrInfo() const { return &InstrInfo; }
Anton Korobeynikov16c29b52011-01-10 12:39:04 +000042 virtual const TargetFrameLowering *getFrameLowering() const {
43 return &FrameLowering;
44 }
Dan Gohmanc9f5f3f2008-05-14 01:58:56 +000045 virtual const SparcSubtarget *getSubtargetImpl() const{ return &Subtarget; }
46 virtual const SparcRegisterInfo *getRegisterInfo() const {
Brian Gaekee785e532004-02-25 19:28:19 +000047 return &InstrInfo.getRegisterInfo();
48 }
Dan Gohmand858e902010-04-17 15:26:15 +000049 virtual const SparcTargetLowering* getTargetLowering() const {
50 return &TLInfo;
Dan Gohmanda8ac5f2008-10-03 16:55:19 +000051 }
Dan Gohmanff7a5622010-05-11 17:31:57 +000052 virtual const SparcSelectionDAGInfo* getSelectionDAGInfo() const {
53 return &TSInfo;
54 }
Owen Andersona69571c2006-05-03 01:29:57 +000055 virtual const TargetData *getTargetData() const { return &DataLayout; }
Misha Brukmanb5f662f2005-04-21 23:30:14 +000056
Chris Lattner1911fd42006-09-04 04:14:57 +000057 // Pass Pipeline Configuration
Andrew Trick061efcf2012-02-04 02:56:59 +000058 virtual TargetPassConfig *createPassConfig(PassManagerBase &PM);
Brian Gaekee785e532004-02-25 19:28:19 +000059};
60
Chris Lattner87c06d62010-02-04 06:34:01 +000061/// SparcV8TargetMachine - Sparc 32-bit target machine
62///
63class SparcV8TargetMachine : public SparcTargetMachine {
David Blaikie2d24e2a2011-12-20 02:50:00 +000064 virtual void anchor();
Chris Lattner87c06d62010-02-04 06:34:01 +000065public:
Evan Cheng43966132011-07-19 06:37:02 +000066 SparcV8TargetMachine(const Target &T, StringRef TT,
Evan Cheng34ad6db2011-07-20 07:51:56 +000067 StringRef CPU, StringRef FS,
Nick Lewycky8a8d4792011-12-02 22:16:29 +000068 const TargetOptions &Options,
Evan Chengb95fc312011-11-16 08:38:26 +000069 Reloc::Model RM, CodeModel::Model CM,
70 CodeGenOpt::Level OL);
Chris Lattner87c06d62010-02-04 06:34:01 +000071};
72
73/// SparcV9TargetMachine - Sparc 64-bit target machine
74///
75class SparcV9TargetMachine : public SparcTargetMachine {
David Blaikie2d24e2a2011-12-20 02:50:00 +000076 virtual void anchor();
Chris Lattner87c06d62010-02-04 06:34:01 +000077public:
Evan Cheng43966132011-07-19 06:37:02 +000078 SparcV9TargetMachine(const Target &T, StringRef TT,
Evan Cheng34ad6db2011-07-20 07:51:56 +000079 StringRef CPU, StringRef FS,
Nick Lewycky8a8d4792011-12-02 22:16:29 +000080 const TargetOptions &Options,
Evan Chengb95fc312011-11-16 08:38:26 +000081 Reloc::Model RM, CodeModel::Model CM,
82 CodeGenOpt::Level OL);
Chris Lattner87c06d62010-02-04 06:34:01 +000083};
84
Brian Gaekee785e532004-02-25 19:28:19 +000085} // end namespace llvm
86
87#endif