1356843Sdim//===-- VETargetMachine.h - Define TargetMachine for VE ---------*- C++ -*-===//
2356843Sdim//
3356843Sdim// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4356843Sdim// See https://llvm.org/LICENSE.txt for license information.
5356843Sdim// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6356843Sdim//
7356843Sdim//===----------------------------------------------------------------------===//
8356843Sdim//
9356843Sdim// This file declares the VE specific subclass of TargetMachine.
10356843Sdim//
11356843Sdim//===----------------------------------------------------------------------===//
12356843Sdim
13356843Sdim#ifndef LLVM_LIB_TARGET_VE_VETARGETMACHINE_H
14356843Sdim#define LLVM_LIB_TARGET_VE_VETARGETMACHINE_H
15356843Sdim
16356843Sdim#include "VEInstrInfo.h"
17356843Sdim#include "VESubtarget.h"
18356843Sdim#include "llvm/Target/TargetMachine.h"
19356843Sdim
20356843Sdimnamespace llvm {
21356843Sdim
22356843Sdimclass VETargetMachine : public LLVMTargetMachine {
23356843Sdim  std::unique_ptr<TargetLoweringObjectFile> TLOF;
24356843Sdim  VESubtarget Subtarget;
25356843Sdim  // Hold Strings that can be free'd all together with VETargetMachine
26356843Sdim  //   e.g.: "GCC_except_tableXX" string.
27356843Sdim  std::list<std::string> StrList;
28356843Sdim
29356843Sdimpublic:
30356843Sdim  VETargetMachine(const Target &T, const Triple &TT, StringRef CPU,
31356843Sdim                  StringRef FS, const TargetOptions &Options,
32356843Sdim                  Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM,
33356843Sdim                  CodeGenOpt::Level OL, bool JIT);
34356843Sdim  ~VETargetMachine() override;
35356843Sdim
36356843Sdim  const VESubtarget *getSubtargetImpl() const { return &Subtarget; }
37356843Sdim  const VESubtarget *getSubtargetImpl(const Function &) const override {
38356843Sdim    return &Subtarget;
39356843Sdim  }
40356843Sdim  std::list<std::string> *getStrList() const {
41356843Sdim    return const_cast<std::list<std::string> *>(&StrList);
42356843Sdim  }
43356843Sdim
44356843Sdim  // Pass Pipeline Configuration
45356843Sdim  TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
46356843Sdim  TargetLoweringObjectFile *getObjFileLowering() const override {
47356843Sdim    return TLOF.get();
48356843Sdim  }
49356843Sdim
50356843Sdim  bool isMachineVerifierClean() const override { return false; }
51356843Sdim
52356843Sdim  TargetTransformInfo getTargetTransformInfo(const Function &F) override;
53356843Sdim};
54356843Sdim
55356843Sdim} // namespace llvm
56356843Sdim
57356843Sdim#endif
58