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"
|
2008-10-03 16:55:19 +00:00
|
|
|
#include "SparcISelLowering.h"
|
2004-02-25 19:28:19 +00:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
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;
|
2008-10-03 16:55:19 +00:00
|
|
|
SparcTargetLowering TLInfo;
|
2006-02-05 05:50:24 +00:00
|
|
|
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:
|
2009-08-02 23:37:13 +00:00
|
|
|
SparcTargetMachine(const Target &T, const std::string &TT,
|
|
|
|
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();
|
|
|
|
}
|
2008-10-03 16:55:19 +00:00
|
|
|
virtual SparcTargetLowering* getTargetLowering() const {
|
|
|
|
return const_cast<SparcTargetLowering*>(&TLInfo);
|
|
|
|
}
|
2006-05-03 01:29:57 +00:00
|
|
|
virtual const TargetData *getTargetData() const { return &DataLayout; }
|
2005-04-21 23:30:14 +00:00
|
|
|
|
2006-09-04 04:14:57 +00:00
|
|
|
// Pass Pipeline Configuration
|
2009-04-29 23:29:43 +00:00
|
|
|
virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
|
|
|
|
virtual bool addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
|
2004-02-25 19:28:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|