Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/lib/Target/ARM/MCTargetDesc/ARMMachORelocationInfo.cpp
Line
Count
Source
1
//===- ARMMachORelocationInfo.cpp -----------------------------------------===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
9
#include "ARMMCExpr.h"
10
#include "MCTargetDesc/ARMMCTargetDesc.h"
11
#include "llvm-c/Disassembler.h"
12
#include "llvm/MC/MCDisassembler/MCRelocationInfo.h"
13
#include "llvm/MC/MCExpr.h"
14
15
using namespace llvm;
16
17
namespace {
18
19
class ARMMachORelocationInfo : public MCRelocationInfo {
20
public:
21
35
  ARMMachORelocationInfo(MCContext &Ctx) : MCRelocationInfo(Ctx) {}
22
23
  const MCExpr *createExprForCAPIVariantKind(const MCExpr *SubExpr,
24
29
                                             unsigned VariantKind) override {
25
29
    switch(VariantKind) {
26
29
    
case 3
LLVMDisassembler_VariantKind_ARM_HI163
:
27
3
      return ARMMCExpr::createUpper16(SubExpr, Ctx);
28
29
    
case 3
LLVMDisassembler_VariantKind_ARM_LO163
:
29
3
      return ARMMCExpr::createLower16(SubExpr, Ctx);
30
29
    default:
31
23
      return MCRelocationInfo::createExprForCAPIVariantKind(SubExpr,
32
23
                                                            VariantKind);
33
29
    }
34
29
  }
35
};
36
37
} // end anonymous namespace
38
39
/// createARMMachORelocationInfo - Construct an ARM Mach-O RelocationInfo.
40
35
MCRelocationInfo *llvm::createARMMachORelocationInfo(MCContext &Ctx) {
41
35
  return new ARMMachORelocationInfo(Ctx);
42
35
}