Coverage Report

Created: 2017-10-03 07:32

/Users/buildslave/jenkins/sharedspace/clang-stage2-coverage-R@2/llvm/include/llvm/Support/Errno.h
Line
Count
Source
1
//===- llvm/Support/Errno.h - Portable+convenient errno handling -*- C++ -*-===//
2
//
3
//                     The LLVM Compiler Infrastructure
4
//
5
// This file is distributed under the University of Illinois Open Source
6
// License. See LICENSE.TXT for details.
7
//
8
//===----------------------------------------------------------------------===//
9
//
10
// This file declares some portable and convenient functions to deal with errno.
11
//
12
//===----------------------------------------------------------------------===//
13
14
#ifndef LLVM_SUPPORT_ERRNO_H
15
#define LLVM_SUPPORT_ERRNO_H
16
17
#include <cerrno>
18
#include <string>
19
#include <type_traits>
20
21
namespace llvm {
22
namespace sys {
23
24
/// Returns a string representation of the errno value, using whatever
25
/// thread-safe variant of strerror() is available.  Be sure to call this
26
/// immediately after the function that set errno, or errno may have been
27
/// overwritten by an intervening call.
28
std::string StrError();
29
30
/// Like the no-argument version above, but uses \p errnum instead of errno.
31
std::string StrError(int errnum);
32
33
template <typename FailT, typename Fun, typename... Args>
34
inline auto RetryAfterSignal(const FailT &Fail, const Fun &F,
35
1.63M
                             const Args &... As) -> decltype(F(As...)) {
36
1.63M
  decltype(F(As...)) Res;
37
1.63M
  do
38
1.63M
    Res = F(As...);
39
1.63M
  while (
Res == Fail && errno1.63M
== EINTR272k
);
40
1.63M
  return Res;
41
1.63M
}
decltype(fp0(fp1)) llvm::sys::RetryAfterSignal<int, long (int, void*, unsigned long, long long), int, char*, unsigned long, unsigned long long>(int const&, long  const(&)(int, void*, unsigned long, long long), int const&, char* const&, unsigned long const&, unsigned long long const&)
Line
Count
Source
35
502k
                             const Args &... As) -> decltype(F(As...)) {
36
502k
  decltype(F(As...)) Res;
37
502k
  do
38
502k
    Res = F(As...);
39
502k
  while (
Res == Fail && errno502k
== EINTR0
);
40
502k
  return Res;
41
502k
}
decltype(fp0(fp1)) llvm::sys::RetryAfterSignal<int, long (int, void*, unsigned long), int, char*, long>(int const&, long  const(&)(int, void*, unsigned long), int const&, char* const&, long const&)
Line
Count
Source
35
68.7k
                             const Args &... As) -> decltype(F(As...)) {
36
68.7k
  decltype(F(As...)) Res;
37
68.7k
  do
38
68.7k
    Res = F(As...);
39
68.7k
  while (
Res == Fail && errno68.7k
== EINTR0
);
40
68.7k
  return Res;
41
68.7k
}
decltype(fp0(fp1)) llvm::sys::RetryAfterSignal<int, int (char const*, int, ...), char const*, int>(int const&, int  const(&)(char const*, int, ...), char const* const&, int const&)
Line
Count
Source
35
834k
                             const Args &... As) -> decltype(F(As...)) {
36
834k
  decltype(F(As...)) Res;
37
834k
  do
38
834k
    Res = F(As...);
39
834k
  while (
Res == Fail && errno834k
== EINTR271k
);
40
834k
  return Res;
41
834k
}
decltype(fp0(fp1)) llvm::sys::RetryAfterSignal<int, int (char const*, int, ...), char const*, int, unsigned int>(int const&, int  const(&)(char const*, int, ...), char const* const&, int const&, unsigned int const&)
Line
Count
Source
35
44.6k
                             const Args &... As) -> decltype(F(As...)) {
36
44.6k
  decltype(F(As...)) Res;
37
44.6k
  do
38
44.6k
    Res = F(As...);
39
44.6k
  while (
Res == Fail && errno44.6k
== EINTR396
);
40
44.6k
  return Res;
41
44.6k
}
decltype(fp0(fp1)) llvm::sys::RetryAfterSignal<int, int (int, stat*), int, stat*>(int const&, int  const(&)(int, stat*), int const&, stat* const&)
Line
Count
Source
35
185k
                             const Args &... As) -> decltype(F(As...)) {
36
185k
  decltype(F(As...)) Res;
37
185k
  do
38
185k
    Res = F(As...);
39
185k
  while (
Res == Fail && errno185k
== EINTR0
);
40
185k
  return Res;
41
185k
}
Unexecuted instantiation: decltype(fp0(fp1)) llvm::sys::RetryAfterSignal<int, int (char const*, int, ...), char [10], int>(int const&, int  const(&)(char const*, int, ...), char const (&) [10], int const&)
42
43
}  // namespace sys
44
}  // namespace llvm
45
46
#endif  // LLVM_SYSTEM_ERRNO_H