LCOV - code coverage report
Current view: top level - lib/Target/ARM/MCTargetDesc - ARMMachORelocationInfo.cpp (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 12 12 100.0 %
Date: 2018-10-20 13:21:21 Functions: 2 2 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===- ARMMachORelocationInfo.cpp -----------------------------------------===//
       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             : #include "ARMMCExpr.h"
      11             : #include "MCTargetDesc/ARMMCTargetDesc.h"
      12             : #include "llvm-c/Disassembler.h"
      13             : #include "llvm/MC/MCDisassembler/MCRelocationInfo.h"
      14             : #include "llvm/MC/MCExpr.h"
      15             : 
      16             : using namespace llvm;
      17             : 
      18             : namespace {
      19             : 
      20             : class ARMMachORelocationInfo : public MCRelocationInfo {
      21             : public:
      22          33 :   ARMMachORelocationInfo(MCContext &Ctx) : MCRelocationInfo(Ctx) {}
      23             : 
      24          29 :   const MCExpr *createExprForCAPIVariantKind(const MCExpr *SubExpr,
      25             :                                              unsigned VariantKind) override {
      26          29 :     switch(VariantKind) {
      27           3 :     case LLVMDisassembler_VariantKind_ARM_HI16:
      28           3 :       return ARMMCExpr::createUpper16(SubExpr, Ctx);
      29           3 :     case LLVMDisassembler_VariantKind_ARM_LO16:
      30           3 :       return ARMMCExpr::createLower16(SubExpr, Ctx);
      31          23 :     default:
      32          23 :       return MCRelocationInfo::createExprForCAPIVariantKind(SubExpr,
      33          23 :                                                             VariantKind);
      34             :     }
      35             :   }
      36             : };
      37             : 
      38             : } // end anonymous namespace
      39             : 
      40             : /// createARMMachORelocationInfo - Construct an ARM Mach-O RelocationInfo.
      41          33 : MCRelocationInfo *llvm::createARMMachORelocationInfo(MCContext &Ctx) {
      42          33 :   return new ARMMachORelocationInfo(Ctx);
      43             : }

Generated by: LCOV version 1.13