2006-02-05 13:50:24 +08:00
|
|
|
//===-- SparcTargetMachine.h - Define TargetMachine for Sparc ---*- C++ -*-===//
|
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
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();
|
|
|
|
}
|
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
|