2016-11-02 01:27:54 +08:00
|
|
|
//===-- RISCVTargetMachine.h - Define TargetMachine for RISCV ---*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file declares the RISCV specific subclass of TargetMachine.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_LIB_TARGET_RISCV_RISCVTARGETMACHINE_H
|
|
|
|
#define LLVM_LIB_TARGET_RISCV_RISCVTARGETMACHINE_H
|
|
|
|
|
2016-11-02 07:47:30 +08:00
|
|
|
#include "MCTargetDesc/RISCVMCTargetDesc.h"
|
2017-10-20 05:37:38 +08:00
|
|
|
#include "RISCVSubtarget.h"
|
2016-11-02 01:27:54 +08:00
|
|
|
#include "llvm/CodeGen/SelectionDAGTargetInfo.h"
|
|
|
|
#include "llvm/IR/DataLayout.h"
|
2016-11-02 07:47:30 +08:00
|
|
|
#include "llvm/Target/TargetMachine.h"
|
2016-11-02 01:27:54 +08:00
|
|
|
|
|
|
|
namespace llvm {
|
2017-10-13 06:57:28 +08:00
|
|
|
class RISCVTargetMachine : public LLVMTargetMachine {
|
2016-11-02 01:27:54 +08:00
|
|
|
std::unique_ptr<TargetLoweringObjectFile> TLOF;
|
2017-10-20 05:37:38 +08:00
|
|
|
RISCVSubtarget Subtarget;
|
2016-11-02 01:27:54 +08:00
|
|
|
|
|
|
|
public:
|
|
|
|
RISCVTargetMachine(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);
|
2016-11-02 01:27:54 +08:00
|
|
|
|
2017-10-20 05:37:38 +08:00
|
|
|
const RISCVSubtarget *getSubtargetImpl(const Function &) const override {
|
|
|
|
return &Subtarget;
|
|
|
|
}
|
|
|
|
|
2016-11-02 01:27:54 +08:00
|
|
|
TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
|
|
|
|
|
|
|
|
TargetLoweringObjectFile *getObjFileLowering() const override {
|
|
|
|
return TLOF.get();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|