1 //===-- DirectXSubtarget.h - Define Subtarget for DirectX -------*- 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-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file declares the DirectX specific subclass of TargetSubtargetInfo.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_DIRECTX_DIRECTXSUBTARGET_H
14 #define LLVM_DIRECTX_DIRECTXSUBTARGET_H
15 
16 #include "DirectXTargetLowering.h"
17 #include "llvm/CodeGen/TargetSubtargetInfo.h"
18 #include "llvm/IR/DataLayout.h"
19 #include "llvm/Target/TargetMachine.h"
20 
21 #define GET_SUBTARGETINFO_HEADER
22 #include "DirectXGenSubtargetInfo.inc"
23 
24 namespace llvm {
25 
26 class DirectXTargetMachine;
27 
28 class DirectXSubtarget : public DirectXGenSubtargetInfo {
29   DirectXTargetLowering TL;
30 
31 public:
32   DirectXSubtarget(const Triple &TT, StringRef CPU, StringRef FS,
33                    const DirectXTargetMachine &TM);
34 
35   /// Parses a subtarget feature string, setting appropriate options.
36   /// \note Definition of function is auto generated by `tblgen`.
37   void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS);
38 
39   const DirectXTargetLowering *getTargetLowering() const override {
40     return &TL;
41   }
42 };
43 
44 } // end namespace llvm
45 
46 #endif // LLVM_DIRECTX_DIRECTXSUBTARGET_H
47