Coverage Report

Created: 2019-02-06 17:31

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/lld/ELF/Bits.h
Line
Count
Source
1
//===- Bits.h ---------------------------------------------------*- C++ -*-===//
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
#ifndef LLD_ELF_BITS_H
10
#define LLD_ELF_BITS_H
11
12
#include "Config.h"
13
#include "llvm/Support/Endian.h"
14
15
namespace lld {
16
namespace elf {
17
18
1.12k
inline uint64_t readUint(uint8_t *Buf) {
19
1.12k
  if (Config->Is64)
20
964
    return llvm::support::endian::read64(Buf, Config->Endianness);
21
158
  return llvm::support::endian::read32(Buf, Config->Endianness);
22
158
}
23
24
11.4k
inline void writeUint(uint8_t *Buf, uint64_t Val) {
25
11.4k
  if (Config->Is64)
26
11.0k
    llvm::support::endian::write64(Buf, Val, Config->Endianness);
27
377
  else
28
377
    llvm::support::endian::write32(Buf, Val, Config->Endianness);
29
11.4k
}
30
31
} // namespace elf
32
} // namespace lld
33
34
#endif