LCOV - code coverage report
Current view: top level - lib/Target/ARM - ARMTargetMachine.h (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 5 5 100.0 %
Date: 2018-07-13 00:08:38 Functions: 4 7 57.1 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===-- ARMTargetMachine.h - Define TargetMachine for ARM -------*- 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             : // This file declares the ARM specific subclass of TargetMachine.
      11             : //
      12             : //===----------------------------------------------------------------------===//
      13             : 
      14             : #ifndef LLVM_LIB_TARGET_ARM_ARMTARGETMACHINE_H
      15             : #define LLVM_LIB_TARGET_ARM_ARMTARGETMACHINE_H
      16             : 
      17             : #include "ARMSubtarget.h"
      18             : #include "llvm/ADT/Optional.h"
      19             : #include "llvm/ADT/StringMap.h"
      20             : #include "llvm/ADT/StringRef.h"
      21             : #include "llvm/Analysis/TargetTransformInfo.h"
      22             : #include "llvm/Support/CodeGen.h"
      23             : #include "llvm/Target/TargetMachine.h"
      24             : #include <memory>
      25             : 
      26             : namespace llvm {
      27             : 
      28        6500 : class ARMBaseTargetMachine : public LLVMTargetMachine {
      29             : public:
      30             :   enum ARMABI {
      31             :     ARM_ABI_UNKNOWN,
      32             :     ARM_ABI_APCS,
      33             :     ARM_ABI_AAPCS, // ARM EABI
      34             :     ARM_ABI_AAPCS16
      35             :   } TargetABI;
      36             : 
      37             : protected:
      38             :   std::unique_ptr<TargetLoweringObjectFile> TLOF;
      39             :   bool isLittle;
      40             :   mutable StringMap<std::unique_ptr<ARMSubtarget>> SubtargetMap;
      41             : 
      42             : public:
      43             :   ARMBaseTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
      44             :                        StringRef FS, const TargetOptions &Options,
      45             :                        Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM,
      46             :                        CodeGenOpt::Level OL, bool isLittle);
      47             :   ~ARMBaseTargetMachine() override;
      48             : 
      49             :   const ARMSubtarget *getSubtargetImpl(const Function &F) const override;
      50             :   // DO NOT IMPLEMENT: There is no such thing as a valid default subtarget,
      51             :   // subtargets are per-function entities based on the target-specific
      52             :   // attributes of each function.
      53             :   const ARMSubtarget *getSubtargetImpl() const = delete;
      54             :   bool isLittleEndian() const { return isLittle; }
      55             : 
      56             :   TargetTransformInfo getTargetTransformInfo(const Function &F) override;
      57             : 
      58             :   // Pass Pipeline Configuration
      59             :   TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
      60             : 
      61       59813 :   TargetLoweringObjectFile *getObjFileLowering() const override {
      62       59813 :     return TLOF.get();
      63             :   }
      64             : };
      65             : 
      66             : /// ARM/Thumb little endian target machine.
      67             : ///
      68        3204 : class ARMLETargetMachine : public ARMBaseTargetMachine {
      69             : public:
      70             :   ARMLETargetMachine(const Target &T, const Triple &TT, StringRef CPU,
      71             :                      StringRef FS, const TargetOptions &Options,
      72             :                      Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM,
      73             :                      CodeGenOpt::Level OL, bool JIT);
      74             : };
      75             : 
      76             : /// ARM/Thumb big endian target machine.
      77             : ///
      78          46 : class ARMBETargetMachine : public ARMBaseTargetMachine {
      79             : public:
      80             :   ARMBETargetMachine(const Target &T, const Triple &TT, StringRef CPU,
      81             :                      StringRef FS, const TargetOptions &Options,
      82             :                      Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM,
      83             :                      CodeGenOpt::Level OL, bool JIT);
      84             : };
      85             : 
      86             : } // end namespace llvm
      87             : 
      88             : #endif // LLVM_LIB_TARGET_ARM_ARMTARGETMACHINE_H

Generated by: LCOV version 1.13