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 "SparcInstrInfo.h"
|
2008-10-04 00:55:19 +08:00
|
|
|
#include "SparcISelLowering.h"
|
2011-01-10 20:39:04 +08:00
|
|
|
#include "SparcFrameLowering.h"
|
2010-05-12 01:31:57 +08:00
|
|
|
#include "SparcSelectionDAGInfo.h"
|
2010-11-15 08:06:54 +08:00
|
|
|
#include "SparcSubtarget.h"
|
|
|
|
#include "llvm/Target/TargetMachine.h"
|
|
|
|
#include "llvm/Target/TargetData.h"
|
2011-01-10 20:39:04 +08:00
|
|
|
#include "llvm/Target/TargetFrameLowering.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;
|
2011-01-10 20:39:04 +08:00
|
|
|
SparcFrameLowering FrameLowering;
|
2006-02-05 13:50:24 +08:00
|
|
|
public:
|
2011-07-19 14:37:02 +08:00
|
|
|
SparcTargetMachine(const Target &T, StringRef TT,
|
2011-12-03 06:16:29 +08:00
|
|
|
StringRef CPU, StringRef FS, const TargetOptions &Options,
|
2011-11-16 16:38:26 +08:00
|
|
|
Reloc::Model RM, CodeModel::Model CM,
|
2011-12-03 06:16:29 +08:00
|
|
|
CodeGenOpt::Level OL, bool is64bit);
|
2006-02-05 13:50:24 +08:00
|
|
|
|
|
|
|
virtual const SparcInstrInfo *getInstrInfo() const { return &InstrInfo; }
|
2011-01-10 20:39:04 +08:00
|
|
|
virtual const TargetFrameLowering *getFrameLowering() const {
|
|
|
|
return &FrameLowering;
|
|
|
|
}
|
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
|
2012-02-04 10:56:59 +08:00
|
|
|
virtual TargetPassConfig *createPassConfig(PassManagerBase &PM);
|
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 {
|
2011-12-20 10:50:00 +08:00
|
|
|
virtual void anchor();
|
2010-02-04 14:34:01 +08:00
|
|
|
public:
|
2011-07-19 14:37:02 +08:00
|
|
|
SparcV8TargetMachine(const Target &T, StringRef TT,
|
2011-07-20 15:51:56 +08:00
|
|
|
StringRef CPU, StringRef FS,
|
2011-12-03 06:16:29 +08:00
|
|
|
const TargetOptions &Options,
|
2011-11-16 16:38:26 +08:00
|
|
|
Reloc::Model RM, CodeModel::Model CM,
|
|
|
|
CodeGenOpt::Level OL);
|
2010-02-04 14:34:01 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
/// SparcV9TargetMachine - Sparc 64-bit target machine
|
|
|
|
///
|
|
|
|
class SparcV9TargetMachine : public SparcTargetMachine {
|
2011-12-20 10:50:00 +08:00
|
|
|
virtual void anchor();
|
2010-02-04 14:34:01 +08:00
|
|
|
public:
|
2011-07-19 14:37:02 +08:00
|
|
|
SparcV9TargetMachine(const Target &T, StringRef TT,
|
2011-07-20 15:51:56 +08:00
|
|
|
StringRef CPU, StringRef FS,
|
2011-12-03 06:16:29 +08:00
|
|
|
const TargetOptions &Options,
|
2011-11-16 16:38:26 +08:00
|
|
|
Reloc::Model RM, CodeModel::Model CM,
|
|
|
|
CodeGenOpt::Level OL);
|
2010-02-04 14:34:01 +08:00
|
|
|
};
|
|
|
|
|
2006-02-05 13:50:24 +08:00
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|