blob: 61588e8d5ee03de7e1fa62cbe408606b087bbc9a [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"
22
23namespace llvm {
24
25class Module;
26
27class SparcTargetMachine : public LLVMTargetMachine {
28 const TargetData DataLayout; // Calculates type size & alignment
29 SparcSubtarget Subtarget;
30 SparcInstrInfo InstrInfo;
31 TargetFrameInfo FrameInfo;
32
33protected:
34 virtual const TargetAsmInfo *createTargetAsmInfo() const;
35
36public:
37 SparcTargetMachine(const Module &M, const std::string &FS);
38
39 virtual const SparcInstrInfo *getInstrInfo() const { return &InstrInfo; }
40 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
41 virtual const TargetSubtarget *getSubtargetImpl() const{ return &Subtarget; }
42 virtual const MRegisterInfo *getRegisterInfo() const {
43 return &InstrInfo.getRegisterInfo();
44 }
45 virtual const TargetData *getTargetData() const { return &DataLayout; }
46 static unsigned getModuleMatchQuality(const Module &M);
47
48 // Pass Pipeline Configuration
49 virtual bool addInstSelector(FunctionPassManager &PM, bool Fast);
50 virtual bool addPreEmitPass(FunctionPassManager &PM, bool Fast);
51 virtual bool addAssemblyEmitter(FunctionPassManager &PM, bool Fast,
52 std::ostream &Out);
53};
54
55} // end namespace llvm
56
57#endif