LCOV - code coverage report
Current view: top level - lib/Target/WebAssembly - WebAssemblySubtarget.h (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 13 18 72.2 %
Date: 2018-10-20 13:21:21 Functions: 5 10 50.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //=- WebAssemblySubtarget.h - Define Subtarget for the WebAssembly -*- C++ -*-//
       2             : //
       3             : //                     The LLVM Compiler Infrastructure
       4             : //
       5             : // This file is distributed under the University of Illinois Open Source
       6             : // License. See LICENSE.TXT for details.
       7             : //
       8             : //===----------------------------------------------------------------------===//
       9             : ///
      10             : /// \file
      11             : /// This file declares the WebAssembly-specific subclass of
      12             : /// TargetSubtarget.
      13             : ///
      14             : //===----------------------------------------------------------------------===//
      15             : 
      16             : #ifndef LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYSUBTARGET_H
      17             : #define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYSUBTARGET_H
      18             : 
      19             : #include "WebAssemblyFrameLowering.h"
      20             : #include "WebAssemblyISelLowering.h"
      21             : #include "WebAssemblyInstrInfo.h"
      22             : #include "WebAssemblySelectionDAGInfo.h"
      23             : #include "llvm/CodeGen/TargetSubtargetInfo.h"
      24             : #include <string>
      25             : 
      26             : #define GET_SUBTARGETINFO_HEADER
      27             : #include "WebAssemblyGenSubtargetInfo.inc"
      28             : 
      29             : namespace llvm {
      30             : 
      31         288 : class WebAssemblySubtarget final : public WebAssemblyGenSubtargetInfo {
      32             :   bool HasSIMD128;
      33             :   bool HasAtomics;
      34             :   bool HasNontrappingFPToInt;
      35             :   bool HasSignExt;
      36             :   bool HasExceptionHandling;
      37             : 
      38             :   /// String name of used CPU.
      39             :   std::string CPUString;
      40             : 
      41             :   /// What processor and OS we're targeting.
      42             :   Triple TargetTriple;
      43             : 
      44             :   WebAssemblyFrameLowering FrameLowering;
      45             :   WebAssemblyInstrInfo InstrInfo;
      46             :   WebAssemblySelectionDAGInfo TSInfo;
      47             :   WebAssemblyTargetLowering TLInfo;
      48             : 
      49             :   /// Initializes using CPUString and the passed in feature string so that we
      50             :   /// can use initializer lists for subtarget initialization.
      51             :   WebAssemblySubtarget &initializeSubtargetDependencies(StringRef FS);
      52             : 
      53             : public:
      54             :   /// This constructor initializes the data members to match that
      55             :   /// of the specified triple.
      56             :   WebAssemblySubtarget(const Triple &TT, const std::string &CPU,
      57             :                        const std::string &FS, const TargetMachine &TM);
      58             : 
      59        2987 :   const WebAssemblySelectionDAGInfo *getSelectionDAGInfo() const override {
      60        2987 :     return &TSInfo;
      61             :   }
      62       40198 :   const WebAssemblyFrameLowering *getFrameLowering() const override {
      63       40198 :     return &FrameLowering;
      64             :   }
      65       40060 :   const WebAssemblyTargetLowering *getTargetLowering() const override {
      66       67582 :     return &TLInfo;
      67             :   }
      68       85865 :   const WebAssemblyInstrInfo *getInstrInfo() const override {
      69       94633 :     return &InstrInfo;
      70             :   }
      71      218627 :   const WebAssemblyRegisterInfo *getRegisterInfo() const override {
      72      218627 :     return &getInstrInfo()->getRegisterInfo();
      73             :   }
      74         293 :   const Triple &getTargetTriple() const { return TargetTriple; }
      75             :   bool enableMachineScheduler() const override;
      76             :   bool useAA() const override;
      77             : 
      78             :   // Predicates used by WebAssemblyInstrInfo.td.
      79        1318 :   bool hasAddr64() const { return TargetTriple.isArch64Bit(); }
      80           0 :   bool hasSIMD128() const { return HasSIMD128; }
      81           0 :   bool hasAtomics() const { return HasAtomics; }
      82           0 :   bool hasNontrappingFPToInt() const { return HasNontrappingFPToInt; }
      83           0 :   bool hasSignExt() const { return HasSignExt; }
      84           0 :   bool hasExceptionHandling() const { return HasExceptionHandling; }
      85             : 
      86             :   /// Parses features string setting specified subtarget options. Definition of
      87             :   /// function is auto generated by tblgen.
      88             :   void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
      89             : };
      90             : 
      91             : } // end namespace llvm
      92             : 
      93             : #endif

Generated by: LCOV version 1.13