1 //===- ARCTargetMachine.h - Define TargetMachine for ARC --------*- C++ -*-===//
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-exception
7 //===----------------------------------------------------------------------===//
9 // This file declares the ARC specific subclass of TargetMachine.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_LIB_TARGET_ARC_ARCTARGETMACHINE_H
14 #define LLVM_LIB_TARGET_ARC_ARCTARGETMACHINE_H
16 #include "ARCSubtarget.h"
17 #include "llvm/Target/TargetMachine.h"
22 class TargetPassConfig
;
24 class ARCTargetMachine
: public LLVMTargetMachine
{
25 std::unique_ptr
<TargetLoweringObjectFile
> TLOF
;
26 ARCSubtarget Subtarget
;
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
,
34 ~ARCTargetMachine() override
;
36 const ARCSubtarget
*getSubtargetImpl() const { return &Subtarget
; }
37 const ARCSubtarget
*getSubtargetImpl(const Function
&) const override
{
41 // Pass Pipeline Configuration
42 TargetPassConfig
*createPassConfig(PassManagerBase
&PM
) override
;
44 TargetTransformInfo
getTargetTransformInfo(const Function
&F
) const override
;
45 TargetLoweringObjectFile
*getObjFileLowering() const override
{
50 createMachineFunctionInfo(BumpPtrAllocator
&Allocator
, const Function
&F
,
51 const TargetSubtargetInfo
*STI
) const override
;
54 } // end namespace llvm
56 #endif // LLVM_LIB_TARGET_ARC_ARCTARGETMACHINE_H