SparcTargetMachine.h revision bc641b9d8b5ecafe0137c1a49f4777608981d81b
1//===-- 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"
18#include "llvm/Target/TargetFrameInfo.h"
19#include "llvm/PassManager.h"
20#include "SparcInstrInfo.h"
21#include "SparcSubtarget.h"
22
23namespace llvm {
24
25class Module;
26
27class SparcTargetMachine : public TargetMachine {
28  SparcSubtarget Subtarget;
29  SparcInstrInfo InstrInfo;
30  TargetFrameInfo FrameInfo;
31public:
32  SparcTargetMachine(const Module &M, const std::string &FS);
33
34  virtual const SparcInstrInfo *getInstrInfo() const { return &InstrInfo; }
35  virtual const TargetFrameInfo  *getFrameInfo() const { return &FrameInfo; }
36  virtual const TargetSubtarget  *getSubtargetImpl() const{ return &Subtarget; }
37  virtual const MRegisterInfo *getRegisterInfo() const {
38    return &InstrInfo.getRegisterInfo();
39  }
40
41  static unsigned getModuleMatchQuality(const Module &M);
42
43  virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
44                                   CodeGenFileType FileType, bool Fast);
45};
46
47} // end namespace llvm
48
49#endif
50