1 //===- DirectXTargetMachine.h - DirectX Target Implementation ---*- 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 //===----------------------------------------------------------------------===//
11 #ifndef LLVM_DIRECTX_DIRECTXTARGETMACHINE_H
12 #define LLVM_DIRECTX_DIRECTXTARGETMACHINE_H
14 #include "DirectXSubtarget.h"
15 #include "llvm/Target/TargetMachine.h"
20 class DirectXTargetMachine
: public LLVMTargetMachine
{
21 std::unique_ptr
<TargetLoweringObjectFile
> TLOF
;
22 std::unique_ptr
<DirectXSubtarget
> Subtarget
;
25 DirectXTargetMachine(const Target
&T
, const Triple
&TT
, StringRef CPU
,
26 StringRef FS
, const TargetOptions
&Options
,
27 std::optional
<Reloc::Model
> RM
,
28 std::optional
<CodeModel::Model
> CM
, CodeGenOptLevel OL
,
31 ~DirectXTargetMachine() override
;
33 bool addPassesToEmitFile(PassManagerBase
&PM
, raw_pwrite_stream
&Out
,
34 raw_pwrite_stream
*DwoOut
, CodeGenFileType FileType
,
36 MachineModuleInfoWrapperPass
*MMIWP
) override
;
38 bool addPassesToEmitMC(PassManagerBase
&PM
, MCContext
*&Ctx
,
39 raw_pwrite_stream
&Out
, bool DisableVerify
) override
;
41 const DirectXSubtarget
*getSubtargetImpl(const Function
&) const override
;
43 TargetPassConfig
*createPassConfig(PassManagerBase
&PM
) override
;
45 TargetLoweringObjectFile
*getObjFileLowering() const override
{
49 TargetTransformInfo
getTargetTransformInfo(const Function
&F
) const override
;
50 void registerPassBuilderCallbacks(PassBuilder
&PB
) override
;
54 #endif // LLVM_DIRECTX_DIRECTXTARGETMACHINE_H