blob: 1ebfb397383e7b80cb010a7092e8a81c2f7821d6 [file] [log] [blame]
Nikolai Bozhenov82f08012017-05-29 09:48:30 +00001//===-- Nios2TargetMachine.h - Define TargetMachine for Nios2 ---*- 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 Nios2 specific subclass of TargetMachine.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_LIB_TARGET_NIOS2_NIOS2TARGETMACHINE_H
15#define LLVM_LIB_TARGET_NIOS2_NIOS2TARGETMACHINE_H
16
Nikolai Bozhenovebbde142017-09-19 11:54:29 +000017#include "Nios2Subtarget.h"
Nikolai Bozhenov82f08012017-05-29 09:48:30 +000018#include "llvm/Target/TargetMachine.h"
19
20namespace llvm {
Matthias Braunbb8507e2017-10-12 22:57:28 +000021class Nios2TargetMachine : public LLVMTargetMachine {
Nikolai Bozhenovebbde142017-09-19 11:54:29 +000022 mutable StringMap<std::unique_ptr<Nios2Subtarget>> SubtargetMap;
Nikolai Bozhenov1cf9c542017-12-07 12:35:02 +000023 std::unique_ptr<TargetLoweringObjectFile> TLOF;
24 Nios2Subtarget Subtarget;
Nikolai Bozhenovebbde142017-09-19 11:54:29 +000025
Nikolai Bozhenov82f08012017-05-29 09:48:30 +000026public:
27 Nios2TargetMachine(const Target &T, const Triple &TT, StringRef CPU,
28 StringRef FS, const TargetOptions &Options,
Nikolai Bozhenovebbde142017-09-19 11:54:29 +000029 Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM,
30 CodeGenOpt::Level OL, bool JIT);
Nikolai Bozhenov82f08012017-05-29 09:48:30 +000031 ~Nios2TargetMachine() override;
Nikolai Bozhenovebbde142017-09-19 11:54:29 +000032
Nikolai Bozhenov1cf9c542017-12-07 12:35:02 +000033 const Nios2Subtarget *getSubtargetImpl() const { return &Subtarget; }
Nikolai Bozhenovebbde142017-09-19 11:54:29 +000034 const Nios2Subtarget *getSubtargetImpl(const Function &F) const override;
35
Nikolai Bozhenov1cf9c542017-12-07 12:35:02 +000036 TargetLoweringObjectFile *getObjFileLowering() const override {
37 return TLOF.get();
38 }
39
Nikolai Bozhenovebbde142017-09-19 11:54:29 +000040 // Pass Pipeline Configuration
41 TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
Nikolai Bozhenov82f08012017-05-29 09:48:30 +000042};
43} // namespace llvm
44
45#endif