LCOV - code coverage report
Current view: top level - lib/Target/ARM/MCTargetDesc - ARMAsmBackend.h (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 7 9 77.8 %
Date: 2017-09-14 15:23:50 Functions: 2 4 50.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===-- ARMAsmBackend.h - ARM Assembler Backend -----------------*- 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             : #ifndef LLVM_LIB_TARGET_ARM_ARMASMBACKEND_H
      11             : #define LLVM_LIB_TARGET_ARM_ARMASMBACKEND_H
      12             : 
      13             : #include "MCTargetDesc/ARMFixupKinds.h"
      14             : #include "MCTargetDesc/ARMMCTargetDesc.h"
      15             : #include "llvm/MC/MCAsmBackend.h"
      16             : #include "llvm/MC/MCSubtargetInfo.h"
      17             : #include "llvm/Support/TargetRegistry.h"
      18             : 
      19             : namespace llvm {
      20             : 
      21             : class ARMAsmBackend : public MCAsmBackend {
      22             :   const MCSubtargetInfo *STI;
      23             :   bool isThumbMode;    // Currently emitting Thumb code.
      24             :   bool IsLittleEndian; // Big or little endian.
      25             : public:
      26        3236 :   ARMAsmBackend(const Target &T, const Triple &TT, bool IsLittle)
      27       12944 :       : MCAsmBackend(), STI(ARM_MC::createARMMCSubtargetInfo(TT, "", "")),
      28        9708 :         isThumbMode(TT.getArchName().startswith("thumb")),
      29       12944 :         IsLittleEndian(IsLittle) {}
      30             : 
      31        3203 :   ~ARMAsmBackend() override { delete STI; }
      32             : 
      33           0 :   unsigned getNumFixupKinds() const override {
      34           0 :     return ARM::NumTargetFixupKinds;
      35             :   }
      36             : 
      37        3942 :   bool hasNOP() const { return STI->getFeatureBits()[ARM::HasV6T2Ops]; }
      38             : 
      39             :   const MCFixupKindInfo &getFixupKindInfo(MCFixupKind Kind) const override;
      40             : 
      41             :   bool shouldForceRelocation(const MCAssembler &Asm, const MCFixup &Fixup,
      42             :                              const MCValue &Target) override;
      43             : 
      44             :   unsigned adjustFixupValue(const MCAssembler &Asm, const MCFixup &Fixup,
      45             :                             const MCValue &Target, uint64_t Value,
      46             :                             bool IsResolved, MCContext &Ctx,
      47             :                             bool IsLittleEndian) const;
      48             : 
      49             :   void applyFixup(const MCAssembler &Asm, const MCFixup &Fixup,
      50             :                   const MCValue &Target, MutableArrayRef<char> Data,
      51             :                   uint64_t Value, bool IsResolved) const override;
      52             : 
      53             :   unsigned getRelaxedOpcode(unsigned Op) const;
      54             : 
      55             :   bool mayNeedRelaxation(const MCInst &Inst) const override;
      56             : 
      57             :   const char *reasonForFixupRelaxation(const MCFixup &Fixup,
      58             :                                        uint64_t Value) const;
      59             : 
      60             :   bool fixupNeedsRelaxation(const MCFixup &Fixup, uint64_t Value,
      61             :                             const MCRelaxableFragment *DF,
      62             :                             const MCAsmLayout &Layout) const override;
      63             : 
      64             :   void relaxInstruction(const MCInst &Inst, const MCSubtargetInfo &STI,
      65             :                         MCInst &Res) const override;
      66             : 
      67             :   bool writeNopData(uint64_t Count, MCObjectWriter *OW) const override;
      68             : 
      69             :   void handleAssemblerFlag(MCAssemblerFlag Flag) override;
      70             : 
      71             :   unsigned getPointerSize() const { return 4; }
      72             :   bool isThumb() const { return isThumbMode; }
      73         638 :   void setIsThumb(bool it) { isThumbMode = it; }
      74             :   bool isLittle() const { return IsLittleEndian; }
      75             : };
      76             : } // end namespace llvm
      77             : 
      78             : #endif

Generated by: LCOV version 1.13