Coverage Report

Created: 2018-10-23 15:26

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