LCOV - code coverage report
Current view: top level - lib/Target/ARM/MCTargetDesc - ARMMachORelocationInfo.cpp (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 13 13 100.0 %
Date: 2017-09-14 15:23:50 Functions: 3 4 75.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/MCContext.h"
      14             : #include "llvm/MC/MCDisassembler/MCRelocationInfo.h"
      15             : #include "llvm/MC/MCExpr.h"
      16             : 
      17             : using namespace llvm;
      18             : 
      19             : namespace {
      20             : 
      21          30 : class ARMMachORelocationInfo : public MCRelocationInfo {
      22             : public:
      23          30 :   ARMMachORelocationInfo(MCContext &Ctx) : MCRelocationInfo(Ctx) {}
      24             : 
      25          29 :   const MCExpr *createExprForCAPIVariantKind(const MCExpr *SubExpr,
      26             :                                              unsigned VariantKind) override {
      27          29 :     switch(VariantKind) {
      28           3 :     case LLVMDisassembler_VariantKind_ARM_HI16:
      29           6 :       return ARMMCExpr::createUpper16(SubExpr, Ctx);
      30           3 :     case LLVMDisassembler_VariantKind_ARM_LO16:
      31           6 :       return ARMMCExpr::createLower16(SubExpr, Ctx);
      32          23 :     default:
      33          23 :       return MCRelocationInfo::createExprForCAPIVariantKind(SubExpr,
      34          23 :                                                             VariantKind);
      35             :     }
      36             :   }
      37             : };
      38             : 
      39             : } // end anonymous namespace
      40             : 
      41             : /// createARMMachORelocationInfo - Construct an ARM Mach-O RelocationInfo.
      42          30 : MCRelocationInfo *llvm::createARMMachORelocationInfo(MCContext &Ctx) {
      43          60 :   return new ARMMachORelocationInfo(Ctx);
      44             : }

Generated by: LCOV version 1.13