blob: e377afa085314e26ed0700bbd2cbb754b5526947 [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//
5// This file was developed by the LLVM research group and is distributed under
6// the University of Illinois Open Source License. See LICENSE.TXT for details.
7//
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"
22
23namespace llvm {
24
Chris Lattner158e1f52006-02-05 05:50:24 +000025class Module;
26
Chris Lattner12e97302006-09-04 04:14:57 +000027class SparcTargetMachine : public LLVMTargetMachine {
Owen Anderson20a631f2006-05-03 01:29:57 +000028 const TargetData DataLayout; // Calculates type size & alignment
Chris Lattner158e1f52006-02-05 05:50:24 +000029 SparcSubtarget Subtarget;
30 SparcInstrInfo InstrInfo;
31 TargetFrameInfo FrameInfo;
32public:
Chris Lattner6f95ab72006-03-23 05:43:16 +000033 SparcTargetMachine(const Module &M, const std::string &FS);
Chris Lattner158e1f52006-02-05 05:50:24 +000034
35 virtual const SparcInstrInfo *getInstrInfo() const { return &InstrInfo; }
36 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
37 virtual const TargetSubtarget *getSubtargetImpl() const{ return &Subtarget; }
38 virtual const MRegisterInfo *getRegisterInfo() const {
39 return &InstrInfo.getRegisterInfo();
40 }
Owen Anderson20a631f2006-05-03 01:29:57 +000041 virtual const TargetData *getTargetData() const { return &DataLayout; }
Chris Lattner158e1f52006-02-05 05:50:24 +000042 static unsigned getModuleMatchQuality(const Module &M);
43
Chris Lattner12e97302006-09-04 04:14:57 +000044
45 // Pass Pipeline Configuration
46 virtual bool addInstSelector(FunctionPassManager &PM, bool Fast);
47 virtual bool addPreEmitPass(FunctionPassManager &PM, bool Fast);
48 virtual bool addAssemblyEmitter(FunctionPassManager &PM, bool Fast,
49 std::ostream &Out);
Chris Lattner158e1f52006-02-05 05:50:24 +000050};
51
52} // end namespace llvm
53
54#endif