2006-02-05 05:50:24 +00:00
|
|
|
//===-- SparcTargetMachine.h - Define TargetMachine for Sparc ---*- C++ -*-===//
|
2005-04-21 23:30:14 +00:00
|
|
|
//
|
2004-02-25 19:28:19 +00:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file was developed by the LLVM research group and is distributed under
|
|
|
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
2005-04-21 23:30:14 +00:00
|
|
|
//
|
2004-02-25 19:28:19 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
2005-04-21 23:30:14 +00:00
|
|
|
//
|
2006-02-05 05:50:24 +00:00
|
|
|
// This file declares the Sparc specific subclass of TargetMachine.
|
2004-02-25 19:28:19 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2006-02-05 05:50:24 +00:00
|
|
|
#ifndef SPARCTARGETMACHINE_H
|
|
|
|
#define SPARCTARGETMACHINE_H
|
2004-02-25 19:28:19 +00:00
|
|
|
|
|
|
|
#include "llvm/Target/TargetMachine.h"
|
2006-05-12 06:33:49 +00:00
|
|
|
#include "llvm/Target/TargetData.h"
|
2004-02-25 19:28:19 +00:00
|
|
|
#include "llvm/Target/TargetFrameInfo.h"
|
2006-02-05 05:50:24 +00:00
|
|
|
#include "SparcInstrInfo.h"
|
|
|
|
#include "SparcSubtarget.h"
|
2006-09-07 22:06:40 +00:00
|
|
|
#include "SparcTargetAsmInfo.h"
|
2004-02-25 19:28:19 +00:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
2004-10-09 05:57:01 +00:00
|
|
|
class Module;
|
2004-02-25 19:28:19 +00:00
|
|
|
|
2006-09-04 04:14:57 +00:00
|
|
|
class SparcTargetMachine : public LLVMTargetMachine {
|
2006-05-03 01:29:57 +00:00
|
|
|
const TargetData DataLayout; // Calculates type size & alignment
|
2006-02-05 05:50:24 +00:00
|
|
|
SparcSubtarget Subtarget;
|
|
|
|
SparcInstrInfo InstrInfo;
|
2004-02-25 19:28:19 +00:00
|
|
|
TargetFrameInfo FrameInfo;
|
|
|
|
public:
|
2006-03-23 05:43:16 +00:00
|
|
|
SparcTargetMachine(const Module &M, const std::string &FS);
|
2004-02-25 19:28:19 +00:00
|
|
|
|
2006-02-05 05:50:24 +00:00
|
|
|
virtual const SparcInstrInfo *getInstrInfo() const { return &InstrInfo; }
|
2004-06-02 05:47:26 +00:00
|
|
|
virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
|
2006-01-26 06:51:21 +00:00
|
|
|
virtual const TargetSubtarget *getSubtargetImpl() const{ return &Subtarget; }
|
2004-02-25 19:28:19 +00:00
|
|
|
virtual const MRegisterInfo *getRegisterInfo() const {
|
|
|
|
return &InstrInfo.getRegisterInfo();
|
|
|
|
}
|
2006-05-03 01:29:57 +00:00
|
|
|
virtual const TargetData *getTargetData() const { return &DataLayout; }
|
2004-10-09 05:57:01 +00:00
|
|
|
static unsigned getModuleMatchQuality(const Module &M);
|
2005-04-21 23:30:14 +00:00
|
|
|
|
2006-09-07 22:06:40 +00:00
|
|
|
virtual const TargetAsmInfo *createTargetAsmInfo() const {
|
|
|
|
return static_cast<const TargetAsmInfo *>(new SparcTargetAsmInfo(*this));
|
|
|
|
}
|
2006-09-04 04:14:57 +00:00
|
|
|
|
|
|
|
// Pass Pipeline Configuration
|
|
|
|
virtual bool addInstSelector(FunctionPassManager &PM, bool Fast);
|
|
|
|
virtual bool addPreEmitPass(FunctionPassManager &PM, bool Fast);
|
|
|
|
virtual bool addAssemblyEmitter(FunctionPassManager &PM, bool Fast,
|
|
|
|
std::ostream &Out);
|
2004-02-25 19:28:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|