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.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-14 00:26:38 +08:00
|
|
|
#ifndef LLVM_LIB_TARGET_SPARC_SPARCTARGETMACHINE_H
|
|
|
|
#define LLVM_LIB_TARGET_SPARC_SPARCTARGETMACHINE_H
|
2006-02-05 13:50:24 +08:00
|
|
|
|
2012-12-04 15:12:27 +08:00
|
|
|
#include "SparcInstrInfo.h"
|
2010-11-15 08:06:54 +08:00
|
|
|
#include "SparcSubtarget.h"
|
2012-12-04 15:12:27 +08:00
|
|
|
#include "llvm/Target/TargetMachine.h"
|
2006-02-05 13:50:24 +08:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
2017-10-13 06:57:28 +08:00
|
|
|
class SparcTargetMachine : public LLVMTargetMachine {
|
2014-11-13 17:26:31 +08:00
|
|
|
std::unique_ptr<TargetLoweringObjectFile> TLOF;
|
2016-05-23 18:56:36 +08:00
|
|
|
SparcSubtarget Subtarget;
|
2016-05-18 17:14:13 +08:00
|
|
|
bool is64Bit;
|
|
|
|
mutable StringMap<std::unique_ptr<SparcSubtarget>> SubtargetMap;
|
2006-02-05 13:50:24 +08:00
|
|
|
public:
|
2015-06-12 03:41:26 +08:00
|
|
|
SparcTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
|
|
|
|
StringRef FS, const TargetOptions &Options,
|
2017-08-03 10:16:21 +08:00
|
|
|
Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM,
|
|
|
|
CodeGenOpt::Level OL, bool JIT, bool is64bit);
|
2014-11-21 07:37:18 +08:00
|
|
|
~SparcTargetMachine() override;
|
2006-02-05 13:50:24 +08:00
|
|
|
|
2016-05-23 18:56:36 +08:00
|
|
|
const SparcSubtarget *getSubtargetImpl() const { return &Subtarget; }
|
2016-05-18 17:14:13 +08:00
|
|
|
const SparcSubtarget *getSubtargetImpl(const Function &) const override;
|
2014-08-06 06:10:21 +08:00
|
|
|
|
2006-09-04 12:14:57 +08:00
|
|
|
// Pass Pipeline Configuration
|
2014-04-29 15:57:13 +08:00
|
|
|
TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
|
2014-11-13 17:26:31 +08:00
|
|
|
TargetLoweringObjectFile *getObjFileLowering() const override {
|
|
|
|
return TLOF.get();
|
|
|
|
}
|
2017-06-01 02:41:23 +08:00
|
|
|
|
|
|
|
bool isMachineVerifierClean() const override {
|
|
|
|
return false;
|
|
|
|
}
|
2006-02-05 13:50:24 +08:00
|
|
|
};
|
|
|
|
|
2016-05-19 00:00:24 +08:00
|
|
|
/// Sparc 32-bit target machine
|
2010-02-04 14:34:01 +08:00
|
|
|
///
|
|
|
|
class SparcV8TargetMachine : public SparcTargetMachine {
|
2011-12-20 10:50:00 +08:00
|
|
|
virtual void anchor();
|
2010-02-04 14:34:01 +08:00
|
|
|
public:
|
2015-06-12 03:41:26 +08:00
|
|
|
SparcV8TargetMachine(const Target &T, const Triple &TT, StringRef CPU,
|
|
|
|
StringRef FS, const TargetOptions &Options,
|
2017-08-03 10:16:21 +08:00
|
|
|
Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM,
|
|
|
|
CodeGenOpt::Level OL, bool JIT);
|
2010-02-04 14:34:01 +08:00
|
|
|
};
|
|
|
|
|
2016-05-19 00:00:24 +08:00
|
|
|
/// Sparc 64-bit target machine
|
2010-02-04 14:34:01 +08:00
|
|
|
///
|
|
|
|
class SparcV9TargetMachine : public SparcTargetMachine {
|
2011-12-20 10:50:00 +08:00
|
|
|
virtual void anchor();
|
2010-02-04 14:34:01 +08:00
|
|
|
public:
|
2015-06-12 03:41:26 +08:00
|
|
|
SparcV9TargetMachine(const Target &T, const Triple &TT, StringRef CPU,
|
2015-04-30 04:30:57 +08:00
|
|
|
StringRef FS, const TargetOptions &Options,
|
2017-08-03 10:16:21 +08:00
|
|
|
Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM,
|
|
|
|
CodeGenOpt::Level OL, bool JIT);
|
2015-04-30 04:30:57 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class SparcelTargetMachine : public SparcTargetMachine {
|
|
|
|
virtual void anchor();
|
|
|
|
|
|
|
|
public:
|
2015-06-12 03:41:26 +08:00
|
|
|
SparcelTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
|
2015-04-30 04:30:57 +08:00
|
|
|
StringRef FS, const TargetOptions &Options,
|
2017-08-03 10:16:21 +08:00
|
|
|
Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM,
|
|
|
|
CodeGenOpt::Level OL, bool JIT);
|
2010-02-04 14:34:01 +08:00
|
|
|
};
|
|
|
|
|
2006-02-05 13:50:24 +08:00
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|