blob: eca5f28a80175232b3de25e992f6fa1f1748c188 [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
26class Module;
27
28class SparcTargetMachine : public LLVMTargetMachine {
29 const TargetData DataLayout; // Calculates type size & alignment
30 SparcSubtarget Subtarget;
Dan Gohmanf2b29572008-10-03 16:55:19 +000031 SparcTargetLowering TLInfo;
Dan Gohmanf17a25c2007-07-18 16:29:46 +000032 SparcInstrInfo InstrInfo;
33 TargetFrameInfo FrameInfo;
34
35protected:
36 virtual const TargetAsmInfo *createTargetAsmInfo() const;
37
38public:
39 SparcTargetMachine(const Module &M, const std::string &FS);
40
41 virtual const SparcInstrInfo *getInstrInfo() const { return &InstrInfo; }
42 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
Dan Gohmanb41dfba2008-05-14 01:58:56 +000043 virtual const SparcSubtarget *getSubtargetImpl() const{ return &Subtarget; }
44 virtual const SparcRegisterInfo *getRegisterInfo() const {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000045 return &InstrInfo.getRegisterInfo();
46 }
Dan Gohmanf2b29572008-10-03 16:55:19 +000047 virtual SparcTargetLowering* getTargetLowering() const {
48 return const_cast<SparcTargetLowering*>(&TLInfo);
49 }
Dan Gohmanf17a25c2007-07-18 16:29:46 +000050 virtual const TargetData *getTargetData() const { return &DataLayout; }
51 static unsigned getModuleMatchQuality(const Module &M);
52
53 // Pass Pipeline Configuration
Dan Gohmane34aa772008-03-11 22:29:46 +000054 virtual bool addInstSelector(PassManagerBase &PM, bool Fast);
55 virtual bool addPreEmitPass(PassManagerBase &PM, bool Fast);
56 virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast,
Owen Anderson847b99b2008-08-21 00:14:44 +000057 raw_ostream &Out);
Dan Gohmanf17a25c2007-07-18 16:29:46 +000058};
59
60} // end namespace llvm
61
62#endif