brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · 4a46acc Raw
57 lines · c
1//===- ARCTargetMachine.h - Define TargetMachine for ARC --------*- C++ -*-===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8//9// This file declares the ARC specific subclass of TargetMachine.10//11//===----------------------------------------------------------------------===//12 13#ifndef LLVM_LIB_TARGET_ARC_ARCTARGETMACHINE_H14#define LLVM_LIB_TARGET_ARC_ARCTARGETMACHINE_H15 16#include "ARCSubtarget.h"17#include "llvm/CodeGen/CodeGenTargetMachineImpl.h"18#include <optional>19 20namespace llvm {21 22class TargetPassConfig;23 24class ARCTargetMachine : public CodeGenTargetMachineImpl {25  std::unique_ptr<TargetLoweringObjectFile> TLOF;26  ARCSubtarget Subtarget;27 28public:29  ARCTargetMachine(const Target &T, const Triple &TT, StringRef CPU,30                   StringRef FS, const TargetOptions &Options,31                   std::optional<Reloc::Model> RM,32                   std::optional<CodeModel::Model> CM, CodeGenOptLevel OL,33                   bool JIT);34  ~ARCTargetMachine() override;35 36  const ARCSubtarget *getSubtargetImpl() const { return &Subtarget; }37  const ARCSubtarget *getSubtargetImpl(const Function &) const override {38    return &Subtarget;39  }40 41  // Pass Pipeline Configuration42  TargetPassConfig *createPassConfig(PassManagerBase &PM) override;43 44  TargetTransformInfo getTargetTransformInfo(const Function &F) const override;45  TargetLoweringObjectFile *getObjFileLowering() const override {46    return TLOF.get();47  }48 49  MachineFunctionInfo *50  createMachineFunctionInfo(BumpPtrAllocator &Allocator, const Function &F,51                            const TargetSubtargetInfo *STI) const override;52};53 54} // end namespace llvm55 56#endif // LLVM_LIB_TARGET_ARC_ARCTARGETMACHINE_H57