1*82d56013Sjoerg //===-- VETargetMachine.h - Define TargetMachine for VE ---------*- C++ -*-===// 2*82d56013Sjoerg // 3*82d56013Sjoerg // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4*82d56013Sjoerg // See https://llvm.org/LICENSE.txt for license information. 5*82d56013Sjoerg // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6*82d56013Sjoerg // 7*82d56013Sjoerg //===----------------------------------------------------------------------===// 8*82d56013Sjoerg // 9*82d56013Sjoerg // This file declares the VE specific subclass of TargetMachine. 10*82d56013Sjoerg // 11*82d56013Sjoerg //===----------------------------------------------------------------------===// 12*82d56013Sjoerg 13*82d56013Sjoerg #ifndef LLVM_LIB_TARGET_VE_VETARGETMACHINE_H 14*82d56013Sjoerg #define LLVM_LIB_TARGET_VE_VETARGETMACHINE_H 15*82d56013Sjoerg 16*82d56013Sjoerg #include "VEInstrInfo.h" 17*82d56013Sjoerg #include "VESubtarget.h" 18*82d56013Sjoerg #include "llvm/Target/TargetMachine.h" 19*82d56013Sjoerg 20*82d56013Sjoerg namespace llvm { 21*82d56013Sjoerg 22*82d56013Sjoerg class VETargetMachine : public LLVMTargetMachine { 23*82d56013Sjoerg std::unique_ptr<TargetLoweringObjectFile> TLOF; 24*82d56013Sjoerg VESubtarget Subtarget; 25*82d56013Sjoerg // Hold Strings that can be free'd all together with VETargetMachine 26*82d56013Sjoerg // e.g.: "GCC_except_tableXX" string. 27*82d56013Sjoerg std::list<std::string> StrList; 28*82d56013Sjoerg 29*82d56013Sjoerg public: 30*82d56013Sjoerg VETargetMachine(const Target &T, const Triple &TT, StringRef CPU, 31*82d56013Sjoerg StringRef FS, const TargetOptions &Options, 32*82d56013Sjoerg Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM, 33*82d56013Sjoerg CodeGenOpt::Level OL, bool JIT); 34*82d56013Sjoerg ~VETargetMachine() override; 35*82d56013Sjoerg getSubtargetImpl()36*82d56013Sjoerg const VESubtarget *getSubtargetImpl() const { return &Subtarget; } getSubtargetImpl(const Function &)37*82d56013Sjoerg const VESubtarget *getSubtargetImpl(const Function &) const override { 38*82d56013Sjoerg return &Subtarget; 39*82d56013Sjoerg } getStrList()40*82d56013Sjoerg std::list<std::string> *getStrList() const { 41*82d56013Sjoerg return const_cast<std::list<std::string> *>(&StrList); 42*82d56013Sjoerg } 43*82d56013Sjoerg 44*82d56013Sjoerg // Pass Pipeline Configuration 45*82d56013Sjoerg TargetPassConfig *createPassConfig(PassManagerBase &PM) override; getObjFileLowering()46*82d56013Sjoerg TargetLoweringObjectFile *getObjFileLowering() const override { 47*82d56013Sjoerg return TLOF.get(); 48*82d56013Sjoerg } 49*82d56013Sjoerg isMachineVerifierClean()50*82d56013Sjoerg bool isMachineVerifierClean() const override { return false; } 51*82d56013Sjoerg 52*82d56013Sjoerg TargetTransformInfo getTargetTransformInfo(const Function &F) override; 53*82d56013Sjoerg getSjLjDataSize()54*82d56013Sjoerg unsigned getSjLjDataSize() const override { return 64; } 55*82d56013Sjoerg }; 56*82d56013Sjoerg 57*82d56013Sjoerg } // namespace llvm 58*82d56013Sjoerg 59*82d56013Sjoerg #endif 60