blob: 1367a311296402c47d9791bad8027ac1b9ba7303 [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"
Chris Lattner158e1f52006-02-05 05:50:24 +000023
24namespace llvm {
25
Chris Lattner12e97302006-09-04 04:14:57 +000026class SparcTargetMachine : public LLVMTargetMachine {
Chris Lattner158e1f52006-02-05 05:50:24 +000027 SparcSubtarget Subtarget;
Chris Lattner8228b112010-02-04 06:34:01 +000028 const TargetData DataLayout; // Calculates type size & alignment
Dan Gohman2c836cf2008-10-03 16:55:19 +000029 SparcTargetLowering TLInfo;
Chris Lattner158e1f52006-02-05 05:50:24 +000030 SparcInstrInfo InstrInfo;
31 TargetFrameInfo FrameInfo;
32public:
Daniel Dunbarc3719c32009-08-02 23:37:13 +000033 SparcTargetMachine(const Target &T, const std::string &TT,
Chris Lattner8228b112010-02-04 06:34:01 +000034 const std::string &FS, bool is64bit);
Chris Lattner158e1f52006-02-05 05:50:24 +000035
36 virtual const SparcInstrInfo *getInstrInfo() const { return &InstrInfo; }
37 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
Dan Gohmaneabd6472008-05-14 01:58:56 +000038 virtual const SparcSubtarget *getSubtargetImpl() const{ return &Subtarget; }
39 virtual const SparcRegisterInfo *getRegisterInfo() const {
Chris Lattner158e1f52006-02-05 05:50:24 +000040 return &InstrInfo.getRegisterInfo();
41 }
Dan Gohman21cea8a2010-04-17 15:26:15 +000042 virtual const SparcTargetLowering* getTargetLowering() const {
43 return &TLInfo;
Dan Gohman2c836cf2008-10-03 16:55:19 +000044 }
Owen Anderson20a631f2006-05-03 01:29:57 +000045 virtual const TargetData *getTargetData() const { return &DataLayout; }
Chris Lattner158e1f52006-02-05 05:50:24 +000046
Chris Lattner12e97302006-09-04 04:14:57 +000047 // Pass Pipeline Configuration
Bill Wendling026e5d72009-04-29 23:29:43 +000048 virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
49 virtual bool addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
Chris Lattner158e1f52006-02-05 05:50:24 +000050};
51
Chris Lattner8228b112010-02-04 06:34:01 +000052/// SparcV8TargetMachine - Sparc 32-bit target machine
53///
54class SparcV8TargetMachine : public SparcTargetMachine {
55public:
56 SparcV8TargetMachine(const Target &T, const std::string &TT,
57 const std::string &FS);
58};
59
60/// SparcV9TargetMachine - Sparc 64-bit target machine
61///
62class SparcV9TargetMachine : public SparcTargetMachine {
63public:
64 SparcV9TargetMachine(const Target &T, const std::string &TT,
65 const std::string &FS);
66};
67
Chris Lattner158e1f52006-02-05 05:50:24 +000068} // end namespace llvm
69
70#endif