blob: 5c2ec956ee29b043ad9d509842df597c5bb2c09f [file] [log] [blame]
Alex Bradburyb2e54722016-11-01 17:27:54 +00001//===-- RISCVTargetMachine.h - Define TargetMachine for RISCV ---*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file declares the RISCV specific subclass of TargetMachine.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_LIB_TARGET_RISCV_RISCVTARGETMACHINE_H
15#define LLVM_LIB_TARGET_RISCV_RISCVTARGETMACHINE_H
16
Alex Bradbury6b2cca72016-11-01 23:47:30 +000017#include "MCTargetDesc/RISCVMCTargetDesc.h"
Alex Bradburyb2e54722016-11-01 17:27:54 +000018#include "llvm/CodeGen/SelectionDAGTargetInfo.h"
Alex Bradburyb2e54722016-11-01 17:27:54 +000019#include "llvm/IR/DataLayout.h"
Alex Bradbury6b2cca72016-11-01 23:47:30 +000020#include "llvm/Target/TargetMachine.h"
Alex Bradburyb2e54722016-11-01 17:27:54 +000021
22namespace llvm {
23class RISCVTargetMachine : public LLVMTargetMachine {
24 std::unique_ptr<TargetLoweringObjectFile> TLOF;
25
26public:
27 RISCVTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
28 StringRef FS, const TargetOptions &Options,
Rafael Espindola79e238a2017-08-03 02:16:21 +000029 Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM,
30 CodeGenOpt::Level OL, bool JIT);
Alex Bradburyb2e54722016-11-01 17:27:54 +000031
32 TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
33
34 TargetLoweringObjectFile *getObjFileLowering() const override {
35 return TLOF.get();
36 }
37};
Alex Bradburyb2e54722016-11-01 17:27:54 +000038}
39
40#endif