2006-02-05 13:50:24 +08:00
|
|
|
//===-- SparcTargetMachine.h - Define TargetMachine for Sparc ---*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-30 04:36:04 +08:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2006-02-05 13:50:24 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file declares the Sparc specific subclass of TargetMachine.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef SPARCTARGETMACHINE_H
|
|
|
|
#define SPARCTARGETMACHINE_H
|
|
|
|
|
|
|
|
#include "llvm/Target/TargetMachine.h"
|
2006-05-12 14:33:49 +08:00
|
|
|
#include "llvm/Target/TargetData.h"
|
2006-02-05 13:50:24 +08:00
|
|
|
#include "llvm/Target/TargetFrameInfo.h"
|
|
|
|
#include "SparcInstrInfo.h"
|
|
|
|
#include "SparcSubtarget.h"
|
2008-10-04 00:55:19 +08:00
|
|
|
#include "SparcISelLowering.h"
|
2010-05-12 01:31:57 +08:00
|
|
|
#include "SparcSelectionDAGInfo.h"
|
2006-02-05 13:50:24 +08:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
2006-09-04 12:14:57 +08:00
|
|
|
class SparcTargetMachine : public LLVMTargetMachine {
|
2006-02-05 13:50:24 +08:00
|
|
|
SparcSubtarget Subtarget;
|
2010-02-04 14:34:01 +08:00
|
|
|
const TargetData DataLayout; // Calculates type size & alignment
|
2008-10-04 00:55:19 +08:00
|
|
|
SparcTargetLowering TLInfo;
|
2010-05-12 01:31:57 +08:00
|
|
|
SparcSelectionDAGInfo TSInfo;
|
2006-02-05 13:50:24 +08:00
|
|
|
SparcInstrInfo InstrInfo;
|
|
|
|
TargetFrameInfo FrameInfo;
|
|
|
|
public:
|
2009-08-03 07:37:13 +08:00
|
|
|
SparcTargetMachine(const Target &T, const std::string &TT,
|
2010-02-04 14:34:01 +08:00
|
|
|
const std::string &FS, bool is64bit);
|
2006-02-05 13:50:24 +08:00
|
|
|
|
|
|
|
virtual const SparcInstrInfo *getInstrInfo() const { return &InstrInfo; }
|
|
|
|
virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
|
2008-05-14 09:58:56 +08:00
|
|
|
virtual const SparcSubtarget *getSubtargetImpl() const{ return &Subtarget; }
|
|
|
|
virtual const SparcRegisterInfo *getRegisterInfo() const {
|
2006-02-05 13:50:24 +08:00
|
|
|
return &InstrInfo.getRegisterInfo();
|
|
|
|
}
|
2010-04-17 23:26:15 +08:00
|
|
|
virtual const SparcTargetLowering* getTargetLowering() const {
|
|
|
|
return &TLInfo;
|
2008-10-04 00:55:19 +08:00
|
|
|
}
|
2010-05-12 01:31:57 +08:00
|
|
|
virtual const SparcSelectionDAGInfo* getSelectionDAGInfo() const {
|
|
|
|
return &TSInfo;
|
|
|
|
}
|
2006-05-03 09:29:57 +08:00
|
|
|
virtual const TargetData *getTargetData() const { return &DataLayout; }
|
2006-02-05 13:50:24 +08:00
|
|
|
|
2006-09-04 12:14:57 +08:00
|
|
|
// Pass Pipeline Configuration
|
2009-04-30 07:29:43 +08:00
|
|
|
virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
|
|
|
|
virtual bool addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
|
2006-02-05 13:50:24 +08:00
|
|
|
};
|
|
|
|
|
2010-02-04 14:34:01 +08:00
|
|
|
/// SparcV8TargetMachine - Sparc 32-bit target machine
|
|
|
|
///
|
|
|
|
class SparcV8TargetMachine : public SparcTargetMachine {
|
|
|
|
public:
|
|
|
|
SparcV8TargetMachine(const Target &T, const std::string &TT,
|
|
|
|
const std::string &FS);
|
|
|
|
};
|
|
|
|
|
|
|
|
/// SparcV9TargetMachine - Sparc 64-bit target machine
|
|
|
|
///
|
|
|
|
class SparcV9TargetMachine : public SparcTargetMachine {
|
|
|
|
public:
|
|
|
|
SparcV9TargetMachine(const Target &T, const std::string &TT,
|
|
|
|
const std::string &FS);
|
|
|
|
};
|
|
|
|
|
2006-02-05 13:50:24 +08:00
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|