Coverage Report

Created: 2018-01-17 21:32

/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
429
inline uint64_t readUint(uint8_t *Buf) {
20
429
  if (Config->Is64)
21
352
    return llvm::support::endian::read64(Buf, Config->Endianness);
22
77
  return llvm::support::endian::read32(Buf, Config->Endianness);
23
77
}
24
25
10.5k
inline void writeUint(uint8_t *Buf, uint64_t Val) {
26
10.5k
  if (Config->Is64)
27
10.3k
    llvm::support::endian::write64(Buf, Val, Config->Endianness);
28
170
  else
29
170
    llvm::support::endian::write32(Buf, Val, Config->Endianness);
30
10.5k
}
31
32
} // namespace elf
33
} // namespace lld
34
35
#endif