1 //===-- XtensaTargetMachine.h - Define TargetMachine for Xtensa -*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 6 // See https://llvm.org/LICENSE.txt for license information. 7 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 8 // 9 //===----------------------------------------------------------------------===// 10 // 11 // This file declares the Xtensa specific subclass of TargetMachine. 12 // 13 //===----------------------------------------------------------------------===// 14 15 #ifndef LLVM_LIB_TARGET_XTENSA_XTENSATARGETMACHINE_H 16 #define LLVM_LIB_TARGET_XTENSA_XTENSATARGETMACHINE_H 17 18 #include "llvm/Target/TargetMachine.h" 19 #include <optional> 20 21 namespace llvm { 22 extern Target TheXtensaTarget; 23 24 class XtensaTargetMachine : public LLVMTargetMachine { 25 std::unique_ptr<TargetLoweringObjectFile> TLOF; 26 public: 27 XtensaTargetMachine(const Target &T, const Triple &TT, StringRef CPU, 28 StringRef FS, const TargetOptions &Options, 29 std::optional<Reloc::Model> RM, 30 std::optional<CodeModel::Model> CM, CodeGenOpt::Level OL, 31 bool JIT, bool isLittle); 32 33 XtensaTargetMachine(const Target &T, const Triple &TT, StringRef CPU, 34 StringRef FS, const TargetOptions &Options, 35 std::optional<Reloc::Model> RM, 36 std::optional<CodeModel::Model> CM, CodeGenOpt::Level OL, 37 bool JIT); 38 39 TargetPassConfig *createPassConfig(PassManagerBase &PM) override; 40 TargetLoweringObjectFile *getObjFileLowering() const override { 41 return TLOF.get(); 42 } 43 }; 44 } // end namespace llvm 45 46 #endif // LLVM_LIB_TARGET_XTENSA_XTENSATARGETMACHINE_H 47