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
|
|
|
|
//
|
2007-12-29 20:36:04 +00:00
|
|
|
// This file 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"
|
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;
|
2006-09-07 23:39:26 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual const TargetAsmInfo *createTargetAsmInfo() const;
|
|
|
|
|
2004-02-25 19:28:19 +00:00
|
|
|
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; }
|
2008-05-14 01:58:56 +00:00
|
|
|
virtual const SparcSubtarget *getSubtargetImpl() const{ return &Subtarget; }
|
|
|
|
virtual const SparcRegisterInfo *getRegisterInfo() const {
|
2004-02-25 19:28:19 +00:00
|
|
|
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-04 04:14:57 +00:00
|
|
|
// Pass Pipeline Configuration
|
2008-03-11 22:29:46 +00:00
|
|
|
virtual bool addInstSelector(PassManagerBase &PM, bool Fast);
|
|
|
|
virtual bool addPreEmitPass(PassManagerBase &PM, bool Fast);
|
|
|
|
virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast,
|
2006-09-04 04:14:57 +00:00
|
|
|
std::ostream &Out);
|
2004-02-25 19:28:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|