blob: 322c82afbd57ff8b1d38f52f562b583d05e2c1a9 [file] [log] [blame]
Chris Lattner158e1f52006-02-05 05:50:24 +00001//===-- SparcTargetMachine.h - Define TargetMachine for Sparc ---*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattnerf3ebc3f2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Chris Lattner158e1f52006-02-05 05:50:24 +00007//
8//===----------------------------------------------------------------------===//
9//
10// This file declares the Sparc specific subclass of TargetMachine.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef SPARCTARGETMACHINE_H
15#define SPARCTARGETMACHINE_H
16
17#include "llvm/Target/TargetMachine.h"
Owen Anderson8c2c1e92006-05-12 06:33:49 +000018#include "llvm/Target/TargetData.h"
Chris Lattner158e1f52006-02-05 05:50:24 +000019#include "llvm/Target/TargetFrameInfo.h"
Chris Lattner158e1f52006-02-05 05:50:24 +000020#include "SparcInstrInfo.h"
21#include "SparcSubtarget.h"
Dan Gohman2c836cf2008-10-03 16:55:19 +000022#include "SparcISelLowering.h"
Dan Gohmanbb919df2010-05-11 17:31:57 +000023#include "SparcSelectionDAGInfo.h"
Chris Lattner158e1f52006-02-05 05:50:24 +000024
25namespace llvm {
26
Chris Lattner12e97302006-09-04 04:14:57 +000027class SparcTargetMachine : public LLVMTargetMachine {
Chris Lattner158e1f52006-02-05 05:50:24 +000028 SparcSubtarget Subtarget;
Chris Lattner8228b112010-02-04 06:34:01 +000029 const TargetData DataLayout; // Calculates type size & alignment
Dan Gohman2c836cf2008-10-03 16:55:19 +000030 SparcTargetLowering TLInfo;
Dan Gohmanbb919df2010-05-11 17:31:57 +000031 SparcSelectionDAGInfo TSInfo;
Chris Lattner158e1f52006-02-05 05:50:24 +000032 SparcInstrInfo InstrInfo;
33 TargetFrameInfo FrameInfo;
34public:
Daniel Dunbarc3719c32009-08-02 23:37:13 +000035 SparcTargetMachine(const Target &T, const std::string &TT,
Chris Lattner8228b112010-02-04 06:34:01 +000036 const std::string &FS, bool is64bit);
Chris Lattner158e1f52006-02-05 05:50:24 +000037
38 virtual const SparcInstrInfo *getInstrInfo() const { return &InstrInfo; }
39 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
Dan Gohmaneabd6472008-05-14 01:58:56 +000040 virtual const SparcSubtarget *getSubtargetImpl() const{ return &Subtarget; }
41 virtual const SparcRegisterInfo *getRegisterInfo() const {
Chris Lattner158e1f52006-02-05 05:50:24 +000042 return &InstrInfo.getRegisterInfo();
43 }
Dan Gohman21cea8a2010-04-17 15:26:15 +000044 virtual const SparcTargetLowering* getTargetLowering() const {
45 return &TLInfo;
Dan Gohman2c836cf2008-10-03 16:55:19 +000046 }
Dan Gohmanbb919df2010-05-11 17:31:57 +000047 virtual const SparcSelectionDAGInfo* getSelectionDAGInfo() const {
48 return &TSInfo;
49 }
Owen Anderson20a631f2006-05-03 01:29:57 +000050 virtual const TargetData *getTargetData() const { return &DataLayout; }
Chris Lattner158e1f52006-02-05 05:50:24 +000051
Chris Lattner12e97302006-09-04 04:14:57 +000052 // Pass Pipeline Configuration
Bill Wendling026e5d72009-04-29 23:29:43 +000053 virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
54 virtual bool addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
Chris Lattner158e1f52006-02-05 05:50:24 +000055};
56
Chris Lattner8228b112010-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
Chris Lattner158e1f52006-02-05 05:50:24 +000073} // end namespace llvm
74
75#endif