blob: cce55105e76ed5e0ede585ccf35cb38f361fa8cc [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001//===-- SparcTargetMachine.h - Define TargetMachine for Sparc ---*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner081ce942007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Dan Gohmanf17a25c2007-07-18 16:29:46 +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"
18#include "llvm/Target/TargetData.h"
19#include "llvm/Target/TargetFrameInfo.h"
20#include "SparcInstrInfo.h"
21#include "SparcSubtarget.h"
Dan Gohmanf2b29572008-10-03 16:55:19 +000022#include "SparcISelLowering.h"
Dan Gohmanf17a25c2007-07-18 16:29:46 +000023
24namespace llvm {
25
Dan Gohmanf17a25c2007-07-18 16:29:46 +000026class SparcTargetMachine : public LLVMTargetMachine {
27 const TargetData DataLayout; // Calculates type size & alignment
28 SparcSubtarget Subtarget;
Dan Gohmanf2b29572008-10-03 16:55:19 +000029 SparcTargetLowering TLInfo;
Dan Gohmanf17a25c2007-07-18 16:29:46 +000030 SparcInstrInfo InstrInfo;
31 TargetFrameInfo FrameInfo;
Dan Gohmanf17a25c2007-07-18 16:29:46 +000032public:
Daniel Dunbarf5c2b852009-08-02 23:37:13 +000033 SparcTargetMachine(const Target &T, const std::string &TT,
34 const std::string &FS);
Dan Gohmanf17a25c2007-07-18 16:29:46 +000035
36 virtual const SparcInstrInfo *getInstrInfo() const { return &InstrInfo; }
37 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
Dan Gohmanb41dfba2008-05-14 01:58:56 +000038 virtual const SparcSubtarget *getSubtargetImpl() const{ return &Subtarget; }
39 virtual const SparcRegisterInfo *getRegisterInfo() const {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000040 return &InstrInfo.getRegisterInfo();
41 }
Dan Gohmanf2b29572008-10-03 16:55:19 +000042 virtual SparcTargetLowering* getTargetLowering() const {
43 return const_cast<SparcTargetLowering*>(&TLInfo);
44 }
Dan Gohmanf17a25c2007-07-18 16:29:46 +000045 virtual const TargetData *getTargetData() const { return &DataLayout; }
Dan Gohmanf17a25c2007-07-18 16:29:46 +000046
47 // Pass Pipeline Configuration
Bill Wendling5ed22ac2009-04-29 23:29:43 +000048 virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
49 virtual bool addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
Dan Gohmanf17a25c2007-07-18 16:29:46 +000050};
51
52} // end namespace llvm
53
54#endif