xref: /netbsd-src/external/apache2/llvm/dist/llvm/lib/Target/ARC/ARCSubtarget.h (revision 82d56013d7b633d116a93943de88e08335357a7c)
17330f729Sjoerg //===- ARCSubtarget.h - Define Subtarget for the ARC ------------*- C++ -*-===//
27330f729Sjoerg //
37330f729Sjoerg // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
47330f729Sjoerg // See https://llvm.org/LICENSE.txt for license information.
57330f729Sjoerg // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
67330f729Sjoerg //
77330f729Sjoerg //===----------------------------------------------------------------------===//
87330f729Sjoerg //
97330f729Sjoerg // This file declares the ARC specific subclass of TargetSubtargetInfo.
107330f729Sjoerg //
117330f729Sjoerg //===----------------------------------------------------------------------===//
127330f729Sjoerg 
137330f729Sjoerg #ifndef LLVM_LIB_TARGET_ARC_ARCSUBTARGET_H
147330f729Sjoerg #define LLVM_LIB_TARGET_ARC_ARCSUBTARGET_H
157330f729Sjoerg 
167330f729Sjoerg #include "ARCFrameLowering.h"
177330f729Sjoerg #include "ARCISelLowering.h"
187330f729Sjoerg #include "ARCInstrInfo.h"
197330f729Sjoerg #include "llvm/CodeGen/SelectionDAGTargetInfo.h"
207330f729Sjoerg #include "llvm/CodeGen/TargetSubtargetInfo.h"
217330f729Sjoerg #include <string>
227330f729Sjoerg 
237330f729Sjoerg #define GET_SUBTARGETINFO_HEADER
247330f729Sjoerg #include "ARCGenSubtargetInfo.inc"
257330f729Sjoerg 
267330f729Sjoerg namespace llvm {
277330f729Sjoerg 
287330f729Sjoerg class StringRef;
297330f729Sjoerg class TargetMachine;
307330f729Sjoerg 
317330f729Sjoerg class ARCSubtarget : public ARCGenSubtargetInfo {
327330f729Sjoerg   virtual void anchor();
337330f729Sjoerg   ARCInstrInfo InstrInfo;
347330f729Sjoerg   ARCFrameLowering FrameLowering;
357330f729Sjoerg   ARCTargetLowering TLInfo;
367330f729Sjoerg   SelectionDAGTargetInfo TSInfo;
377330f729Sjoerg 
387330f729Sjoerg public:
397330f729Sjoerg   /// This constructor initializes the data members to match that
407330f729Sjoerg   /// of the specified triple.
417330f729Sjoerg   ARCSubtarget(const Triple &TT, const std::string &CPU, const std::string &FS,
427330f729Sjoerg                const TargetMachine &TM);
437330f729Sjoerg 
447330f729Sjoerg   /// Parses features string setting specified subtarget options.
457330f729Sjoerg   /// Definition of function is auto generated by tblgen.
46*82d56013Sjoerg   void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS);
477330f729Sjoerg 
getInstrInfo()487330f729Sjoerg   const ARCInstrInfo *getInstrInfo() const override { return &InstrInfo; }
getFrameLowering()497330f729Sjoerg   const ARCFrameLowering *getFrameLowering() const override {
507330f729Sjoerg     return &FrameLowering;
517330f729Sjoerg   }
getTargetLowering()527330f729Sjoerg   const ARCTargetLowering *getTargetLowering() const override {
537330f729Sjoerg     return &TLInfo;
547330f729Sjoerg   }
getRegisterInfo()557330f729Sjoerg   const ARCRegisterInfo *getRegisterInfo() const override {
567330f729Sjoerg     return &InstrInfo.getRegisterInfo();
577330f729Sjoerg   }
getSelectionDAGInfo()587330f729Sjoerg   const SelectionDAGTargetInfo *getSelectionDAGInfo() const override {
597330f729Sjoerg     return &TSInfo;
607330f729Sjoerg   }
617330f729Sjoerg };
627330f729Sjoerg 
637330f729Sjoerg } // end namespace llvm
647330f729Sjoerg 
657330f729Sjoerg #endif // LLVM_LIB_TARGET_ARC_ARCSUBTARGET_H
66