2016-11-02 01:27:54 +08:00
|
|
|
//===-- RISCVTargetMachine.h - Define TargetMachine for RISCV ---*- 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
|
2016-11-02 01:27:54 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// 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
|