1*81ad6265SDimitry Andric //===-- DirectXSubtarget.h - Define Subtarget for DirectX -------*- C++ -*-===// 2*81ad6265SDimitry Andric // 3*81ad6265SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4*81ad6265SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 5*81ad6265SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6*81ad6265SDimitry Andric // 7*81ad6265SDimitry Andric //===----------------------------------------------------------------------===// 8*81ad6265SDimitry Andric // 9*81ad6265SDimitry Andric // This file declares the DirectX specific subclass of TargetSubtargetInfo. 10*81ad6265SDimitry Andric // 11*81ad6265SDimitry Andric //===----------------------------------------------------------------------===// 12*81ad6265SDimitry Andric 13*81ad6265SDimitry Andric #ifndef LLVM_DIRECTX_DIRECTXSUBTARGET_H 14*81ad6265SDimitry Andric #define LLVM_DIRECTX_DIRECTXSUBTARGET_H 15*81ad6265SDimitry Andric 16*81ad6265SDimitry Andric #include "DirectXFrameLowering.h" 17*81ad6265SDimitry Andric #include "DirectXInstrInfo.h" 18*81ad6265SDimitry Andric #include "DirectXTargetLowering.h" 19*81ad6265SDimitry Andric #include "llvm/CodeGen/TargetSubtargetInfo.h" 20*81ad6265SDimitry Andric #include "llvm/IR/DataLayout.h" 21*81ad6265SDimitry Andric #include "llvm/Target/TargetMachine.h" 22*81ad6265SDimitry Andric 23*81ad6265SDimitry Andric #define GET_SUBTARGETINFO_HEADER 24*81ad6265SDimitry Andric #include "DirectXGenSubtargetInfo.inc" 25*81ad6265SDimitry Andric 26*81ad6265SDimitry Andric namespace llvm { 27*81ad6265SDimitry Andric 28*81ad6265SDimitry Andric class DirectXTargetMachine; 29*81ad6265SDimitry Andric 30*81ad6265SDimitry Andric class DirectXSubtarget : public DirectXGenSubtargetInfo { 31*81ad6265SDimitry Andric DirectXFrameLowering FL; 32*81ad6265SDimitry Andric DirectXTargetLowering TL; 33*81ad6265SDimitry Andric DirectXInstrInfo InstrInfo; 34*81ad6265SDimitry Andric 35*81ad6265SDimitry Andric virtual void anchor(); // virtual anchor method 36*81ad6265SDimitry Andric 37*81ad6265SDimitry Andric public: 38*81ad6265SDimitry Andric DirectXSubtarget(const Triple &TT, StringRef CPU, StringRef FS, 39*81ad6265SDimitry Andric const DirectXTargetMachine &TM); 40*81ad6265SDimitry Andric 41*81ad6265SDimitry Andric /// Parses a subtarget feature string, setting appropriate options. 42*81ad6265SDimitry Andric /// \note Definition of function is auto generated by `tblgen`. 43*81ad6265SDimitry Andric void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS); 44*81ad6265SDimitry Andric getTargetLowering()45*81ad6265SDimitry Andric const DirectXTargetLowering *getTargetLowering() const override { 46*81ad6265SDimitry Andric return &TL; 47*81ad6265SDimitry Andric } 48*81ad6265SDimitry Andric getFrameLowering()49*81ad6265SDimitry Andric const DirectXFrameLowering *getFrameLowering() const override { return &FL; } 50*81ad6265SDimitry Andric getInstrInfo()51*81ad6265SDimitry Andric const DirectXInstrInfo *getInstrInfo() const override { return &InstrInfo; } 52*81ad6265SDimitry Andric }; 53*81ad6265SDimitry Andric 54*81ad6265SDimitry Andric } // end namespace llvm 55*81ad6265SDimitry Andric 56*81ad6265SDimitry Andric #endif // LLVM_DIRECTX_DIRECTXSUBTARGET_H 57