1 //===-- SparcTargetMachine.h - Define TargetMachine for Sparc ---*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
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.
8 //===----------------------------------------------------------------------===//
10 // This file declares the Sparc specific subclass of TargetMachine.
12 //===----------------------------------------------------------------------===//
14 #ifndef SPARCTARGETMACHINE_H
15 #define SPARCTARGETMACHINE_H
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"
27 class SparcTargetMachine : public LLVMTargetMachine {
28 const TargetData DataLayout; // Calculates type size & alignment
29 SparcSubtarget Subtarget;
30 SparcInstrInfo InstrInfo;
31 TargetFrameInfo FrameInfo;
34 virtual const TargetAsmInfo *createTargetAsmInfo() const;
37 SparcTargetMachine(const Module &M, const std::string &FS);
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();
45 virtual const TargetData *getTargetData() const { return &DataLayout; }
46 static unsigned getModuleMatchQuality(const Module &M);
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,
55 } // end namespace llvm