Coverage Report

Created: 2018-10-20 06:24

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/lld/ELF/Relocations.h
Line
Count
Source (jump to first uncovered line)
1
//===- Relocations.h -------------------------------------------*- C++ -*-===//
2
//
3
//                             The LLVM Linker
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 LLD_ELF_RELOCATIONS_H
11
#define LLD_ELF_RELOCATIONS_H
12
13
#include "lld/Common/LLVM.h"
14
#include "llvm/ADT/DenseMap.h"
15
#include <map>
16
#include <vector>
17
18
namespace lld {
19
namespace elf {
20
class Symbol;
21
class InputSection;
22
class InputSectionBase;
23
class OutputSection;
24
class SectionBase;
25
26
// Represents a relocation type, such as R_X86_64_PC32 or R_ARM_THM_CALL.
27
typedef uint32_t RelType;
28
29
// List of target-independent relocation types. Relocations read
30
// from files are converted to these types so that the main code
31
// doesn't have to know about architecture-specific details.
32
enum RelExpr {
33
  R_INVALID,
34
  R_ABS,
35
  R_ADDEND,
36
  R_ARM_SBREL,
37
  R_GOT,
38
  R_GOTONLY_PC,
39
  R_GOTONLY_PC_FROM_END,
40
  R_GOTREL,
41
  R_GOTREL_FROM_END,
42
  R_GOT_FROM_END,
43
  R_GOT_OFF,
44
  R_GOT_PAGE_PC,
45
  R_GOT_PC,
46
  R_HEXAGON_GOT,
47
  R_HINT,
48
  R_MIPS_GOTREL,
49
  R_MIPS_GOT_GP,
50
  R_MIPS_GOT_GP_PC,
51
  R_MIPS_GOT_LOCAL_PAGE,
52
  R_MIPS_GOT_OFF,
53
  R_MIPS_GOT_OFF32,
54
  R_MIPS_TLSGD,
55
  R_MIPS_TLSLD,
56
  R_NEG_TLS,
57
  R_NONE,
58
  R_PAGE_PC,
59
  R_PC,
60
  R_PLT,
61
  R_PLT_PAGE_PC,
62
  R_PLT_PC,
63
  R_PPC_CALL,
64
  R_PPC_CALL_PLT,
65
  R_PPC_TOC,
66
  R_RELAX_GOT_PC,
67
  R_RELAX_GOT_PC_NOPIC,
68
  R_RELAX_TLS_GD_TO_IE,
69
  R_RELAX_TLS_GD_TO_IE_ABS,
70
  R_RELAX_TLS_GD_TO_IE_END,
71
  R_RELAX_TLS_GD_TO_IE_GOT_OFF,
72
  R_RELAX_TLS_GD_TO_IE_PAGE_PC,
73
  R_RELAX_TLS_GD_TO_LE,
74
  R_RELAX_TLS_GD_TO_LE_NEG,
75
  R_RELAX_TLS_IE_TO_LE,
76
  R_RELAX_TLS_LD_TO_LE,
77
  R_RELAX_TLS_LD_TO_LE_ABS,
78
  R_RISCV_PC_INDIRECT,
79
  R_SIZE,
80
  R_TLS,
81
  R_TLSDESC,
82
  R_TLSDESC_CALL,
83
  R_TLSDESC_PAGE,
84
  R_TLSGD_GOT,
85
  R_TLSGD_GOT_FROM_END,
86
  R_TLSGD_PC,
87
  R_TLSIE_HINT,
88
  R_TLSLD_GOT,
89
  R_TLSLD_GOT_FROM_END,
90
  R_TLSLD_GOT_OFF,
91
  R_TLSLD_HINT,
92
  R_TLSLD_PC,
93
};
94
95
// Build a bitmask with one bit set for each RelExpr.
96
//
97
// Constexpr function arguments can't be used in static asserts, so we
98
// use template arguments to build the mask.
99
// But function template partial specializations don't exist (needed
100
// for base case of the recursion), so we need a dummy struct.
101
template <RelExpr... Exprs> struct RelExprMaskBuilder {
102
69.1k
  static inline uint64_t build() { return 0; }
103
};
104
105
// Specialization for recursive case.
106
template <RelExpr Head, RelExpr... Tail>
107
struct RelExprMaskBuilder<Head, Tail...> {
108
599k
  static inline uint64_t build() {
109
599k
    static_assert(0 <= Head && Head < 64,
110
599k
                  "RelExpr is too large for 64-bit mask!");
111
599k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
599k
  }
Unexecuted instantiation: lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)26>::build()
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)14, (lld::elf::RelExpr)24>::build()
Line
Count
Source
108
13.6k
  static inline uint64_t build() {
109
13.6k
    static_assert(0 <= Head && Head < 64,
110
13.6k
                  "RelExpr is too large for 64-bit mask!");
111
13.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)24>::build()
Line
Count
Source
108
13.6k
  static inline uint64_t build() {
109
13.6k
    static_assert(0 <= Head && Head < 64,
110
13.6k
                  "RelExpr is too large for 64-bit mask!");
111
13.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)5, (lld::elf::RelExpr)6, (lld::elf::RelExpr)7, (lld::elf::RelExpr)8, (lld::elf::RelExpr)32>::build()
Line
Count
Source
108
13.6k
  static inline uint64_t build() {
109
13.6k
    static_assert(0 <= Head && Head < 64,
110
13.6k
                  "RelExpr is too large for 64-bit mask!");
111
13.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)6, (lld::elf::RelExpr)7, (lld::elf::RelExpr)8, (lld::elf::RelExpr)32>::build()
Line
Count
Source
108
13.6k
  static inline uint64_t build() {
109
13.6k
    static_assert(0 <= Head && Head < 64,
110
13.6k
                  "RelExpr is too large for 64-bit mask!");
111
13.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)7, (lld::elf::RelExpr)8, (lld::elf::RelExpr)32>::build()
Line
Count
Source
108
13.6k
  static inline uint64_t build() {
109
13.6k
    static_assert(0 <= Head && Head < 64,
110
13.6k
                  "RelExpr is too large for 64-bit mask!");
111
13.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)8, (lld::elf::RelExpr)32>::build()
Line
Count
Source
108
13.6k
  static inline uint64_t build() {
109
13.6k
    static_assert(0 <= Head && Head < 64,
110
13.6k
                  "RelExpr is too large for 64-bit mask!");
111
13.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)32>::build()
Line
Count
Source
108
13.6k
  static inline uint64_t build() {
109
13.6k
    static_assert(0 <= Head && Head < 64,
110
13.6k
                  "RelExpr is too large for 64-bit mask!");
111
13.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)48, (lld::elf::RelExpr)50, (lld::elf::RelExpr)49>::build()
Line
Count
Source
108
375
  static inline uint64_t build() {
109
375
    static_assert(0 <= Head && Head < 64,
110
375
                  "RelExpr is too large for 64-bit mask!");
111
375
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
375
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)50, (lld::elf::RelExpr)49>::build()
Line
Count
Source
108
375
  static inline uint64_t build() {
109
375
    static_assert(0 <= Head && Head < 64,
110
375
                  "RelExpr is too large for 64-bit mask!");
111
375
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
375
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)49>::build()
Line
Count
Source
108
375
  static inline uint64_t build() {
109
375
    static_assert(0 <= Head && Head < 64,
110
375
                  "RelExpr is too large for 64-bit mask!");
111
375
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
375
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)55, (lld::elf::RelExpr)56, (lld::elf::RelExpr)59, (lld::elf::RelExpr)58>::build()
Line
Count
Source
108
353
  static inline uint64_t build() {
109
353
    static_assert(0 <= Head && Head < 64,
110
353
                  "RelExpr is too large for 64-bit mask!");
111
353
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
353
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)56, (lld::elf::RelExpr)59, (lld::elf::RelExpr)58>::build()
Line
Count
Source
108
353
  static inline uint64_t build() {
109
353
    static_assert(0 <= Head && Head < 64,
110
353
                  "RelExpr is too large for 64-bit mask!");
111
353
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
353
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)59, (lld::elf::RelExpr)58>::build()
Line
Count
Source
108
353
  static inline uint64_t build() {
109
353
    static_assert(0 <= Head && Head < 64,
110
353
                  "RelExpr is too large for 64-bit mask!");
111
353
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
353
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)58>::build()
Line
Count
Source
108
353
  static inline uint64_t build() {
109
353
    static_assert(0 <= Head && Head < 64,
110
353
                  "RelExpr is too large for 64-bit mask!");
111
353
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
353
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)48, (lld::elf::RelExpr)50, (lld::elf::RelExpr)49, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)53>::build()
Line
Count
Source
108
290
  static inline uint64_t build() {
109
290
    static_assert(0 <= Head && Head < 64,
110
290
                  "RelExpr is too large for 64-bit mask!");
111
290
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
290
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)50, (lld::elf::RelExpr)49, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)53>::build()
Line
Count
Source
108
290
  static inline uint64_t build() {
109
290
    static_assert(0 <= Head && Head < 64,
110
290
                  "RelExpr is too large for 64-bit mask!");
111
290
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
290
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)49, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)53>::build()
Line
Count
Source
108
290
  static inline uint64_t build() {
109
290
    static_assert(0 <= Head && Head < 64,
110
290
                  "RelExpr is too large for 64-bit mask!");
111
290
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
290
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)53>::build()
Line
Count
Source
108
290
  static inline uint64_t build() {
109
290
    static_assert(0 <= Head && Head < 64,
110
290
                  "RelExpr is too large for 64-bit mask!");
111
290
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
290
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)52, (lld::elf::RelExpr)53>::build()
Line
Count
Source
108
290
  static inline uint64_t build() {
109
290
    static_assert(0 <= Head && Head < 64,
110
290
                  "RelExpr is too large for 64-bit mask!");
111
290
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
290
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)53>::build()
Line
Count
Source
108
290
  static inline uint64_t build() {
109
290
    static_assert(0 <= Head && Head < 64,
110
290
                  "RelExpr is too large for 64-bit mask!");
111
290
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
290
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)4, (lld::elf::RelExpr)9, (lld::elf::RelExpr)12, (lld::elf::RelExpr)11, (lld::elf::RelExpr)10, (lld::elf::RelExpr)54>::build()
Line
Count
Source
108
223
  static inline uint64_t build() {
109
223
    static_assert(0 <= Head && Head < 64,
110
223
                  "RelExpr is too large for 64-bit mask!");
111
223
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
223
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)9, (lld::elf::RelExpr)12, (lld::elf::RelExpr)11, (lld::elf::RelExpr)10, (lld::elf::RelExpr)54>::build()
Line
Count
Source
108
223
  static inline uint64_t build() {
109
223
    static_assert(0 <= Head && Head < 64,
110
223
                  "RelExpr is too large for 64-bit mask!");
111
223
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
223
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)12, (lld::elf::RelExpr)11, (lld::elf::RelExpr)10, (lld::elf::RelExpr)54>::build()
Line
Count
Source
108
223
  static inline uint64_t build() {
109
223
    static_assert(0 <= Head && Head < 64,
110
223
                  "RelExpr is too large for 64-bit mask!");
111
223
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
223
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)11, (lld::elf::RelExpr)10, (lld::elf::RelExpr)54>::build()
Line
Count
Source
108
223
  static inline uint64_t build() {
109
223
    static_assert(0 <= Head && Head < 64,
110
223
                  "RelExpr is too large for 64-bit mask!");
111
223
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
223
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)10, (lld::elf::RelExpr)54>::build()
Line
Count
Source
108
223
  static inline uint64_t build() {
109
223
    static_assert(0 <= Head && Head < 64,
110
223
                  "RelExpr is too large for 64-bit mask!");
111
223
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
223
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)54>::build()
Line
Count
Source
108
13.5k
  static inline uint64_t build() {
109
13.5k
    static_assert(0 <= Head && Head < 64,
110
13.5k
                  "RelExpr is too large for 64-bit mask!");
111
13.5k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.5k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)29, (lld::elf::RelExpr)31, (lld::elf::RelExpr)27, (lld::elf::RelExpr)28>::build()
Line
Count
Source
108
13.3k
  static inline uint64_t build() {
109
13.3k
    static_assert(0 <= Head && Head < 64,
110
13.3k
                  "RelExpr is too large for 64-bit mask!");
111
13.3k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.3k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)31, (lld::elf::RelExpr)27, (lld::elf::RelExpr)28>::build()
Line
Count
Source
108
13.3k
  static inline uint64_t build() {
109
13.3k
    static_assert(0 <= Head && Head < 64,
110
13.3k
                  "RelExpr is too large for 64-bit mask!");
111
13.3k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.3k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)27, (lld::elf::RelExpr)28>::build()
Line
Count
Source
108
13.3k
  static inline uint64_t build() {
109
13.3k
    static_assert(0 <= Head && Head < 64,
110
13.3k
                  "RelExpr is too large for 64-bit mask!");
111
13.3k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.3k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)28>::build()
Line
Count
Source
108
13.3k
  static inline uint64_t build() {
109
13.3k
    static_assert(0 <= Head && Head < 64,
110
13.3k
                  "RelExpr is too large for 64-bit mask!");
111
13.3k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.3k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)4, (lld::elf::RelExpr)10, (lld::elf::RelExpr)13, (lld::elf::RelExpr)18, (lld::elf::RelExpr)19, (lld::elf::RelExpr)20, (lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)9>::build()
Line
Count
Source
108
13.3k
  static inline uint64_t build() {
109
13.3k
    static_assert(0 <= Head && Head < 64,
110
13.3k
                  "RelExpr is too large for 64-bit mask!");
111
13.3k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.3k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)10, (lld::elf::RelExpr)13, (lld::elf::RelExpr)18, (lld::elf::RelExpr)19, (lld::elf::RelExpr)20, (lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)9>::build()
Line
Count
Source
108
13.3k
  static inline uint64_t build() {
109
13.3k
    static_assert(0 <= Head && Head < 64,
110
13.3k
                  "RelExpr is too large for 64-bit mask!");
111
13.3k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.3k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)13, (lld::elf::RelExpr)18, (lld::elf::RelExpr)19, (lld::elf::RelExpr)20, (lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)9>::build()
Line
Count
Source
108
13.3k
  static inline uint64_t build() {
109
13.3k
    static_assert(0 <= Head && Head < 64,
110
13.3k
                  "RelExpr is too large for 64-bit mask!");
111
13.3k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.3k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)18, (lld::elf::RelExpr)19, (lld::elf::RelExpr)20, (lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)9>::build()
Line
Count
Source
108
13.3k
  static inline uint64_t build() {
109
13.3k
    static_assert(0 <= Head && Head < 64,
110
13.3k
                  "RelExpr is too large for 64-bit mask!");
111
13.3k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.3k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)19, (lld::elf::RelExpr)20, (lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)9>::build()
Line
Count
Source
108
13.3k
  static inline uint64_t build() {
109
13.3k
    static_assert(0 <= Head && Head < 64,
110
13.3k
                  "RelExpr is too large for 64-bit mask!");
111
13.3k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.3k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)20, (lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)9>::build()
Line
Count
Source
108
13.3k
  static inline uint64_t build() {
109
13.3k
    static_assert(0 <= Head && Head < 64,
110
13.3k
                  "RelExpr is too large for 64-bit mask!");
111
13.3k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.3k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)9>::build()
Line
Count
Source
108
13.3k
  static inline uint64_t build() {
109
13.3k
    static_assert(0 <= Head && Head < 64,
110
13.3k
                  "RelExpr is too large for 64-bit mask!");
111
13.3k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.3k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)12, (lld::elf::RelExpr)9>::build()
Line
Count
Source
108
13.3k
  static inline uint64_t build() {
109
13.3k
    static_assert(0 <= Head && Head < 64,
110
13.3k
                  "RelExpr is too large for 64-bit mask!");
111
13.3k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.3k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)9>::build()
Line
Count
Source
108
13.3k
  static inline uint64_t build() {
109
13.3k
    static_assert(0 <= Head && Head < 64,
110
13.3k
                  "RelExpr is too large for 64-bit mask!");
111
13.3k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.3k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)9, (lld::elf::RelExpr)10, (lld::elf::RelExpr)13, (lld::elf::RelExpr)57, (lld::elf::RelExpr)18, (lld::elf::RelExpr)15, (lld::elf::RelExpr)19, (lld::elf::RelExpr)20, (lld::elf::RelExpr)17, (lld::elf::RelExpr)21, (lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)5, (lld::elf::RelExpr)6, (lld::elf::RelExpr)29, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)53, (lld::elf::RelExpr)31, (lld::elf::RelExpr)49, (lld::elf::RelExpr)50, (lld::elf::RelExpr)14, (lld::elf::RelExpr)58, (lld::elf::RelExpr)54>::build()
Line
Count
Source
108
13.3k
  static inline uint64_t build() {
109
13.3k
    static_assert(0 <= Head && Head < 64,
110
13.3k
                  "RelExpr is too large for 64-bit mask!");
111
13.3k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.3k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)10, (lld::elf::RelExpr)13, (lld::elf::RelExpr)57, (lld::elf::RelExpr)18, (lld::elf::RelExpr)15, (lld::elf::RelExpr)19, (lld::elf::RelExpr)20, (lld::elf::RelExpr)17, (lld::elf::RelExpr)21, (lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)5, (lld::elf::RelExpr)6, (lld::elf::RelExpr)29, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)53, (lld::elf::RelExpr)31, (lld::elf::RelExpr)49, (lld::elf::RelExpr)50, (lld::elf::RelExpr)14, (lld::elf::RelExpr)58, (lld::elf::RelExpr)54>::build()
Line
Count
Source
108
13.3k
  static inline uint64_t build() {
109
13.3k
    static_assert(0 <= Head && Head < 64,
110
13.3k
                  "RelExpr is too large for 64-bit mask!");
111
13.3k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.3k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)13, (lld::elf::RelExpr)57, (lld::elf::RelExpr)18, (lld::elf::RelExpr)15, (lld::elf::RelExpr)19, (lld::elf::RelExpr)20, (lld::elf::RelExpr)17, (lld::elf::RelExpr)21, (lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)5, (lld::elf::RelExpr)6, (lld::elf::RelExpr)29, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)53, (lld::elf::RelExpr)31, (lld::elf::RelExpr)49, (lld::elf::RelExpr)50, (lld::elf::RelExpr)14, (lld::elf::RelExpr)58, (lld::elf::RelExpr)54>::build()
Line
Count
Source
108
13.3k
  static inline uint64_t build() {
109
13.3k
    static_assert(0 <= Head && Head < 64,
110
13.3k
                  "RelExpr is too large for 64-bit mask!");
111
13.3k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.3k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)57, (lld::elf::RelExpr)18, (lld::elf::RelExpr)15, (lld::elf::RelExpr)19, (lld::elf::RelExpr)20, (lld::elf::RelExpr)17, (lld::elf::RelExpr)21, (lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)5, (lld::elf::RelExpr)6, (lld::elf::RelExpr)29, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)53, (lld::elf::RelExpr)31, (lld::elf::RelExpr)49, (lld::elf::RelExpr)50, (lld::elf::RelExpr)14, (lld::elf::RelExpr)58, (lld::elf::RelExpr)54>::build()
Line
Count
Source
108
13.3k
  static inline uint64_t build() {
109
13.3k
    static_assert(0 <= Head && Head < 64,
110
13.3k
                  "RelExpr is too large for 64-bit mask!");
111
13.3k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.3k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)18, (lld::elf::RelExpr)15, (lld::elf::RelExpr)19, (lld::elf::RelExpr)20, (lld::elf::RelExpr)17, (lld::elf::RelExpr)21, (lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)5, (lld::elf::RelExpr)6, (lld::elf::RelExpr)29, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)53, (lld::elf::RelExpr)31, (lld::elf::RelExpr)49, (lld::elf::RelExpr)50, (lld::elf::RelExpr)14, (lld::elf::RelExpr)58, (lld::elf::RelExpr)54>::build()
Line
Count
Source
108
13.3k
  static inline uint64_t build() {
109
13.3k
    static_assert(0 <= Head && Head < 64,
110
13.3k
                  "RelExpr is too large for 64-bit mask!");
111
13.3k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.3k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)15, (lld::elf::RelExpr)19, (lld::elf::RelExpr)20, (lld::elf::RelExpr)17, (lld::elf::RelExpr)21, (lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)5, (lld::elf::RelExpr)6, (lld::elf::RelExpr)29, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)53, (lld::elf::RelExpr)31, (lld::elf::RelExpr)49, (lld::elf::RelExpr)50, (lld::elf::RelExpr)14, (lld::elf::RelExpr)58, (lld::elf::RelExpr)54>::build()
Line
Count
Source
108
13.3k
  static inline uint64_t build() {
109
13.3k
    static_assert(0 <= Head && Head < 64,
110
13.3k
                  "RelExpr is too large for 64-bit mask!");
111
13.3k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.3k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)19, (lld::elf::RelExpr)20, (lld::elf::RelExpr)17, (lld::elf::RelExpr)21, (lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)5, (lld::elf::RelExpr)6, (lld::elf::RelExpr)29, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)53, (lld::elf::RelExpr)31, (lld::elf::RelExpr)49, (lld::elf::RelExpr)50, (lld::elf::RelExpr)14, (lld::elf::RelExpr)58, (lld::elf::RelExpr)54>::build()
Line
Count
Source
108
13.3k
  static inline uint64_t build() {
109
13.3k
    static_assert(0 <= Head && Head < 64,
110
13.3k
                  "RelExpr is too large for 64-bit mask!");
111
13.3k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.3k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)20, (lld::elf::RelExpr)17, (lld::elf::RelExpr)21, (lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)5, (lld::elf::RelExpr)6, (lld::elf::RelExpr)29, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)53, (lld::elf::RelExpr)31, (lld::elf::RelExpr)49, (lld::elf::RelExpr)50, (lld::elf::RelExpr)14, (lld::elf::RelExpr)58, (lld::elf::RelExpr)54>::build()
Line
Count
Source
108
13.3k
  static inline uint64_t build() {
109
13.3k
    static_assert(0 <= Head && Head < 64,
110
13.3k
                  "RelExpr is too large for 64-bit mask!");
111
13.3k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.3k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)17, (lld::elf::RelExpr)21, (lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)5, (lld::elf::RelExpr)6, (lld::elf::RelExpr)29, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)53, (lld::elf::RelExpr)31, (lld::elf::RelExpr)49, (lld::elf::RelExpr)50, (lld::elf::RelExpr)14, (lld::elf::RelExpr)58, (lld::elf::RelExpr)54>::build()
Line
Count
Source
108
13.3k
  static inline uint64_t build() {
109
13.3k
    static_assert(0 <= Head && Head < 64,
110
13.3k
                  "RelExpr is too large for 64-bit mask!");
111
13.3k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.3k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)21, (lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)5, (lld::elf::RelExpr)6, (lld::elf::RelExpr)29, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)53, (lld::elf::RelExpr)31, (lld::elf::RelExpr)49, (lld::elf::RelExpr)50, (lld::elf::RelExpr)14, (lld::elf::RelExpr)58, (lld::elf::RelExpr)54>::build()
Line
Count
Source
108
13.3k
  static inline uint64_t build() {
109
13.3k
    static_assert(0 <= Head && Head < 64,
110
13.3k
                  "RelExpr is too large for 64-bit mask!");
111
13.3k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.3k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)5, (lld::elf::RelExpr)6, (lld::elf::RelExpr)29, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)53, (lld::elf::RelExpr)31, (lld::elf::RelExpr)49, (lld::elf::RelExpr)50, (lld::elf::RelExpr)14, (lld::elf::RelExpr)58, (lld::elf::RelExpr)54>::build()
Line
Count
Source
108
13.3k
  static inline uint64_t build() {
109
13.3k
    static_assert(0 <= Head && Head < 64,
110
13.3k
                  "RelExpr is too large for 64-bit mask!");
111
13.3k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.3k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)12, (lld::elf::RelExpr)5, (lld::elf::RelExpr)6, (lld::elf::RelExpr)29, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)53, (lld::elf::RelExpr)31, (lld::elf::RelExpr)49, (lld::elf::RelExpr)50, (lld::elf::RelExpr)14, (lld::elf::RelExpr)58, (lld::elf::RelExpr)54>::build()
Line
Count
Source
108
13.3k
  static inline uint64_t build() {
109
13.3k
    static_assert(0 <= Head && Head < 64,
110
13.3k
                  "RelExpr is too large for 64-bit mask!");
111
13.3k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.3k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)5, (lld::elf::RelExpr)6, (lld::elf::RelExpr)29, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)53, (lld::elf::RelExpr)31, (lld::elf::RelExpr)49, (lld::elf::RelExpr)50, (lld::elf::RelExpr)14, (lld::elf::RelExpr)58, (lld::elf::RelExpr)54>::build()
Line
Count
Source
108
13.3k
  static inline uint64_t build() {
109
13.3k
    static_assert(0 <= Head && Head < 64,
110
13.3k
                  "RelExpr is too large for 64-bit mask!");
111
13.3k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.3k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)6, (lld::elf::RelExpr)29, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)53, (lld::elf::RelExpr)31, (lld::elf::RelExpr)49, (lld::elf::RelExpr)50, (lld::elf::RelExpr)14, (lld::elf::RelExpr)58, (lld::elf::RelExpr)54>::build()
Line
Count
Source
108
13.3k
  static inline uint64_t build() {
109
13.3k
    static_assert(0 <= Head && Head < 64,
110
13.3k
                  "RelExpr is too large for 64-bit mask!");
111
13.3k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.3k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)29, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)53, (lld::elf::RelExpr)31, (lld::elf::RelExpr)49, (lld::elf::RelExpr)50, (lld::elf::RelExpr)14, (lld::elf::RelExpr)58, (lld::elf::RelExpr)54>::build()
Line
Count
Source
108
13.3k
  static inline uint64_t build() {
109
13.3k
    static_assert(0 <= Head && Head < 64,
110
13.3k
                  "RelExpr is too large for 64-bit mask!");
111
13.3k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.3k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)53, (lld::elf::RelExpr)31, (lld::elf::RelExpr)49, (lld::elf::RelExpr)50, (lld::elf::RelExpr)14, (lld::elf::RelExpr)58, (lld::elf::RelExpr)54>::build()
Line
Count
Source
108
13.3k
  static inline uint64_t build() {
109
13.3k
    static_assert(0 <= Head && Head < 64,
110
13.3k
                  "RelExpr is too large for 64-bit mask!");
111
13.3k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.3k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)52, (lld::elf::RelExpr)53, (lld::elf::RelExpr)31, (lld::elf::RelExpr)49, (lld::elf::RelExpr)50, (lld::elf::RelExpr)14, (lld::elf::RelExpr)58, (lld::elf::RelExpr)54>::build()
Line
Count
Source
108
13.3k
  static inline uint64_t build() {
109
13.3k
    static_assert(0 <= Head && Head < 64,
110
13.3k
                  "RelExpr is too large for 64-bit mask!");
111
13.3k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.3k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)53, (lld::elf::RelExpr)31, (lld::elf::RelExpr)49, (lld::elf::RelExpr)50, (lld::elf::RelExpr)14, (lld::elf::RelExpr)58, (lld::elf::RelExpr)54>::build()
Line
Count
Source
108
13.3k
  static inline uint64_t build() {
109
13.3k
    static_assert(0 <= Head && Head < 64,
110
13.3k
                  "RelExpr is too large for 64-bit mask!");
111
13.3k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.3k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)31, (lld::elf::RelExpr)49, (lld::elf::RelExpr)50, (lld::elf::RelExpr)14, (lld::elf::RelExpr)58, (lld::elf::RelExpr)54>::build()
Line
Count
Source
108
13.3k
  static inline uint64_t build() {
109
13.3k
    static_assert(0 <= Head && Head < 64,
110
13.3k
                  "RelExpr is too large for 64-bit mask!");
111
13.3k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.3k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)49, (lld::elf::RelExpr)50, (lld::elf::RelExpr)14, (lld::elf::RelExpr)58, (lld::elf::RelExpr)54>::build()
Line
Count
Source
108
13.3k
  static inline uint64_t build() {
109
13.3k
    static_assert(0 <= Head && Head < 64,
110
13.3k
                  "RelExpr is too large for 64-bit mask!");
111
13.3k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.3k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)50, (lld::elf::RelExpr)14, (lld::elf::RelExpr)58, (lld::elf::RelExpr)54>::build()
Line
Count
Source
108
13.3k
  static inline uint64_t build() {
109
13.3k
    static_assert(0 <= Head && Head < 64,
110
13.3k
                  "RelExpr is too large for 64-bit mask!");
111
13.3k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.3k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)14, (lld::elf::RelExpr)58, (lld::elf::RelExpr)54>::build()
Line
Count
Source
108
13.3k
  static inline uint64_t build() {
109
13.3k
    static_assert(0 <= Head && Head < 64,
110
13.3k
                  "RelExpr is too large for 64-bit mask!");
111
13.3k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.3k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)58, (lld::elf::RelExpr)54>::build()
Line
Count
Source
108
13.3k
  static inline uint64_t build() {
109
13.3k
    static_assert(0 <= Head && Head < 64,
110
13.3k
                  "RelExpr is too large for 64-bit mask!");
111
13.3k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
13.3k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)26, (lld::elf::RelExpr)7, (lld::elf::RelExpr)8, (lld::elf::RelExpr)15, (lld::elf::RelExpr)30, (lld::elf::RelExpr)31, (lld::elf::RelExpr)25, (lld::elf::RelExpr)33>::build()
Line
Count
Source
108
608
  static inline uint64_t build() {
109
608
    static_assert(0 <= Head && Head < 64,
110
608
                  "RelExpr is too large for 64-bit mask!");
111
608
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
608
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)7, (lld::elf::RelExpr)8, (lld::elf::RelExpr)15, (lld::elf::RelExpr)30, (lld::elf::RelExpr)31, (lld::elf::RelExpr)25, (lld::elf::RelExpr)33>::build()
Line
Count
Source
108
608
  static inline uint64_t build() {
109
608
    static_assert(0 <= Head && Head < 64,
110
608
                  "RelExpr is too large for 64-bit mask!");
111
608
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
608
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)8, (lld::elf::RelExpr)15, (lld::elf::RelExpr)30, (lld::elf::RelExpr)31, (lld::elf::RelExpr)25, (lld::elf::RelExpr)33>::build()
Line
Count
Source
108
608
  static inline uint64_t build() {
109
608
    static_assert(0 <= Head && Head < 64,
110
608
                  "RelExpr is too large for 64-bit mask!");
111
608
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
608
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)15, (lld::elf::RelExpr)30, (lld::elf::RelExpr)31, (lld::elf::RelExpr)25, (lld::elf::RelExpr)33>::build()
Line
Count
Source
108
608
  static inline uint64_t build() {
109
608
    static_assert(0 <= Head && Head < 64,
110
608
                  "RelExpr is too large for 64-bit mask!");
111
608
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
608
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)30, (lld::elf::RelExpr)31, (lld::elf::RelExpr)25, (lld::elf::RelExpr)33>::build()
Line
Count
Source
108
608
  static inline uint64_t build() {
109
608
    static_assert(0 <= Head && Head < 64,
110
608
                  "RelExpr is too large for 64-bit mask!");
111
608
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
608
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)31, (lld::elf::RelExpr)25, (lld::elf::RelExpr)33>::build()
Line
Count
Source
108
608
  static inline uint64_t build() {
109
608
    static_assert(0 <= Head && Head < 64,
110
608
                  "RelExpr is too large for 64-bit mask!");
111
608
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
608
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)25, (lld::elf::RelExpr)33>::build()
Line
Count
Source
108
608
  static inline uint64_t build() {
109
608
    static_assert(0 <= Head && Head < 64,
110
608
                  "RelExpr is too large for 64-bit mask!");
111
608
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
608
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)33>::build()
Line
Count
Source
108
608
  static inline uint64_t build() {
109
608
    static_assert(0 <= Head && Head < 64,
110
608
                  "RelExpr is too large for 64-bit mask!");
111
608
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
112
608
  }
113
};
114
115
// Return true if `Expr` is one of `Exprs`.
116
// There are fewer than 64 RelExpr's, so we can represent any set of
117
// RelExpr's as a constant bit mask and test for membership with a
118
// couple cheap bitwise operations.
119
69.1k
template <RelExpr... Exprs> bool isRelExprOneOf(RelExpr Expr) {
120
69.1k
  assert(0 <= Expr && (int)Expr < 64 &&
121
69.1k
         "RelExpr is too large for 64-bit mask!");
122
69.1k
  return (uint64_t(1) << Expr) & RelExprMaskBuilder<Exprs...>::build();
123
69.1k
}
Unexecuted instantiation: bool lld::elf::isRelExprOneOf<(lld::elf::RelExpr)26>(lld::elf::RelExpr)
bool lld::elf::isRelExprOneOf<(lld::elf::RelExpr)14, (lld::elf::RelExpr)24>(lld::elf::RelExpr)
Line
Count
Source
119
13.6k
template <RelExpr... Exprs> bool isRelExprOneOf(RelExpr Expr) {
120
13.6k
  assert(0 <= Expr && (int)Expr < 64 &&
121
13.6k
         "RelExpr is too large for 64-bit mask!");
122
13.6k
  return (uint64_t(1) << Expr) & RelExprMaskBuilder<Exprs...>::build();
123
13.6k
}
bool lld::elf::isRelExprOneOf<(lld::elf::RelExpr)5, (lld::elf::RelExpr)6, (lld::elf::RelExpr)7, (lld::elf::RelExpr)8, (lld::elf::RelExpr)32>(lld::elf::RelExpr)
Line
Count
Source
119
13.6k
template <RelExpr... Exprs> bool isRelExprOneOf(RelExpr Expr) {
120
13.6k
  assert(0 <= Expr && (int)Expr < 64 &&
121
13.6k
         "RelExpr is too large for 64-bit mask!");
122
13.6k
  return (uint64_t(1) << Expr) & RelExprMaskBuilder<Exprs...>::build();
123
13.6k
}
bool lld::elf::isRelExprOneOf<(lld::elf::RelExpr)48, (lld::elf::RelExpr)50, (lld::elf::RelExpr)49>(lld::elf::RelExpr)
Line
Count
Source
119
375
template <RelExpr... Exprs> bool isRelExprOneOf(RelExpr Expr) {
120
375
  assert(0 <= Expr && (int)Expr < 64 &&
121
375
         "RelExpr is too large for 64-bit mask!");
122
375
  return (uint64_t(1) << Expr) & RelExprMaskBuilder<Exprs...>::build();
123
375
}
bool lld::elf::isRelExprOneOf<(lld::elf::RelExpr)55, (lld::elf::RelExpr)56, (lld::elf::RelExpr)59, (lld::elf::RelExpr)58>(lld::elf::RelExpr)
Line
Count
Source
119
353
template <RelExpr... Exprs> bool isRelExprOneOf(RelExpr Expr) {
120
353
  assert(0 <= Expr && (int)Expr < 64 &&
121
353
         "RelExpr is too large for 64-bit mask!");
122
353
  return (uint64_t(1) << Expr) & RelExprMaskBuilder<Exprs...>::build();
123
353
}
bool lld::elf::isRelExprOneOf<(lld::elf::RelExpr)48, (lld::elf::RelExpr)50, (lld::elf::RelExpr)49, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)53>(lld::elf::RelExpr)
Line
Count
Source
119
290
template <RelExpr... Exprs> bool isRelExprOneOf(RelExpr Expr) {
120
290
  assert(0 <= Expr && (int)Expr < 64 &&
121
290
         "RelExpr is too large for 64-bit mask!");
122
290
  return (uint64_t(1) << Expr) & RelExprMaskBuilder<Exprs...>::build();
123
290
}
bool lld::elf::isRelExprOneOf<(lld::elf::RelExpr)4, (lld::elf::RelExpr)9, (lld::elf::RelExpr)12, (lld::elf::RelExpr)11, (lld::elf::RelExpr)10, (lld::elf::RelExpr)54>(lld::elf::RelExpr)
Line
Count
Source
119
223
template <RelExpr... Exprs> bool isRelExprOneOf(RelExpr Expr) {
120
223
  assert(0 <= Expr && (int)Expr < 64 &&
121
223
         "RelExpr is too large for 64-bit mask!");
122
223
  return (uint64_t(1) << Expr) & RelExprMaskBuilder<Exprs...>::build();
123
223
}
bool lld::elf::isRelExprOneOf<(lld::elf::RelExpr)29, (lld::elf::RelExpr)31, (lld::elf::RelExpr)27, (lld::elf::RelExpr)28>(lld::elf::RelExpr)
Line
Count
Source
119
13.3k
template <RelExpr... Exprs> bool isRelExprOneOf(RelExpr Expr) {
120
13.3k
  assert(0 <= Expr && (int)Expr < 64 &&
121
13.3k
         "RelExpr is too large for 64-bit mask!");
122
13.3k
  return (uint64_t(1) << Expr) & RelExprMaskBuilder<Exprs...>::build();
123
13.3k
}
bool lld::elf::isRelExprOneOf<(lld::elf::RelExpr)4, (lld::elf::RelExpr)10, (lld::elf::RelExpr)13, (lld::elf::RelExpr)18, (lld::elf::RelExpr)19, (lld::elf::RelExpr)20, (lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)9>(lld::elf::RelExpr)
Line
Count
Source
119
13.3k
template <RelExpr... Exprs> bool isRelExprOneOf(RelExpr Expr) {
120
13.3k
  assert(0 <= Expr && (int)Expr < 64 &&
121
13.3k
         "RelExpr is too large for 64-bit mask!");
122
13.3k
  return (uint64_t(1) << Expr) & RelExprMaskBuilder<Exprs...>::build();
123
13.3k
}
bool lld::elf::isRelExprOneOf<(lld::elf::RelExpr)9, (lld::elf::RelExpr)10, (lld::elf::RelExpr)13, (lld::elf::RelExpr)57, (lld::elf::RelExpr)18, (lld::elf::RelExpr)15, (lld::elf::RelExpr)19, (lld::elf::RelExpr)20, (lld::elf::RelExpr)17, (lld::elf::RelExpr)21, (lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)5, (lld::elf::RelExpr)6, (lld::elf::RelExpr)29, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)53, (lld::elf::RelExpr)31, (lld::elf::RelExpr)49, (lld::elf::RelExpr)50, (lld::elf::RelExpr)14, (lld::elf::RelExpr)58, (lld::elf::RelExpr)54>(lld::elf::RelExpr)
Line
Count
Source
119
13.3k
template <RelExpr... Exprs> bool isRelExprOneOf(RelExpr Expr) {
120
13.3k
  assert(0 <= Expr && (int)Expr < 64 &&
121
13.3k
         "RelExpr is too large for 64-bit mask!");
122
13.3k
  return (uint64_t(1) << Expr) & RelExprMaskBuilder<Exprs...>::build();
123
13.3k
}
bool lld::elf::isRelExprOneOf<(lld::elf::RelExpr)26, (lld::elf::RelExpr)7, (lld::elf::RelExpr)8, (lld::elf::RelExpr)15, (lld::elf::RelExpr)30, (lld::elf::RelExpr)31, (lld::elf::RelExpr)25, (lld::elf::RelExpr)33>(lld::elf::RelExpr)
Line
Count
Source
119
608
template <RelExpr... Exprs> bool isRelExprOneOf(RelExpr Expr) {
120
608
  assert(0 <= Expr && (int)Expr < 64 &&
121
608
         "RelExpr is too large for 64-bit mask!");
122
608
  return (uint64_t(1) << Expr) & RelExprMaskBuilder<Exprs...>::build();
123
608
}
124
125
// Architecture-neutral representation of relocation.
126
struct Relocation {
127
  RelExpr Expr;
128
  RelType Type;
129
  uint64_t Offset;
130
  int64_t Addend;
131
  Symbol *Sym;
132
};
133
134
struct RelocationOffsetComparator {
135
0
  bool operator()(const Relocation &Lhs, const Relocation &Rhs) {
136
0
    return Lhs.Offset < Rhs.Offset;
137
0
  }
138
139
  // For std::lower_bound, std::upper_bound, std::equal_range.
140
0
  bool operator()(const Relocation &Rel, uint64_t Val) {
141
0
    return Rel.Offset < Val;
142
0
  }
143
144
0
  bool operator()(uint64_t Val, const Relocation &Rel) {
145
0
    return Val < Rel.Offset;
146
0
  }
147
};
148
149
template <class ELFT> void scanRelocations(InputSectionBase &);
150
151
class ThunkSection;
152
class Thunk;
153
struct InputSectionDescription;
154
155
class ThunkCreator {
156
public:
157
  // Return true if Thunks have been added to OutputSections
158
  bool createThunks(ArrayRef<OutputSection *> OutputSections);
159
160
  // The number of completed passes of createThunks this permits us
161
  // to do one time initialization on Pass 0 and put a limit on the
162
  // number of times it can be called to prevent infinite loops.
163
  uint32_t Pass = 0;
164
165
private:
166
  void mergeThunks(ArrayRef<OutputSection *> OutputSections);
167
168
  ThunkSection *getISDThunkSec(OutputSection *OS, InputSection *IS,
169
                               InputSectionDescription *ISD, uint32_t Type,
170
                               uint64_t Src);
171
172
  ThunkSection *getISThunkSec(InputSection *IS);
173
174
  void createInitialThunkSections(ArrayRef<OutputSection *> OutputSections);
175
176
  void forEachInputSectionDescription(
177
      ArrayRef<OutputSection *> OutputSections,
178
      llvm::function_ref<void(OutputSection *, InputSectionDescription *)> Fn);
179
180
  std::pair<Thunk *, bool> getThunk(Symbol &Sym, RelType Type, uint64_t Src);
181
182
  ThunkSection *addThunkSection(OutputSection *OS, InputSectionDescription *,
183
                                uint64_t Off);
184
185
  bool normalizeExistingThunk(Relocation &Rel, uint64_t Src);
186
187
  // Record all the available Thunks for a Symbol
188
  llvm::DenseMap<std::pair<SectionBase *, uint64_t>, std::vector<Thunk *>>
189
      ThunkedSymbolsBySection;
190
  llvm::DenseMap<Symbol *, std::vector<Thunk *>> ThunkedSymbols;
191
192
  // Find a Thunk from the Thunks symbol definition, we can use this to find
193
  // the Thunk from a relocation to the Thunks symbol definition.
194
  llvm::DenseMap<Symbol *, Thunk *> Thunks;
195
196
  // Track InputSections that have an inline ThunkSection placed in front
197
  // an inline ThunkSection may have control fall through to the section below
198
  // so we need to make sure that there is only one of them.
199
  // The Mips LA25 Thunk is an example of an inline ThunkSection.
200
  llvm::DenseMap<InputSection *, ThunkSection *> ThunkedSections;
201
};
202
203
// Return a int64_t to make sure we get the sign extension out of the way as
204
// early as possible.
205
template <class ELFT>
206
36
static inline int64_t getAddend(const typename ELFT::Rel &Rel) {
207
36
  return 0;
208
36
}
DWARF.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)1, false> >(llvm::object::ELFType<(llvm::support::endianness)1, false>::Rel const&)
Line
Count
Source
206
6
static inline int64_t getAddend(const typename ELFT::Rel &Rel) {
207
6
  return 0;
208
6
}
Unexecuted instantiation: DWARF.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)0, false> >(llvm::object::ELFType<(llvm::support::endianness)0, false>::Rel const&)
Unexecuted instantiation: DWARF.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)1, true> >(llvm::object::ELFType<(llvm::support::endianness)1, true>::Rel const&)
Unexecuted instantiation: DWARF.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)0, true> >(llvm::object::ELFType<(llvm::support::endianness)0, true>::Rel const&)
ICF.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)1, false> >(llvm::object::ELFType<(llvm::support::endianness)1, false>::Rel const&)
Line
Count
Source
206
2
static inline int64_t getAddend(const typename ELFT::Rel &Rel) {
207
2
  return 0;
208
2
}
Unexecuted instantiation: ICF.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)0, false> >(llvm::object::ELFType<(llvm::support::endianness)0, false>::Rel const&)
Unexecuted instantiation: ICF.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)1, true> >(llvm::object::ELFType<(llvm::support::endianness)1, true>::Rel const&)
Unexecuted instantiation: ICF.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)0, true> >(llvm::object::ELFType<(llvm::support::endianness)0, true>::Rel const&)
InputSection.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)1, false> >(llvm::object::ELFType<(llvm::support::endianness)1, false>::Rel const&)
Line
Count
Source
206
16
static inline int64_t getAddend(const typename ELFT::Rel &Rel) {
207
16
  return 0;
208
16
}
InputSection.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)0, false> >(llvm::object::ELFType<(llvm::support::endianness)0, false>::Rel const&)
Line
Count
Source
206
12
static inline int64_t getAddend(const typename ELFT::Rel &Rel) {
207
12
  return 0;
208
12
}
Unexecuted instantiation: InputSection.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)1, true> >(llvm::object::ELFType<(llvm::support::endianness)1, true>::Rel const&)
Unexecuted instantiation: InputSection.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)0, true> >(llvm::object::ELFType<(llvm::support::endianness)0, true>::Rel const&)
Unexecuted instantiation: Relocations.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)1, false> >(llvm::object::ELFType<(llvm::support::endianness)1, false>::Rel const&)
Unexecuted instantiation: Relocations.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)0, false> >(llvm::object::ELFType<(llvm::support::endianness)0, false>::Rel const&)
Unexecuted instantiation: Relocations.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)1, true> >(llvm::object::ELFType<(llvm::support::endianness)1, true>::Rel const&)
Unexecuted instantiation: Relocations.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)0, true> >(llvm::object::ELFType<(llvm::support::endianness)0, true>::Rel const&)
209
template <class ELFT>
210
12.9k
static inline int64_t getAddend(const typename ELFT::Rela &Rel) {
211
12.9k
  return Rel.r_addend;
212
12.9k
}
Unexecuted instantiation: DWARF.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)1, false> >(llvm::object::ELFType<(llvm::support::endianness)1, false>::Rela const&)
Unexecuted instantiation: DWARF.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)0, false> >(llvm::object::ELFType<(llvm::support::endianness)0, false>::Rela const&)
DWARF.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)1, true> >(llvm::object::ELFType<(llvm::support::endianness)1, true>::Rela const&)
Line
Count
Source
210
85
static inline int64_t getAddend(const typename ELFT::Rela &Rel) {
211
85
  return Rel.r_addend;
212
85
}
Unexecuted instantiation: DWARF.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)0, true> >(llvm::object::ELFType<(llvm::support::endianness)0, true>::Rela const&)
Unexecuted instantiation: ICF.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)1, false> >(llvm::object::ELFType<(llvm::support::endianness)1, false>::Rela const&)
Unexecuted instantiation: ICF.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)0, false> >(llvm::object::ELFType<(llvm::support::endianness)0, false>::Rela const&)
ICF.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)1, true> >(llvm::object::ELFType<(llvm::support::endianness)1, true>::Rela const&)
Line
Count
Source
210
48
static inline int64_t getAddend(const typename ELFT::Rela &Rel) {
211
48
  return Rel.r_addend;
212
48
}
Unexecuted instantiation: ICF.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)0, true> >(llvm::object::ELFType<(llvm::support::endianness)0, true>::Rela const&)
Unexecuted instantiation: InputSection.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)1, false> >(llvm::object::ELFType<(llvm::support::endianness)1, false>::Rela const&)
Unexecuted instantiation: InputSection.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)0, false> >(llvm::object::ELFType<(llvm::support::endianness)0, false>::Rela const&)
InputSection.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)1, true> >(llvm::object::ELFType<(llvm::support::endianness)1, true>::Rela const&)
Line
Count
Source
210
263
static inline int64_t getAddend(const typename ELFT::Rela &Rel) {
211
263
  return Rel.r_addend;
212
263
}
InputSection.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)0, true> >(llvm::object::ELFType<(llvm::support::endianness)0, true>::Rela const&)
Line
Count
Source
210
4
static inline int64_t getAddend(const typename ELFT::Rela &Rel) {
211
4
  return Rel.r_addend;
212
4
}
Relocations.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)1, false> >(llvm::object::ELFType<(llvm::support::endianness)1, false>::Rela const&)
Line
Count
Source
210
102
static inline int64_t getAddend(const typename ELFT::Rela &Rel) {
211
102
  return Rel.r_addend;
212
102
}
Relocations.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)0, false> >(llvm::object::ELFType<(llvm::support::endianness)0, false>::Rela const&)
Line
Count
Source
210
13
static inline int64_t getAddend(const typename ELFT::Rela &Rel) {
211
13
  return Rel.r_addend;
212
13
}
Relocations.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)1, true> >(llvm::object::ELFType<(llvm::support::endianness)1, true>::Rela const&)
Line
Count
Source
210
2.10k
static inline int64_t getAddend(const typename ELFT::Rela &Rel) {
211
2.10k
  return Rel.r_addend;
212
2.10k
}
Relocations.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)0, true> >(llvm::object::ELFType<(llvm::support::endianness)0, true>::Rela const&)
Line
Count
Source
210
10.3k
static inline int64_t getAddend(const typename ELFT::Rela &Rel) {
211
10.3k
  return Rel.r_addend;
212
10.3k
}
213
} // namespace elf
214
} // namespace lld
215
216
#endif