Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/include/llvm/Support/ErrorOr.h
Line
Count
Source (jump to first uncovered line)
1
//===- llvm/Support/ErrorOr.h - Error Smart Pointer -------------*- 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
/// \file
10
///
11
/// Provides ErrorOr<T> smart pointer.
12
///
13
//===----------------------------------------------------------------------===//
14
15
#ifndef LLVM_SUPPORT_ERROROR_H
16
#define LLVM_SUPPORT_ERROROR_H
17
18
#include "llvm/Support/AlignOf.h"
19
#include <cassert>
20
#include <system_error>
21
#include <type_traits>
22
#include <utility>
23
24
namespace llvm {
25
26
/// Represents either an error or a value T.
27
///
28
/// ErrorOr<T> is a pointer-like class that represents the result of an
29
/// operation. The result is either an error, or a value of type T. This is
30
/// designed to emulate the usage of returning a pointer where nullptr indicates
31
/// failure. However instead of just knowing that the operation failed, we also
32
/// have an error_code and optional user data that describes why it failed.
33
///
34
/// It is used like the following.
35
/// \code
36
///   ErrorOr<Buffer> getBuffer();
37
///
38
///   auto buffer = getBuffer();
39
///   if (error_code ec = buffer.getError())
40
///     return ec;
41
///   buffer->write("adena");
42
/// \endcode
43
///
44
///
45
/// Implicit conversion to bool returns true if there is a usable value. The
46
/// unary * and -> operators provide pointer like access to the value. Accessing
47
/// the value when there is an error has undefined behavior.
48
///
49
/// When T is a reference type the behavior is slightly different. The reference
50
/// is held in a std::reference_wrapper<std::remove_reference<T>::type>, and
51
/// there is special handling to make operator -> work as if T was not a
52
/// reference.
53
///
54
/// T cannot be a rvalue reference.
55
template<class T>
56
class ErrorOr {
57
  template <class OtherT> friend class ErrorOr;
58
59
  static const bool isRef = std::is_reference<T>::value;
60
61
  using wrap = std::reference_wrapper<typename std::remove_reference<T>::type>;
62
63
public:
64
  using storage_type = typename std::conditional<isRef, wrap, T>::type;
65
66
private:
67
  using reference = typename std::remove_reference<T>::type &;
68
  using const_reference = const typename std::remove_reference<T>::type &;
69
  using pointer = typename std::remove_reference<T>::type *;
70
  using const_pointer = const typename std::remove_reference<T>::type *;
71
72
public:
73
  template <class E>
74
  ErrorOr(E ErrorCode,
75
          typename std::enable_if<std::is_error_code_enum<E>::value ||
76
                                      std::is_error_condition_enum<E>::value,
77
                                  void *>::type = nullptr)
78
284k
      : HasError(true) {
79
284k
    new (getErrorStorage()) std::error_code(make_error_code(ErrorCode));
80
284k
  }
llvm::ErrorOr<llvm::vfs::detail::InMemoryNode const*>::ErrorOr<llvm::errc>(llvm::errc, std::__1::enable_if<(std::is_error_code_enum<llvm::errc>::value) || (std::is_error_condition_enum<llvm::errc>::value), void*>::type)
Line
Count
Source
78
248k
      : HasError(true) {
79
248k
    new (getErrorStorage()) std::error_code(make_error_code(ErrorCode));
80
248k
  }
llvm::ErrorOr<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::ErrorOr<llvm::errc>(llvm::errc, std::__1::enable_if<(std::is_error_code_enum<llvm::errc>::value) || (std::is_error_condition_enum<llvm::errc>::value), void*>::type)
Line
Count
Source
78
36.2k
      : HasError(true) {
79
36.2k
    new (getErrorStorage()) std::error_code(make_error_code(ErrorCode));
80
36.2k
  }
Unexecuted instantiation: llvm::ErrorOr<clang::PrecompiledPreamble>::ErrorOr<clang::BuildPreambleError>(clang::BuildPreambleError, std::__1::enable_if<(std::is_error_code_enum<clang::BuildPreambleError>::value) || (std::is_error_condition_enum<clang::BuildPreambleError>::value), void*>::type)
Unexecuted instantiation: llvm::ErrorOr<clang::serialized_diags::SerializedDiagnosticReader::Cursor>::ErrorOr<clang::serialized_diags::SDError>(clang::serialized_diags::SDError, std::__1::enable_if<(std::is_error_code_enum<clang::serialized_diags::SDError>::value) || (std::is_error_condition_enum<clang::serialized_diags::SDError>::value), void*>::type)
Unexecuted instantiation: llvm::ErrorOr<std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> > >::ErrorOr<llvm::sampleprof_error>(llvm::sampleprof_error, std::__1::enable_if<(std::is_error_code_enum<llvm::sampleprof_error>::value) || (std::is_error_condition_enum<llvm::sampleprof_error>::value), void*>::type)
Unexecuted instantiation: llvm::ErrorOr<unsigned int>::ErrorOr<llvm::sampleprof_error>(llvm::sampleprof_error, std::__1::enable_if<(std::is_error_code_enum<llvm::sampleprof_error>::value) || (std::is_error_condition_enum<llvm::sampleprof_error>::value), void*>::type)
Unexecuted instantiation: llvm::ErrorOr<llvm::StringRef>::ErrorOr<llvm::sampleprof_error>(llvm::sampleprof_error, std::__1::enable_if<(std::is_error_code_enum<llvm::sampleprof_error>::value) || (std::is_error_condition_enum<llvm::sampleprof_error>::value), void*>::type)
llvm::ErrorOr<std::__1::unique_ptr<llvm::sampleprof::SampleProfileReader, std::__1::default_delete<llvm::sampleprof::SampleProfileReader> > >::ErrorOr<llvm::sampleprof_error>(llvm::sampleprof_error, std::__1::enable_if<(std::is_error_code_enum<llvm::sampleprof_error>::value) || (std::is_error_condition_enum<llvm::sampleprof_error>::value), void*>::type)
Line
Count
Source
78
3
      : HasError(true) {
79
3
    new (getErrorStorage()) std::error_code(make_error_code(ErrorCode));
80
3
  }
81
82
2.15M
  ErrorOr(std::error_code EC) : HasError(true) {
83
2.15M
    new (getErrorStorage()) std::error_code(EC);
84
2.15M
  }
llvm::ErrorOr<llvm::StringMap<unsigned long long, llvm::MallocAllocator> >::ErrorOr(std::__1::error_code)
Line
Count
Source
82
19
  ErrorOr(std::error_code EC) : HasError(true) {
83
19
    new (getErrorStorage()) std::error_code(EC);
84
19
  }
llvm::ErrorOr<unsigned long long>::ErrorOr(std::__1::error_code)
Line
Count
Source
82
1.19k
  ErrorOr(std::error_code EC) : HasError(true) {
83
1.19k
    new (getErrorStorage()) std::error_code(EC);
84
1.19k
  }
Unexecuted instantiation: llvm::ErrorOr<std::__1::unique_ptr<llvm::WritableMemoryBuffer, std::__1::default_delete<llvm::WritableMemoryBuffer> > >::ErrorOr(std::__1::error_code)
Unexecuted instantiation: llvm::ErrorOr<std::__1::unique_ptr<llvm::WriteThroughMemoryBuffer, std::__1::default_delete<llvm::WriteThroughMemoryBuffer> > >::ErrorOr(std::__1::error_code)
llvm::ErrorOr<std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> > >::ErrorOr(std::__1::error_code)
Line
Count
Source
82
379k
  ErrorOr(std::error_code EC) : HasError(true) {
83
379k
    new (getErrorStorage()) std::error_code(EC);
84
379k
  }
llvm::ErrorOr<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::ErrorOr(std::__1::error_code)
Line
Count
Source
82
161
  ErrorOr(std::error_code EC) : HasError(true) {
83
161
    new (getErrorStorage()) std::error_code(EC);
84
161
  }
llvm::ErrorOr<llvm::vfs::Status>::ErrorOr(std::__1::error_code)
Line
Count
Source
82
1.12M
  ErrorOr(std::error_code EC) : HasError(true) {
83
1.12M
    new (getErrorStorage()) std::error_code(EC);
84
1.12M
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::vfs::File, std::__1::default_delete<llvm::vfs::File> > >::ErrorOr(std::__1::error_code)
Line
Count
Source
82
626k
  ErrorOr(std::error_code EC) : HasError(true) {
83
626k
    new (getErrorStorage()) std::error_code(EC);
84
626k
  }
llvm::ErrorOr<llvm::vfs::RedirectingFileSystem::Entry*>::ErrorOr(std::__1::error_code)
Line
Count
Source
82
19.7k
  ErrorOr(std::error_code EC) : HasError(true) {
83
19.7k
    new (getErrorStorage()) std::error_code(EC);
84
19.7k
  }
Unexecuted instantiation: llvm::ErrorOr<llvm::MD5::MD5Result>::ErrorOr(std::__1::error_code)
Unexecuted instantiation: llvm::ErrorOr<llvm::sys::fs::perms>::ErrorOr(std::__1::error_code)
Unexecuted instantiation: llvm::ErrorOr<llvm::sys::fs::space_info>::ErrorOr(std::__1::error_code)
llvm::ErrorOr<llvm::sys::fs::basic_file_status>::ErrorOr(std::__1::error_code)
Line
Count
Source
82
13
  ErrorOr(std::error_code EC) : HasError(true) {
83
13
    new (getErrorStorage()) std::error_code(EC);
84
13
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::Module, std::__1::default_delete<llvm::Module> > >::ErrorOr(std::__1::error_code)
Line
Count
Source
82
1
  ErrorOr(std::error_code EC) : HasError(true) {
83
1
    new (getErrorStorage()) std::error_code(EC);
84
1
  }
Unexecuted instantiation: llvm::ErrorOr<clang::PrecompiledPreamble>::ErrorOr(std::__1::error_code)
Unexecuted instantiation: llvm::ErrorOr<clang::PrecompiledPreamble::TempPCHFile>::ErrorOr(std::__1::error_code)
Unexecuted instantiation: llvm::ErrorOr<clang::serialized_diags::SerializedDiagnosticReader::Cursor>::ErrorOr(std::__1::error_code)
Unexecuted instantiation: llvm::ErrorOr<llvm::StringRef>::ErrorOr(std::__1::error_code)
Unexecuted instantiation: llvm::ErrorOr<unsigned int>::ErrorOr(std::__1::error_code)
llvm::ErrorOr<std::__1::unique_ptr<llvm::sampleprof::SampleProfileReader, std::__1::default_delete<llvm::sampleprof::SampleProfileReader> > >::ErrorOr(std::__1::error_code)
Line
Count
Source
82
2
  ErrorOr(std::error_code EC) : HasError(true) {
83
2
    new (getErrorStorage()) std::error_code(EC);
84
2
  }
85
86
  template <class OtherT>
87
  ErrorOr(OtherT &&Val,
88
          typename std::enable_if<std::is_convertible<OtherT, T>::value>::type
89
              * = nullptr)
90
3.48M
      : HasError(false) {
91
3.48M
    new (getStorage()) storage_type(std::forward<OtherT>(Val));
92
3.48M
  }
llvm::ErrorOr<llvm::StringMap<unsigned long long, llvm::MallocAllocator> >::ErrorOr<llvm::StringMap<unsigned long long, llvm::MallocAllocator> const&>(llvm::StringMap<unsigned long long, llvm::MallocAllocator> const&&&, std::__1::enable_if<std::is_convertible<llvm::StringMap<unsigned long long, llvm::MallocAllocator> const&, llvm::StringMap<unsigned long long, llvm::MallocAllocator> >::value, void>::type*)
Line
Count
Source
90
53
      : HasError(false) {
91
53
    new (getStorage()) storage_type(std::forward<OtherT>(Val));
92
53
  }
llvm::ErrorOr<unsigned long long>::ErrorOr<int>(int&&, std::__1::enable_if<std::is_convertible<int, unsigned long long>::value, void>::type*)
Line
Count
Source
90
17
      : HasError(false) {
91
17
    new (getStorage()) storage_type(std::forward<OtherT>(Val));
92
17
  }
llvm::ErrorOr<unsigned long long>::ErrorOr<unsigned long long>(unsigned long long&&, std::__1::enable_if<std::is_convertible<unsigned long long, unsigned long long>::value, void>::type*)
Line
Count
Source
90
3.17k
      : HasError(false) {
91
3.17k
    new (getStorage()) storage_type(std::forward<OtherT>(Val));
92
3.17k
  }
llvm::ErrorOr<unsigned long long>::ErrorOr<unsigned long long&>(unsigned long long&&&, std::__1::enable_if<std::is_convertible<unsigned long long&, unsigned long long>::value, void>::type*)
Line
Count
Source
90
249
      : HasError(false) {
91
249
    new (getStorage()) storage_type(std::forward<OtherT>(Val));
92
249
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::WritableMemoryBuffer, std::__1::default_delete<llvm::WritableMemoryBuffer> > >::ErrorOr<std::__1::unique_ptr<llvm::WritableMemoryBuffer, std::__1::default_delete<llvm::WritableMemoryBuffer> > >(std::__1::unique_ptr<llvm::WritableMemoryBuffer, std::__1::default_delete<llvm::WritableMemoryBuffer> >&&, std::__1::enable_if<std::is_convertible<std::__1::unique_ptr<llvm::WritableMemoryBuffer, std::__1::default_delete<llvm::WritableMemoryBuffer> >, std::__1::unique_ptr<llvm::WritableMemoryBuffer, std::__1::default_delete<llvm::WritableMemoryBuffer> > >::value, void>::type*)
Line
Count
Source
90
312k
      : HasError(false) {
91
312k
    new (getStorage()) storage_type(std::forward<OtherT>(Val));
92
312k
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::WriteThroughMemoryBuffer, std::__1::default_delete<llvm::WriteThroughMemoryBuffer> > >::ErrorOr<std::__1::unique_ptr<llvm::WriteThroughMemoryBuffer, std::__1::default_delete<llvm::WriteThroughMemoryBuffer> > >(std::__1::unique_ptr<llvm::WriteThroughMemoryBuffer, std::__1::default_delete<llvm::WriteThroughMemoryBuffer> >&&, std::__1::enable_if<std::is_convertible<std::__1::unique_ptr<llvm::WriteThroughMemoryBuffer, std::__1::default_delete<llvm::WriteThroughMemoryBuffer> >, std::__1::unique_ptr<llvm::WriteThroughMemoryBuffer, std::__1::default_delete<llvm::WriteThroughMemoryBuffer> > >::value, void>::type*)
Line
Count
Source
90
1
      : HasError(false) {
91
1
    new (getStorage()) storage_type(std::forward<OtherT>(Val));
92
1
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> > >::ErrorOr<std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> > >(std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> >&&, std::__1::enable_if<std::is_convertible<std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> >, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> > >::value, void>::type*)
Line
Count
Source
90
124k
      : HasError(false) {
91
124k
    new (getStorage()) storage_type(std::forward<OtherT>(Val));
92
124k
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> > >::ErrorOr<std::__1::unique_ptr<llvm::WritableMemoryBuffer, std::__1::default_delete<llvm::WritableMemoryBuffer> > >(std::__1::unique_ptr<llvm::WritableMemoryBuffer, std::__1::default_delete<llvm::WritableMemoryBuffer> >&&, std::__1::enable_if<std::is_convertible<std::__1::unique_ptr<llvm::WritableMemoryBuffer, std::__1::default_delete<llvm::WritableMemoryBuffer> >, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> > >::value, void>::type*)
Line
Count
Source
90
483k
      : HasError(false) {
91
483k
    new (getStorage()) storage_type(std::forward<OtherT>(Val));
92
483k
  }
llvm::ErrorOr<llvm::vfs::Status>::ErrorOr<llvm::vfs::Status&>(llvm::vfs::Status&&&, std::__1::enable_if<std::is_convertible<llvm::vfs::Status&, llvm::vfs::Status>::value, void>::type*)
Line
Count
Source
90
499k
      : HasError(false) {
91
499k
    new (getStorage()) storage_type(std::forward<OtherT>(Val));
92
499k
  }
llvm::ErrorOr<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::ErrorOr<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, std::__1::enable_if<std::is_convertible<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value, void>::type*)
Line
Count
Source
90
508k
      : HasError(false) {
91
508k
    new (getStorage()) storage_type(std::forward<OtherT>(Val));
92
508k
  }
llvm::ErrorOr<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::ErrorOr<llvm::StringRef>(llvm::StringRef&&, std::__1::enable_if<std::is_convertible<llvm::StringRef, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value, void>::type*)
Line
Count
Source
90
71.8k
      : HasError(false) {
91
71.8k
    new (getStorage()) storage_type(std::forward<OtherT>(Val));
92
71.8k
  }
llvm::ErrorOr<llvm::vfs::detail::InMemoryNode const*>::ErrorOr<llvm::vfs::detail::InMemoryDirectory*>(llvm::vfs::detail::InMemoryDirectory*&&, std::__1::enable_if<std::is_convertible<llvm::vfs::detail::InMemoryDirectory*, llvm::vfs::detail::InMemoryNode const*>::value, void>::type*)
Line
Count
Source
90
50.5k
      : HasError(false) {
91
50.5k
    new (getStorage()) storage_type(std::forward<OtherT>(Val));
92
50.5k
  }
llvm::ErrorOr<llvm::vfs::detail::InMemoryNode const*>::ErrorOr<llvm::vfs::detail::InMemoryFile*>(llvm::vfs::detail::InMemoryFile*&&, std::__1::enable_if<std::is_convertible<llvm::vfs::detail::InMemoryFile*, llvm::vfs::detail::InMemoryNode const*>::value, void>::type*)
Line
Count
Source
90
104k
      : HasError(false) {
91
104k
    new (getStorage()) storage_type(std::forward<OtherT>(Val));
92
104k
  }
llvm::ErrorOr<llvm::vfs::detail::InMemoryNode const*>::ErrorOr<llvm::vfs::detail::InMemoryFile const*>(llvm::vfs::detail::InMemoryFile const*&&, std::__1::enable_if<std::is_convertible<llvm::vfs::detail::InMemoryFile const*, llvm::vfs::detail::InMemoryNode const*>::value, void>::type*)
Line
Count
Source
90
9
      : HasError(false) {
91
9
    new (getStorage()) storage_type(std::forward<OtherT>(Val));
92
9
  }
llvm::ErrorOr<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::ErrorOr<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&&&, std::__1::enable_if<std::is_convertible<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value, void>::type*)
Line
Count
Source
90
301k
      : HasError(false) {
91
301k
    new (getStorage()) storage_type(std::forward<OtherT>(Val));
92
301k
  }
llvm::ErrorOr<llvm::vfs::Status>::ErrorOr<llvm::vfs::Status>(llvm::vfs::Status&&, std::__1::enable_if<std::is_convertible<llvm::vfs::Status, llvm::vfs::Status>::value, void>::type*)
Line
Count
Source
90
453k
      : HasError(false) {
91
453k
    new (getStorage()) storage_type(std::forward<OtherT>(Val));
92
453k
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::vfs::File, std::__1::default_delete<llvm::vfs::File> > >::ErrorOr<std::__1::unique_ptr<llvm::vfs::File, std::__1::default_delete<llvm::vfs::File> > >(std::__1::unique_ptr<llvm::vfs::File, std::__1::default_delete<llvm::vfs::File> >&&, std::__1::enable_if<std::is_convertible<std::__1::unique_ptr<llvm::vfs::File, std::__1::default_delete<llvm::vfs::File> >, std::__1::unique_ptr<llvm::vfs::File, std::__1::default_delete<llvm::vfs::File> > >::value, void>::type*)
Line
Count
Source
90
569k
      : HasError(false) {
91
569k
    new (getStorage()) storage_type(std::forward<OtherT>(Val));
92
569k
  }
llvm::ErrorOr<llvm::vfs::RedirectingFileSystem::Entry*>::ErrorOr<llvm::vfs::RedirectingFileSystem::Entry*>(llvm::vfs::RedirectingFileSystem::Entry*&&, std::__1::enable_if<std::is_convertible<llvm::vfs::RedirectingFileSystem::Entry*, llvm::vfs::RedirectingFileSystem::Entry*>::value, void>::type*)
Line
Count
Source
90
624
      : HasError(false) {
91
624
    new (getStorage()) storage_type(std::forward<OtherT>(Val));
92
624
  }
llvm::ErrorOr<llvm::MD5::MD5Result>::ErrorOr<llvm::MD5::MD5Result>(llvm::MD5::MD5Result&&, std::__1::enable_if<std::is_convertible<llvm::MD5::MD5Result, llvm::MD5::MD5Result>::value, void>::type*)
Line
Count
Source
90
1
      : HasError(false) {
91
1
    new (getStorage()) storage_type(std::forward<OtherT>(Val));
92
1
  }
llvm::ErrorOr<llvm::sys::fs::perms>::ErrorOr<llvm::sys::fs::perms>(llvm::sys::fs::perms&&, std::__1::enable_if<std::is_convertible<llvm::sys::fs::perms, llvm::sys::fs::perms>::value, void>::type*)
Line
Count
Source
90
29
      : HasError(false) {
91
29
    new (getStorage()) storage_type(std::forward<OtherT>(Val));
92
29
  }
llvm::ErrorOr<llvm::sys::fs::space_info>::ErrorOr<llvm::sys::fs::space_info>(llvm::sys::fs::space_info&&, std::__1::enable_if<std::is_convertible<llvm::sys::fs::space_info, llvm::sys::fs::space_info>::value, void>::type*)
Line
Count
Source
90
20
      : HasError(false) {
91
20
    new (getStorage()) storage_type(std::forward<OtherT>(Val));
92
20
  }
llvm::ErrorOr<llvm::sys::fs::basic_file_status>::ErrorOr<llvm::sys::fs::file_status>(llvm::sys::fs::file_status&&, std::__1::enable_if<std::is_convertible<llvm::sys::fs::file_status, llvm::sys::fs::basic_file_status>::value, void>::type*)
Line
Count
Source
90
140
      : HasError(false) {
91
140
    new (getStorage()) storage_type(std::forward<OtherT>(Val));
92
140
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::Module, std::__1::default_delete<llvm::Module> > >::ErrorOr<std::__1::unique_ptr<llvm::Module, std::__1::default_delete<llvm::Module> > >(std::__1::unique_ptr<llvm::Module, std::__1::default_delete<llvm::Module> >&&, std::__1::enable_if<std::is_convertible<std::__1::unique_ptr<llvm::Module, std::__1::default_delete<llvm::Module> >, std::__1::unique_ptr<llvm::Module, std::__1::default_delete<llvm::Module> > >::value, void>::type*)
Line
Count
Source
90
400
      : HasError(false) {
91
400
    new (getStorage()) storage_type(std::forward<OtherT>(Val));
92
400
  }
llvm::ErrorOr<clang::PrecompiledPreamble>::ErrorOr<clang::PrecompiledPreamble>(clang::PrecompiledPreamble&&, std::__1::enable_if<std::is_convertible<clang::PrecompiledPreamble, clang::PrecompiledPreamble>::value, void>::type*)
Line
Count
Source
90
88
      : HasError(false) {
91
88
    new (getStorage()) storage_type(std::forward<OtherT>(Val));
92
88
  }
llvm::ErrorOr<clang::PrecompiledPreamble::TempPCHFile>::ErrorOr<clang::PrecompiledPreamble::TempPCHFile>(clang::PrecompiledPreamble::TempPCHFile&&, std::__1::enable_if<std::is_convertible<clang::PrecompiledPreamble::TempPCHFile, clang::PrecompiledPreamble::TempPCHFile>::value, void>::type*)
Line
Count
Source
90
88
      : HasError(false) {
91
88
    new (getStorage()) storage_type(std::forward<OtherT>(Val));
92
88
  }
llvm::ErrorOr<clang::serialized_diags::SerializedDiagnosticReader::Cursor>::ErrorOr<clang::serialized_diags::SerializedDiagnosticReader::Cursor>(clang::serialized_diags::SerializedDiagnosticReader::Cursor&&, std::__1::enable_if<std::is_convertible<clang::serialized_diags::SerializedDiagnosticReader::Cursor, clang::serialized_diags::SerializedDiagnosticReader::Cursor>::value, void>::type*)
Line
Count
Source
90
328
      : HasError(false) {
91
328
    new (getStorage()) storage_type(std::forward<OtherT>(Val));
92
328
  }
llvm::ErrorOr<llvm::StringRef>::ErrorOr<llvm::StringRef>(llvm::StringRef&&, std::__1::enable_if<std::is_convertible<llvm::StringRef, llvm::StringRef>::value, void>::type*)
Line
Count
Source
90
130
      : HasError(false) {
91
130
    new (getStorage()) storage_type(std::forward<OtherT>(Val));
92
130
  }
llvm::ErrorOr<unsigned int>::ErrorOr<unsigned int&>(unsigned int&&&, std::__1::enable_if<std::is_convertible<unsigned int&, unsigned int>::value, void>::type*)
Line
Count
Source
90
160
      : HasError(false) {
91
160
    new (getStorage()) storage_type(std::forward<OtherT>(Val));
92
160
  }
llvm::ErrorOr<llvm::StringRef>::ErrorOr<llvm::StringRef&>(llvm::StringRef&&&, std::__1::enable_if<std::is_convertible<llvm::StringRef&, llvm::StringRef>::value, void>::type*)
Line
Count
Source
90
102
      : HasError(false) {
91
102
    new (getStorage()) storage_type(std::forward<OtherT>(Val));
92
102
  }
llvm::ErrorOr<unsigned int>::ErrorOr<unsigned int>(unsigned int&&, std::__1::enable_if<std::is_convertible<unsigned int, unsigned int>::value, void>::type*)
Line
Count
Source
90
594
      : HasError(false) {
91
594
    new (getStorage()) storage_type(std::forward<OtherT>(Val));
92
594
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::sampleprof::SampleProfileReader, std::__1::default_delete<llvm::sampleprof::SampleProfileReader> > >::ErrorOr<std::__1::unique_ptr<llvm::sampleprof::SampleProfileReaderItaniumRemapper, std::__1::default_delete<llvm::sampleprof::SampleProfileReaderItaniumRemapper> > >(std::__1::unique_ptr<llvm::sampleprof::SampleProfileReaderItaniumRemapper, std::__1::default_delete<llvm::sampleprof::SampleProfileReaderItaniumRemapper> >&&, std::__1::enable_if<std::is_convertible<std::__1::unique_ptr<llvm::sampleprof::SampleProfileReaderItaniumRemapper, std::__1::default_delete<llvm::sampleprof::SampleProfileReaderItaniumRemapper> >, std::__1::unique_ptr<llvm::sampleprof::SampleProfileReader, std::__1::default_delete<llvm::sampleprof::SampleProfileReader> > >::value, void>::type*)
Line
Count
Source
90
2
      : HasError(false) {
91
2
    new (getStorage()) storage_type(std::forward<OtherT>(Val));
92
2
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::sampleprof::SampleProfileReader, std::__1::default_delete<llvm::sampleprof::SampleProfileReader> > >::ErrorOr<std::__1::unique_ptr<llvm::sampleprof::SampleProfileReader, std::__1::default_delete<llvm::sampleprof::SampleProfileReader> > >(std::__1::unique_ptr<llvm::sampleprof::SampleProfileReader, std::__1::default_delete<llvm::sampleprof::SampleProfileReader> >&&, std::__1::enable_if<std::is_convertible<std::__1::unique_ptr<llvm::sampleprof::SampleProfileReader, std::__1::default_delete<llvm::sampleprof::SampleProfileReader> >, std::__1::unique_ptr<llvm::sampleprof::SampleProfileReader, std::__1::default_delete<llvm::sampleprof::SampleProfileReader> > >::value, void>::type*)
Line
Count
Source
90
163
      : HasError(false) {
91
163
    new (getStorage()) storage_type(std::forward<OtherT>(Val));
92
163
  }
93
94
  ErrorOr(const ErrorOr &Other) {
95
    copyConstruct(Other);
96
  }
97
98
  template <class OtherT>
99
  ErrorOr(
100
      const ErrorOr<OtherT> &Other,
101
      typename std::enable_if<std::is_convertible<OtherT, T>::value>::type * =
102
          nullptr) {
103
    copyConstruct(Other);
104
  }
105
106
  template <class OtherT>
107
  explicit ErrorOr(
108
      const ErrorOr<OtherT> &Other,
109
      typename std::enable_if<
110
          !std::is_convertible<OtherT, const T &>::value>::type * = nullptr) {
111
    copyConstruct(Other);
112
  }
113
114
282k
  ErrorOr(ErrorOr &&Other) {
115
282k
    moveConstruct(std::move(Other));
116
282k
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::sampleprof::SampleProfileReader, std::__1::default_delete<llvm::sampleprof::SampleProfileReader> > >::ErrorOr(llvm::ErrorOr<std::__1::unique_ptr<llvm::sampleprof::SampleProfileReader, std::__1::default_delete<llvm::sampleprof::SampleProfileReader> > >&&)
Line
Count
Source
114
2
  ErrorOr(ErrorOr &&Other) {
115
2
    moveConstruct(std::move(Other));
116
2
  }
llvm::ErrorOr<unsigned long long>::ErrorOr(llvm::ErrorOr<unsigned long long>&&)
Line
Count
Source
114
1.00k
  ErrorOr(ErrorOr &&Other) {
115
1.00k
    moveConstruct(std::move(Other));
116
1.00k
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> > >::ErrorOr(llvm::ErrorOr<std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> > >&&)
Line
Count
Source
114
280k
  ErrorOr(ErrorOr &&Other) {
115
280k
    moveConstruct(std::move(Other));
116
280k
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::WritableMemoryBuffer, std::__1::default_delete<llvm::WritableMemoryBuffer> > >::ErrorOr(llvm::ErrorOr<std::__1::unique_ptr<llvm::WritableMemoryBuffer, std::__1::default_delete<llvm::WritableMemoryBuffer> > >&&)
Line
Count
Source
114
1
  ErrorOr(ErrorOr &&Other) {
115
1
    moveConstruct(std::move(Other));
116
1
  }
llvm::ErrorOr<llvm::vfs::Status>::ErrorOr(llvm::ErrorOr<llvm::vfs::Status>&&)
Line
Count
Source
114
97
  ErrorOr(ErrorOr &&Other) {
115
97
    moveConstruct(std::move(Other));
116
97
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::vfs::File, std::__1::default_delete<llvm::vfs::File> > >::ErrorOr(llvm::ErrorOr<std::__1::unique_ptr<llvm::vfs::File, std::__1::default_delete<llvm::vfs::File> > >&&)
Line
Count
Source
114
9
  ErrorOr(ErrorOr &&Other) {
115
9
    moveConstruct(std::move(Other));
116
9
  }
Unexecuted instantiation: llvm::ErrorOr<llvm::MD5::MD5Result>::ErrorOr(llvm::ErrorOr<llvm::MD5::MD5Result>&&)
Unexecuted instantiation: llvm::ErrorOr<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::ErrorOr(llvm::ErrorOr<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >&&)
117
118
  template <class OtherT>
119
  ErrorOr(
120
      ErrorOr<OtherT> &&Other,
121
      typename std::enable_if<std::is_convertible<OtherT, T>::value>::type * =
122
40.4k
          nullptr) {
123
40.4k
    moveConstruct(std::move(Other));
124
40.4k
  }
125
126
  // This might eventually need SFINAE but it's more complex than is_convertible
127
  // & I'm too lazy to write it right now.
128
  template <class OtherT>
129
  explicit ErrorOr(
130
      ErrorOr<OtherT> &&Other,
131
      typename std::enable_if<!std::is_convertible<OtherT, T>::value>::type * =
132
          nullptr) {
133
    moveConstruct(std::move(Other));
134
  }
135
136
  ErrorOr &operator=(const ErrorOr &Other) {
137
    copyAssign(Other);
138
    return *this;
139
  }
140
141
234k
  ErrorOr &operator=(ErrorOr &&Other) {
142
234k
    moveAssign(std::move(Other));
143
234k
    return *this;
144
234k
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::sampleprof::SampleProfileReader, std::__1::default_delete<llvm::sampleprof::SampleProfileReader> > >::operator=(llvm::ErrorOr<std::__1::unique_ptr<llvm::sampleprof::SampleProfileReader, std::__1::default_delete<llvm::sampleprof::SampleProfileReader> > >&&)
Line
Count
Source
141
2
  ErrorOr &operator=(ErrorOr &&Other) {
142
2
    moveAssign(std::move(Other));
143
2
    return *this;
144
2
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> > >::operator=(llvm::ErrorOr<std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> > >&&)
Line
Count
Source
141
234k
  ErrorOr &operator=(ErrorOr &&Other) {
142
234k
    moveAssign(std::move(Other));
143
234k
    return *this;
144
234k
  }
Unexecuted instantiation: llvm::ErrorOr<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::operator=(llvm::ErrorOr<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >&&)
145
146
6.24M
  ~ErrorOr() {
147
6.24M
    if (!HasError)
148
3.58M
      getStorage()->~storage_type();
149
6.24M
  }
llvm::ErrorOr<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::~ErrorOr()
Line
Count
Source
146
918k
  ~ErrorOr() {
147
918k
    if (!HasError)
148
882k
      getStorage()->~storage_type();
149
918k
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> > >::~ErrorOr()
Line
Count
Source
146
1.30M
  ~ErrorOr() {
147
1.30M
    if (!HasError)
148
707k
      getStorage()->~storage_type();
149
1.30M
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::sampleprof::SampleProfileReader, std::__1::default_delete<llvm::sampleprof::SampleProfileReader> > >::~ErrorOr()
Line
Count
Source
146
159
  ~ErrorOr() {
147
159
    if (!HasError)
148
159
      getStorage()->~storage_type();
149
159
  }
llvm::ErrorOr<llvm::StringMap<unsigned long long, llvm::MallocAllocator> >::~ErrorOr()
Line
Count
Source
146
72
  ~ErrorOr() {
147
72
    if (!HasError)
148
53
      getStorage()->~storage_type();
149
72
  }
llvm::ErrorOr<unsigned long long>::~ErrorOr()
Line
Count
Source
146
5.64k
  ~ErrorOr() {
147
5.64k
    if (!HasError)
148
4.23k
      getStorage()->~storage_type();
149
5.64k
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::WritableMemoryBuffer, std::__1::default_delete<llvm::WritableMemoryBuffer> > >::~ErrorOr()
Line
Count
Source
146
312k
  ~ErrorOr() {
147
312k
    if (!HasError)
148
312k
      getStorage()->~storage_type();
149
312k
  }
llvm::ErrorOr<llvm::sys::fs::basic_file_status>::~ErrorOr()
Line
Count
Source
146
153
  ~ErrorOr() {
147
153
    if (!HasError)
148
140
      getStorage()->~storage_type();
149
153
  }
llvm::ErrorOr<llvm::vfs::Status>::~ErrorOr()
Line
Count
Source
146
2.08M
  ~ErrorOr() {
147
2.08M
    if (!HasError)
148
952k
      getStorage()->~storage_type();
149
2.08M
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::vfs::File, std::__1::default_delete<llvm::vfs::File> > >::~ErrorOr()
Line
Count
Source
146
1.19M
  ~ErrorOr() {
147
1.19M
    if (!HasError)
148
569k
      getStorage()->~storage_type();
149
1.19M
  }
llvm::ErrorOr<llvm::vfs::detail::InMemoryNode const*>::~ErrorOr()
Line
Count
Source
146
403k
  ~ErrorOr() {
147
403k
    if (!HasError)
148
154k
      getStorage()->~storage_type();
149
403k
  }
llvm::ErrorOr<llvm::vfs::RedirectingFileSystem::Entry*>::~ErrorOr()
Line
Count
Source
146
20.3k
  ~ErrorOr() {
147
20.3k
    if (!HasError)
148
624
      getStorage()->~storage_type();
149
20.3k
  }
llvm::ErrorOr<llvm::MD5::MD5Result>::~ErrorOr()
Line
Count
Source
146
1
  ~ErrorOr() {
147
1
    if (!HasError)
148
1
      getStorage()->~storage_type();
149
1
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::Module, std::__1::default_delete<llvm::Module> > >::~ErrorOr()
Line
Count
Source
146
401
  ~ErrorOr() {
147
401
    if (!HasError)
148
400
      getStorage()->~storage_type();
149
401
  }
llvm::ErrorOr<clang::PrecompiledPreamble>::~ErrorOr()
Line
Count
Source
146
88
  ~ErrorOr() {
147
88
    if (!HasError)
148
88
      getStorage()->~storage_type();
149
88
  }
llvm::ErrorOr<clang::PrecompiledPreamble::TempPCHFile>::~ErrorOr()
Line
Count
Source
146
88
  ~ErrorOr() {
147
88
    if (!HasError)
148
88
      getStorage()->~storage_type();
149
88
  }
llvm::ErrorOr<clang::serialized_diags::SerializedDiagnosticReader::Cursor>::~ErrorOr()
Line
Count
Source
146
328
  ~ErrorOr() {
147
328
    if (!HasError)
148
328
      getStorage()->~storage_type();
149
328
  }
llvm::ErrorOr<llvm::StringRef>::~ErrorOr()
Line
Count
Source
146
254
  ~ErrorOr() {
147
254
    if (!HasError)
148
232
      getStorage()->~storage_type();
149
254
  }
llvm::ErrorOr<unsigned int>::~ErrorOr()
Line
Count
Source
146
754
  ~ErrorOr() {
147
754
    if (!HasError)
148
754
      getStorage()->~storage_type();
149
754
  }
150
151
  /// Return false if there is an error.
152
5.90M
  explicit operator bool() const {
153
5.90M
    return !HasError;
154
5.90M
  }
llvm::ErrorOr<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::operator bool() const
Line
Count
Source
152
911k
  explicit operator bool() const {
153
911k
    return !HasError;
154
911k
  }
llvm::ErrorOr<llvm::sys::fs::basic_file_status>::operator bool() const
Line
Count
Source
152
125
  explicit operator bool() const {
153
125
    return !HasError;
154
125
  }
llvm::ErrorOr<llvm::vfs::Status>::operator bool() const
Line
Count
Source
152
2.12M
  explicit operator bool() const {
153
2.12M
    return !HasError;
154
2.12M
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> > >::operator bool() const
Line
Count
Source
152
958k
  explicit operator bool() const {
153
958k
    return !HasError;
154
958k
  }
llvm::ErrorOr<llvm::StringMap<unsigned long long, llvm::MallocAllocator> >::operator bool() const
Line
Count
Source
152
67
  explicit operator bool() const {
153
67
    return !HasError;
154
67
  }
llvm::ErrorOr<unsigned long long>::operator bool() const
Line
Count
Source
152
3.21k
  explicit operator bool() const {
153
3.21k
    return !HasError;
154
3.21k
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::WritableMemoryBuffer, std::__1::default_delete<llvm::WritableMemoryBuffer> > >::operator bool() const
Line
Count
Source
152
271k
  explicit operator bool() const {
153
271k
    return !HasError;
154
271k
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::vfs::File, std::__1::default_delete<llvm::vfs::File> > >::operator bool() const
Line
Count
Source
152
1.20M
  explicit operator bool() const {
153
1.20M
    return !HasError;
154
1.20M
  }
llvm::ErrorOr<llvm::vfs::detail::InMemoryNode const*>::operator bool() const
Line
Count
Source
152
403k
  explicit operator bool() const {
153
403k
    return !HasError;
154
403k
  }
llvm::ErrorOr<llvm::vfs::RedirectingFileSystem::Entry*>::operator bool() const
Line
Count
Source
152
27.1k
  explicit operator bool() const {
153
27.1k
    return !HasError;
154
27.1k
  }
llvm::ErrorOr<clang::PrecompiledPreamble>::operator bool() const
Line
Count
Source
152
88
  explicit operator bool() const {
153
88
    return !HasError;
154
88
  }
llvm::ErrorOr<clang::PrecompiledPreamble::TempPCHFile>::operator bool() const
Line
Count
Source
152
88
  explicit operator bool() const {
153
88
    return !HasError;
154
88
  }
llvm::ErrorOr<clang::serialized_diags::SerializedDiagnosticReader::Cursor>::operator bool() const
Line
Count
Source
152
328
  explicit operator bool() const {
153
328
    return !HasError;
154
328
  }
155
156
405k
  reference get() { return *getStorage(); }
llvm::ErrorOr<std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> > >::get()
Line
Count
Source
156
61.0k
  reference get() { return *getStorage(); }
llvm::ErrorOr<std::__1::unique_ptr<llvm::sampleprof::SampleProfileReader, std::__1::default_delete<llvm::sampleprof::SampleProfileReader> > >::get()
Line
Count
Source
156
165
  reference get() { return *getStorage(); }
llvm::ErrorOr<llvm::StringMap<unsigned long long, llvm::MallocAllocator> >::get()
Line
Count
Source
156
69
  reference get() { return *getStorage(); }
llvm::ErrorOr<unsigned long long>::get()
Line
Count
Source
156
1.79k
  reference get() { return *getStorage(); }
llvm::ErrorOr<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::get()
Line
Count
Source
156
342k
  reference get() { return *getStorage(); }
llvm::ErrorOr<std::__1::unique_ptr<llvm::Module, std::__1::default_delete<llvm::Module> > >::get()
Line
Count
Source
156
340
  reference get() { return *getStorage(); }
llvm::ErrorOr<clang::serialized_diags::SerializedDiagnosticReader::Cursor>::get()
Line
Count
Source
156
328
  reference get() { return *getStorage(); }
157
780
  const_reference get() const { return const_cast<ErrorOr<T> *>(this)->get(); }
158
159
1.72M
  std::error_code getError() const {
160
1.72M
    return HasError ? 
*getErrorStorage()1.64M
:
std::error_code()77.0k
;
161
1.72M
  }
llvm::ErrorOr<llvm::sys::fs::basic_file_status>::getError() const
Line
Count
Source
159
28
  std::error_code getError() const {
160
28
    return HasError ? 
*getErrorStorage()8
:
std::error_code()20
;
161
28
  }
llvm::ErrorOr<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::getError() const
Line
Count
Source
159
2
  std::error_code getError() const {
160
2
    return HasError ? 
*getErrorStorage()0
: std::error_code();
161
2
  }
llvm::ErrorOr<llvm::vfs::Status>::getError() const
Line
Count
Source
159
527k
  std::error_code getError() const {
160
527k
    return HasError ? 
*getErrorStorage()527k
:
std::error_code()69
;
161
527k
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::vfs::File, std::__1::default_delete<llvm::vfs::File> > >::getError() const
Line
Count
Source
159
626k
  std::error_code getError() const {
160
626k
    return HasError ? 
*getErrorStorage()626k
:
std::error_code()11
;
161
626k
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> > >::getError() const
Line
Count
Source
159
295k
  std::error_code getError() const {
160
295k
    return HasError ? 
*getErrorStorage()222k
:
std::error_code()73.0k
;
161
295k
  }
llvm::ErrorOr<unsigned long long>::getError() const
Line
Count
Source
159
2.62k
  std::error_code getError() const {
160
2.62k
    return HasError ? 
*getErrorStorage()221
:
std::error_code()2.40k
;
161
2.62k
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::sampleprof::SampleProfileReader, std::__1::default_delete<llvm::sampleprof::SampleProfileReader> > >::getError() const
Line
Count
Source
159
170
  std::error_code getError() const {
160
170
    return HasError ? 
*getErrorStorage()5
:
std::error_code()165
;
161
170
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::WritableMemoryBuffer, std::__1::default_delete<llvm::WritableMemoryBuffer> > >::getError() const
Line
Count
Source
159
1
  std::error_code getError() const {
160
1
    return HasError ? 
*getErrorStorage()0
: std::error_code();
161
1
  }
llvm::ErrorOr<llvm::vfs::detail::InMemoryNode const*>::getError() const
Line
Count
Source
159
248k
  std::error_code getError() const {
160
248k
    return HasError ? *getErrorStorage() : 
std::error_code()0
;
161
248k
  }
llvm::ErrorOr<llvm::vfs::RedirectingFileSystem::Entry*>::getError() const
Line
Count
Source
159
19.7k
  std::error_code getError() const {
160
19.7k
    return HasError ? *getErrorStorage() : 
std::error_code()0
;
161
19.7k
  }
llvm::ErrorOr<llvm::MD5::MD5Result>::getError() const
Line
Count
Source
159
1
  std::error_code getError() const {
160
1
    return HasError ? 
*getErrorStorage()0
: std::error_code();
161
1
  }
Unexecuted instantiation: llvm::ErrorOr<llvm::sys::fs::perms>::getError() const
Unexecuted instantiation: llvm::ErrorOr<llvm::sys::fs::space_info>::getError() const
llvm::ErrorOr<std::__1::unique_ptr<llvm::Module, std::__1::default_delete<llvm::Module> > >::getError() const
Line
Count
Source
159
401
  std::error_code getError() const {
160
401
    return HasError ? 
*getErrorStorage()1
:
std::error_code()400
;
161
401
  }
Unexecuted instantiation: llvm::ErrorOr<clang::PrecompiledPreamble>::getError() const
Unexecuted instantiation: llvm::ErrorOr<clang::PrecompiledPreamble::TempPCHFile>::getError() const
Unexecuted instantiation: llvm::ErrorOr<clang::serialized_diags::SerializedDiagnosticReader::Cursor>::getError() const
llvm::ErrorOr<unsigned int>::getError() const
Line
Count
Source
159
754
  std::error_code getError() const {
160
754
    return HasError ? 
*getErrorStorage()0
: std::error_code();
161
754
  }
llvm::ErrorOr<llvm::StringRef>::getError() const
Line
Count
Source
159
223
  std::error_code getError() const {
160
223
    return HasError ? 
*getErrorStorage()0
: std::error_code();
161
223
  }
162
163
657k
  pointer operator ->() {
164
657k
    return toPointer(getStorage());
165
657k
  }
llvm::ErrorOr<llvm::sys::fs::basic_file_status>::operator->()
Line
Count
Source
163
203
  pointer operator ->() {
164
203
    return toPointer(getStorage());
165
203
  }
llvm::ErrorOr<llvm::vfs::Status>::operator->()
Line
Count
Source
163
100k
  pointer operator ->() {
164
100k
    return toPointer(getStorage());
165
100k
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> > >::operator->()
Line
Count
Source
163
557k
  pointer operator ->() {
164
557k
    return toPointer(getStorage());
165
557k
  }
llvm::ErrorOr<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::operator->()
Line
Count
Source
163
8
  pointer operator ->() {
164
8
    return toPointer(getStorage());
165
8
  }
166
167
  const_pointer operator->() const { return toPointer(getStorage()); }
168
169
2.94M
  reference operator *() {
170
2.94M
    return *getStorage();
171
2.94M
  }
llvm::ErrorOr<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::operator*()
Line
Count
Source
169
539k
  reference operator *() {
170
539k
    return *getStorage();
171
539k
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> > >::operator*()
Line
Count
Source
169
40.6k
  reference operator *() {
170
40.6k
    return *getStorage();
171
40.6k
  }
llvm::ErrorOr<unsigned long long>::operator*()
Line
Count
Source
169
3.18k
  reference operator *() {
170
3.18k
    return *getStorage();
171
3.18k
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::WritableMemoryBuffer, std::__1::default_delete<llvm::WritableMemoryBuffer> > >::operator*()
Line
Count
Source
169
271k
  reference operator *() {
170
271k
    return *getStorage();
171
271k
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::vfs::File, std::__1::default_delete<llvm::vfs::File> > >::operator*()
Line
Count
Source
169
1.07M
  reference operator *() {
170
1.07M
    return *getStorage();
171
1.07M
  }
llvm::ErrorOr<llvm::vfs::detail::InMemoryNode const*>::operator*()
Line
Count
Source
169
154k
  reference operator *() {
170
154k
    return *getStorage();
171
154k
  }
llvm::ErrorOr<llvm::vfs::RedirectingFileSystem::Entry*>::operator*()
Line
Count
Source
169
649
  reference operator *() {
170
649
    return *getStorage();
171
649
  }
llvm::ErrorOr<llvm::vfs::Status>::operator*()
Line
Count
Source
169
852k
  reference operator *() {
170
852k
    return *getStorage();
171
852k
  }
llvm::ErrorOr<llvm::sys::fs::basic_file_status>::operator*()
Line
Count
Source
169
37
  reference operator *() {
170
37
    return *getStorage();
171
37
  }
llvm::ErrorOr<clang::PrecompiledPreamble>::operator*()
Line
Count
Source
169
88
  reference operator *() {
170
88
    return *getStorage();
171
88
  }
llvm::ErrorOr<clang::PrecompiledPreamble::TempPCHFile>::operator*()
Line
Count
Source
169
88
  reference operator *() {
170
88
    return *getStorage();
171
88
  }
llvm::ErrorOr<unsigned int>::operator*()
Line
Count
Source
169
1.27k
  reference operator *() {
170
1.27k
    return *getStorage();
171
1.27k
  }
llvm::ErrorOr<llvm::StringRef>::operator*()
Line
Count
Source
169
401
  reference operator *() {
170
401
    return *getStorage();
171
401
  }
172
173
6
  const_reference operator*() const { return *getStorage(); }
174
175
private:
176
  template <class OtherT>
177
  void copyConstruct(const ErrorOr<OtherT> &Other) {
178
    if (!Other.HasError) {
179
      // Get the other value.
180
      HasError = false;
181
      new (getStorage()) storage_type(*Other.getStorage());
182
    } else {
183
      // Get other's error.
184
      HasError = true;
185
      new (getErrorStorage()) std::error_code(Other.getError());
186
    }
187
  }
188
189
  template <class T1>
190
234k
  static bool compareThisIfSameType(const T1 &a, const T1 &b) {
191
234k
    return &a == &b;
192
234k
  }
bool llvm::ErrorOr<std::__1::unique_ptr<llvm::sampleprof::SampleProfileReader, std::__1::default_delete<llvm::sampleprof::SampleProfileReader> > >::compareThisIfSameType<llvm::ErrorOr<std::__1::unique_ptr<llvm::sampleprof::SampleProfileReader, std::__1::default_delete<llvm::sampleprof::SampleProfileReader> > > >(llvm::ErrorOr<std::__1::unique_ptr<llvm::sampleprof::SampleProfileReader, std::__1::default_delete<llvm::sampleprof::SampleProfileReader> > > const&, llvm::ErrorOr<std::__1::unique_ptr<llvm::sampleprof::SampleProfileReader, std::__1::default_delete<llvm::sampleprof::SampleProfileReader> > > const&)
Line
Count
Source
190
2
  static bool compareThisIfSameType(const T1 &a, const T1 &b) {
191
2
    return &a == &b;
192
2
  }
bool llvm::ErrorOr<std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> > >::compareThisIfSameType<llvm::ErrorOr<std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> > > >(llvm::ErrorOr<std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> > > const&, llvm::ErrorOr<std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> > > const&)
Line
Count
Source
190
234k
  static bool compareThisIfSameType(const T1 &a, const T1 &b) {
191
234k
    return &a == &b;
192
234k
  }
Unexecuted instantiation: bool llvm::ErrorOr<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::compareThisIfSameType<llvm::ErrorOr<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >(llvm::ErrorOr<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, llvm::ErrorOr<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&)
193
194
  template <class T1, class T2>
195
  static bool compareThisIfSameType(const T1 &a, const T2 &b) {
196
    return false;
197
  }
198
199
  template <class OtherT>
200
  void copyAssign(const ErrorOr<OtherT> &Other) {
201
    if (compareThisIfSameType(*this, Other))
202
      return;
203
204
    this->~ErrorOr();
205
    new (this) ErrorOr(Other);
206
  }
207
208
  template <class OtherT>
209
322k
  void moveConstruct(ErrorOr<OtherT> &&Other) {
210
322k
    if (!Other.HasError) {
211
101k
      // Get the other value.
212
101k
      HasError = false;
213
101k
      new (getStorage()) storage_type(std::move(*Other.getStorage()));
214
221k
    } else {
215
221k
      // Get other's error.
216
221k
      HasError = true;
217
221k
      new (getErrorStorage()) std::error_code(Other.getError());
218
221k
    }
219
322k
  }
Unexecuted instantiation: void llvm::ErrorOr<llvm::sys::fs::basic_file_status>::moveConstruct<llvm::sys::fs::basic_file_status>(llvm::ErrorOr<llvm::sys::fs::basic_file_status>&&)
void llvm::ErrorOr<llvm::vfs::Status>::moveConstruct<llvm::vfs::Status>(llvm::ErrorOr<llvm::vfs::Status>&&)
Line
Count
Source
209
97
  void moveConstruct(ErrorOr<OtherT> &&Other) {
210
97
    if (!Other.HasError) {
211
53
      // Get the other value.
212
53
      HasError = false;
213
53
      new (getStorage()) storage_type(std::move(*Other.getStorage()));
214
53
    } else {
215
44
      // Get other's error.
216
44
      HasError = true;
217
44
      new (getErrorStorage()) std::error_code(Other.getError());
218
44
    }
219
97
  }
Unexecuted instantiation: void llvm::ErrorOr<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::moveConstruct<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(llvm::ErrorOr<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >&&)
void llvm::ErrorOr<std::__1::unique_ptr<llvm::vfs::File, std::__1::default_delete<llvm::vfs::File> > >::moveConstruct<std::__1::unique_ptr<llvm::vfs::File, std::__1::default_delete<llvm::vfs::File> > >(llvm::ErrorOr<std::__1::unique_ptr<llvm::vfs::File, std::__1::default_delete<llvm::vfs::File> > >&&)
Line
Count
Source
209
9
  void moveConstruct(ErrorOr<OtherT> &&Other) {
210
9
    if (!Other.HasError) {
211
4
      // Get the other value.
212
4
      HasError = false;
213
4
      new (getStorage()) storage_type(std::move(*Other.getStorage()));
214
5
    } else {
215
5
      // Get other's error.
216
5
      HasError = true;
217
5
      new (getErrorStorage()) std::error_code(Other.getError());
218
5
    }
219
9
  }
void llvm::ErrorOr<std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> > >::moveConstruct<std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> > >(llvm::ErrorOr<std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> > >&&)
Line
Count
Source
209
280k
  void moveConstruct(ErrorOr<OtherT> &&Other) {
210
280k
    if (!Other.HasError) {
211
59.8k
      // Get the other value.
212
59.8k
      HasError = false;
213
59.8k
      new (getStorage()) storage_type(std::move(*Other.getStorage()));
214
221k
    } else {
215
221k
      // Get other's error.
216
221k
      HasError = true;
217
221k
      new (getErrorStorage()) std::error_code(Other.getError());
218
221k
    }
219
280k
  }
void llvm::ErrorOr<unsigned long long>::moveConstruct<unsigned long long>(llvm::ErrorOr<unsigned long long>&&)
Line
Count
Source
209
1.00k
  void moveConstruct(ErrorOr<OtherT> &&Other) {
210
1.00k
    if (!Other.HasError) {
211
781
      // Get the other value.
212
781
      HasError = false;
213
781
      new (getStorage()) storage_type(std::move(*Other.getStorage()));
214
781
    } else {
215
220
      // Get other's error.
216
220
      HasError = true;
217
220
      new (getErrorStorage()) std::error_code(Other.getError());
218
220
    }
219
1.00k
  }
Unexecuted instantiation: void llvm::ErrorOr<llvm::StringMap<unsigned long long, llvm::MallocAllocator> >::moveConstruct<llvm::StringMap<unsigned long long, llvm::MallocAllocator> >(llvm::ErrorOr<llvm::StringMap<unsigned long long, llvm::MallocAllocator> >&&)
void llvm::ErrorOr<std::__1::unique_ptr<llvm::sampleprof::SampleProfileReader, std::__1::default_delete<llvm::sampleprof::SampleProfileReader> > >::moveConstruct<std::__1::unique_ptr<llvm::sampleprof::SampleProfileReader, std::__1::default_delete<llvm::sampleprof::SampleProfileReader> > >(llvm::ErrorOr<std::__1::unique_ptr<llvm::sampleprof::SampleProfileReader, std::__1::default_delete<llvm::sampleprof::SampleProfileReader> > >&&)
Line
Count
Source
209
2
  void moveConstruct(ErrorOr<OtherT> &&Other) {
210
2
    if (!Other.HasError) {
211
2
      // Get the other value.
212
2
      HasError = false;
213
2
      new (getStorage()) storage_type(std::move(*Other.getStorage()));
214
2
    } else {
215
0
      // Get other's error.
216
0
      HasError = true;
217
0
      new (getErrorStorage()) std::error_code(Other.getError());
218
0
    }
219
2
  }
void llvm::ErrorOr<std::__1::unique_ptr<llvm::WritableMemoryBuffer, std::__1::default_delete<llvm::WritableMemoryBuffer> > >::moveConstruct<std::__1::unique_ptr<llvm::WritableMemoryBuffer, std::__1::default_delete<llvm::WritableMemoryBuffer> > >(llvm::ErrorOr<std::__1::unique_ptr<llvm::WritableMemoryBuffer, std::__1::default_delete<llvm::WritableMemoryBuffer> > >&&)
Line
Count
Source
209
1
  void moveConstruct(ErrorOr<OtherT> &&Other) {
210
1
    if (!Other.HasError) {
211
1
      // Get the other value.
212
1
      HasError = false;
213
1
      new (getStorage()) storage_type(std::move(*Other.getStorage()));
214
1
    } else {
215
0
      // Get other's error.
216
0
      HasError = true;
217
0
      new (getErrorStorage()) std::error_code(Other.getError());
218
0
    }
219
1
  }
void llvm::ErrorOr<std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> > >::moveConstruct<std::__1::unique_ptr<llvm::WritableMemoryBuffer, std::__1::default_delete<llvm::WritableMemoryBuffer> > >(llvm::ErrorOr<std::__1::unique_ptr<llvm::WritableMemoryBuffer, std::__1::default_delete<llvm::WritableMemoryBuffer> > >&&)
Line
Count
Source
209
40.4k
  void moveConstruct(ErrorOr<OtherT> &&Other) {
210
40.4k
    if (!Other.HasError) {
211
40.4k
      // Get the other value.
212
40.4k
      HasError = false;
213
40.4k
      new (getStorage()) storage_type(std::move(*Other.getStorage()));
214
40.4k
    } else {
215
0
      // Get other's error.
216
0
      HasError = true;
217
0
      new (getErrorStorage()) std::error_code(Other.getError());
218
0
    }
219
40.4k
  }
Unexecuted instantiation: void llvm::ErrorOr<std::__1::unique_ptr<llvm::WriteThroughMemoryBuffer, std::__1::default_delete<llvm::WriteThroughMemoryBuffer> > >::moveConstruct<std::__1::unique_ptr<llvm::WriteThroughMemoryBuffer, std::__1::default_delete<llvm::WriteThroughMemoryBuffer> > >(llvm::ErrorOr<std::__1::unique_ptr<llvm::WriteThroughMemoryBuffer, std::__1::default_delete<llvm::WriteThroughMemoryBuffer> > >&&)
Unexecuted instantiation: void llvm::ErrorOr<llvm::vfs::detail::InMemoryNode const*>::moveConstruct<llvm::vfs::detail::InMemoryNode const*>(llvm::ErrorOr<llvm::vfs::detail::InMemoryNode const*>&&)
Unexecuted instantiation: void llvm::ErrorOr<llvm::vfs::RedirectingFileSystem::Entry*>::moveConstruct<llvm::vfs::RedirectingFileSystem::Entry*>(llvm::ErrorOr<llvm::vfs::RedirectingFileSystem::Entry*>&&)
Unexecuted instantiation: void llvm::ErrorOr<llvm::MD5::MD5Result>::moveConstruct<llvm::MD5::MD5Result>(llvm::ErrorOr<llvm::MD5::MD5Result>&&)
Unexecuted instantiation: void llvm::ErrorOr<llvm::sys::fs::space_info>::moveConstruct<llvm::sys::fs::space_info>(llvm::ErrorOr<llvm::sys::fs::space_info>&&)
Unexecuted instantiation: void llvm::ErrorOr<std::__1::unique_ptr<llvm::Module, std::__1::default_delete<llvm::Module> > >::moveConstruct<std::__1::unique_ptr<llvm::Module, std::__1::default_delete<llvm::Module> > >(llvm::ErrorOr<std::__1::unique_ptr<llvm::Module, std::__1::default_delete<llvm::Module> > >&&)
Unexecuted instantiation: void llvm::ErrorOr<clang::PrecompiledPreamble>::moveConstruct<clang::PrecompiledPreamble>(llvm::ErrorOr<clang::PrecompiledPreamble>&&)
Unexecuted instantiation: void llvm::ErrorOr<clang::PrecompiledPreamble::TempPCHFile>::moveConstruct<clang::PrecompiledPreamble::TempPCHFile>(llvm::ErrorOr<clang::PrecompiledPreamble::TempPCHFile>&&)
Unexecuted instantiation: void llvm::ErrorOr<clang::serialized_diags::SerializedDiagnosticReader::Cursor>::moveConstruct<clang::serialized_diags::SerializedDiagnosticReader::Cursor>(llvm::ErrorOr<clang::serialized_diags::SerializedDiagnosticReader::Cursor>&&)
Unexecuted instantiation: void llvm::ErrorOr<llvm::StringRef>::moveConstruct<llvm::StringRef>(llvm::ErrorOr<llvm::StringRef>&&)
Unexecuted instantiation: void llvm::ErrorOr<unsigned int>::moveConstruct<unsigned int>(llvm::ErrorOr<unsigned int>&&)
220
221
  template <class OtherT>
222
234k
  void moveAssign(ErrorOr<OtherT> &&Other) {
223
234k
    if (compareThisIfSameType(*this, Other))
224
0
      return;
225
234k
226
234k
    this->~ErrorOr();
227
234k
    new (this) ErrorOr(std::move(Other));
228
234k
  }
void llvm::ErrorOr<std::__1::unique_ptr<llvm::sampleprof::SampleProfileReader, std::__1::default_delete<llvm::sampleprof::SampleProfileReader> > >::moveAssign<std::__1::unique_ptr<llvm::sampleprof::SampleProfileReader, std::__1::default_delete<llvm::sampleprof::SampleProfileReader> > >(llvm::ErrorOr<std::__1::unique_ptr<llvm::sampleprof::SampleProfileReader, std::__1::default_delete<llvm::sampleprof::SampleProfileReader> > >&&)
Line
Count
Source
222
2
  void moveAssign(ErrorOr<OtherT> &&Other) {
223
2
    if (compareThisIfSameType(*this, Other))
224
0
      return;
225
2
226
2
    this->~ErrorOr();
227
2
    new (this) ErrorOr(std::move(Other));
228
2
  }
void llvm::ErrorOr<std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> > >::moveAssign<std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> > >(llvm::ErrorOr<std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> > >&&)
Line
Count
Source
222
234k
  void moveAssign(ErrorOr<OtherT> &&Other) {
223
234k
    if (compareThisIfSameType(*this, Other))
224
0
      return;
225
234k
226
234k
    this->~ErrorOr();
227
234k
    new (this) ErrorOr(std::move(Other));
228
234k
  }
Unexecuted instantiation: void llvm::ErrorOr<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::moveAssign<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(llvm::ErrorOr<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >&&)
229
230
657k
  pointer toPointer(pointer Val) {
231
657k
    return Val;
232
657k
  }
llvm::ErrorOr<llvm::sys::fs::basic_file_status>::toPointer(llvm::sys::fs::basic_file_status*)
Line
Count
Source
230
203
  pointer toPointer(pointer Val) {
231
203
    return Val;
232
203
  }
llvm::ErrorOr<llvm::vfs::Status>::toPointer(llvm::vfs::Status*)
Line
Count
Source
230
100k
  pointer toPointer(pointer Val) {
231
100k
    return Val;
232
100k
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> > >::toPointer(std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> >*)
Line
Count
Source
230
557k
  pointer toPointer(pointer Val) {
231
557k
    return Val;
232
557k
  }
llvm::ErrorOr<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::toPointer(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*)
Line
Count
Source
230
8
  pointer toPointer(pointer Val) {
231
8
    return Val;
232
8
  }
233
234
  const_pointer toPointer(const_pointer Val) const { return Val; }
235
236
  pointer toPointer(wrap *Val) {
237
    return &Val->get();
238
  }
239
240
  const_pointer toPointer(const wrap *Val) const { return &Val->get(); }
241
242
11.2M
  storage_type *getStorage() {
243
11.2M
    assert(!HasError && "Cannot get value when an error exists!");
244
11.2M
    return reinterpret_cast<storage_type*>(TStorage.buffer);
245
11.2M
  }
llvm::ErrorOr<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::getStorage()
Line
Count
Source
242
2.64M
  storage_type *getStorage() {
243
2.64M
    assert(!HasError && "Cannot get value when an error exists!");
244
2.64M
    return reinterpret_cast<storage_type*>(TStorage.buffer);
245
2.64M
  }
llvm::ErrorOr<llvm::sys::fs::basic_file_status>::getStorage()
Line
Count
Source
242
520
  storage_type *getStorage() {
243
520
    assert(!HasError && "Cannot get value when an error exists!");
244
520
    return reinterpret_cast<storage_type*>(TStorage.buffer);
245
520
  }
llvm::ErrorOr<llvm::vfs::Status>::getStorage()
Line
Count
Source
242
2.85M
  storage_type *getStorage() {
243
2.85M
    assert(!HasError && "Cannot get value when an error exists!");
244
2.85M
    return reinterpret_cast<storage_type*>(TStorage.buffer);
245
2.85M
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::vfs::File, std::__1::default_delete<llvm::vfs::File> > >::getStorage()
Line
Count
Source
242
2.21M
  storage_type *getStorage() {
243
2.21M
    assert(!HasError && "Cannot get value when an error exists!");
244
2.21M
    return reinterpret_cast<storage_type*>(TStorage.buffer);
245
2.21M
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> > >::getStorage()
Line
Count
Source
242
2.13M
  storage_type *getStorage() {
243
2.13M
    assert(!HasError && "Cannot get value when an error exists!");
244
2.13M
    return reinterpret_cast<storage_type*>(TStorage.buffer);
245
2.13M
  }
llvm::ErrorOr<unsigned long long>::getStorage()
Line
Count
Source
242
14.2k
  storage_type *getStorage() {
243
14.2k
    assert(!HasError && "Cannot get value when an error exists!");
244
14.2k
    return reinterpret_cast<storage_type*>(TStorage.buffer);
245
14.2k
  }
llvm::ErrorOr<llvm::StringMap<unsigned long long, llvm::MallocAllocator> >::getStorage()
Line
Count
Source
242
175
  storage_type *getStorage() {
243
175
    assert(!HasError && "Cannot get value when an error exists!");
244
175
    return reinterpret_cast<storage_type*>(TStorage.buffer);
245
175
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::sampleprof::SampleProfileReader, std::__1::default_delete<llvm::sampleprof::SampleProfileReader> > >::getStorage()
Line
Count
Source
242
493
  storage_type *getStorage() {
243
493
    assert(!HasError && "Cannot get value when an error exists!");
244
493
    return reinterpret_cast<storage_type*>(TStorage.buffer);
245
493
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::WritableMemoryBuffer, std::__1::default_delete<llvm::WritableMemoryBuffer> > >::getStorage()
Line
Count
Source
242
937k
  storage_type *getStorage() {
243
937k
    assert(!HasError && "Cannot get value when an error exists!");
244
937k
    return reinterpret_cast<storage_type*>(TStorage.buffer);
245
937k
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::WriteThroughMemoryBuffer, std::__1::default_delete<llvm::WriteThroughMemoryBuffer> > >::getStorage()
Line
Count
Source
242
3
  storage_type *getStorage() {
243
3
    assert(!HasError && "Cannot get value when an error exists!");
244
3
    return reinterpret_cast<storage_type*>(TStorage.buffer);
245
3
  }
llvm::ErrorOr<llvm::vfs::detail::InMemoryNode const*>::getStorage()
Line
Count
Source
242
464k
  storage_type *getStorage() {
243
464k
    assert(!HasError && "Cannot get value when an error exists!");
244
464k
    return reinterpret_cast<storage_type*>(TStorage.buffer);
245
464k
  }
llvm::ErrorOr<llvm::vfs::RedirectingFileSystem::Entry*>::getStorage()
Line
Count
Source
242
1.89k
  storage_type *getStorage() {
243
1.89k
    assert(!HasError && "Cannot get value when an error exists!");
244
1.89k
    return reinterpret_cast<storage_type*>(TStorage.buffer);
245
1.89k
  }
llvm::ErrorOr<llvm::MD5::MD5Result>::getStorage()
Line
Count
Source
242
3
  storage_type *getStorage() {
243
3
    assert(!HasError && "Cannot get value when an error exists!");
244
3
    return reinterpret_cast<storage_type*>(TStorage.buffer);
245
3
  }
llvm::ErrorOr<llvm::sys::fs::perms>::getStorage()
Line
Count
Source
242
96
  storage_type *getStorage() {
243
96
    assert(!HasError && "Cannot get value when an error exists!");
244
96
    return reinterpret_cast<storage_type*>(TStorage.buffer);
245
96
  }
llvm::ErrorOr<llvm::sys::fs::space_info>::getStorage()
Line
Count
Source
242
60
  storage_type *getStorage() {
243
60
    assert(!HasError && "Cannot get value when an error exists!");
244
60
    return reinterpret_cast<storage_type*>(TStorage.buffer);
245
60
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::Module, std::__1::default_delete<llvm::Module> > >::getStorage()
Line
Count
Source
242
1.20k
  storage_type *getStorage() {
243
1.20k
    assert(!HasError && "Cannot get value when an error exists!");
244
1.20k
    return reinterpret_cast<storage_type*>(TStorage.buffer);
245
1.20k
  }
llvm::ErrorOr<clang::PrecompiledPreamble>::getStorage()
Line
Count
Source
242
264
  storage_type *getStorage() {
243
264
    assert(!HasError && "Cannot get value when an error exists!");
244
264
    return reinterpret_cast<storage_type*>(TStorage.buffer);
245
264
  }
llvm::ErrorOr<clang::PrecompiledPreamble::TempPCHFile>::getStorage()
Line
Count
Source
242
264
  storage_type *getStorage() {
243
264
    assert(!HasError && "Cannot get value when an error exists!");
244
264
    return reinterpret_cast<storage_type*>(TStorage.buffer);
245
264
  }
llvm::ErrorOr<clang::serialized_diags::SerializedDiagnosticReader::Cursor>::getStorage()
Line
Count
Source
242
984
  storage_type *getStorage() {
243
984
    assert(!HasError && "Cannot get value when an error exists!");
244
984
    return reinterpret_cast<storage_type*>(TStorage.buffer);
245
984
  }
llvm::ErrorOr<llvm::StringRef>::getStorage()
Line
Count
Source
242
865
  storage_type *getStorage() {
243
865
    assert(!HasError && "Cannot get value when an error exists!");
244
865
    return reinterpret_cast<storage_type*>(TStorage.buffer);
245
865
  }
llvm::ErrorOr<unsigned int>::getStorage()
Line
Count
Source
242
2.78k
  storage_type *getStorage() {
243
2.78k
    assert(!HasError && "Cannot get value when an error exists!");
244
2.78k
    return reinterpret_cast<storage_type*>(TStorage.buffer);
245
2.78k
  }
246
247
6
  const storage_type *getStorage() const {
248
6
    assert(!HasError && "Cannot get value when an error exists!");
249
6
    return reinterpret_cast<const storage_type*>(TStorage.buffer);
250
6
  }
251
252
4.30M
  std::error_code *getErrorStorage() {
253
4.30M
    assert(HasError && "Cannot get error when a value exists!");
254
4.30M
    return reinterpret_cast<std::error_code *>(ErrorStorage.buffer);
255
4.30M
  }
llvm::ErrorOr<llvm::sys::fs::basic_file_status>::getErrorStorage()
Line
Count
Source
252
21
  std::error_code *getErrorStorage() {
253
21
    assert(HasError && "Cannot get error when a value exists!");
254
21
    return reinterpret_cast<std::error_code *>(ErrorStorage.buffer);
255
21
  }
llvm::ErrorOr<llvm::vfs::Status>::getErrorStorage()
Line
Count
Source
252
1.65M
  std::error_code *getErrorStorage() {
253
1.65M
    assert(HasError && "Cannot get error when a value exists!");
254
1.65M
    return reinterpret_cast<std::error_code *>(ErrorStorage.buffer);
255
1.65M
  }
llvm::ErrorOr<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::getErrorStorage()
Line
Count
Source
252
36.4k
  std::error_code *getErrorStorage() {
253
36.4k
    assert(HasError && "Cannot get error when a value exists!");
254
36.4k
    return reinterpret_cast<std::error_code *>(ErrorStorage.buffer);
255
36.4k
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::vfs::File, std::__1::default_delete<llvm::vfs::File> > >::getErrorStorage()
Line
Count
Source
252
1.25M
  std::error_code *getErrorStorage() {
253
1.25M
    assert(HasError && "Cannot get error when a value exists!");
254
1.25M
    return reinterpret_cast<std::error_code *>(ErrorStorage.buffer);
255
1.25M
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> > >::getErrorStorage()
Line
Count
Source
252
823k
  std::error_code *getErrorStorage() {
253
823k
    assert(HasError && "Cannot get error when a value exists!");
254
823k
    return reinterpret_cast<std::error_code *>(ErrorStorage.buffer);
255
823k
  }
llvm::ErrorOr<unsigned long long>::getErrorStorage()
Line
Count
Source
252
1.63k
  std::error_code *getErrorStorage() {
253
1.63k
    assert(HasError && "Cannot get error when a value exists!");
254
1.63k
    return reinterpret_cast<std::error_code *>(ErrorStorage.buffer);
255
1.63k
  }
llvm::ErrorOr<llvm::StringMap<unsigned long long, llvm::MallocAllocator> >::getErrorStorage()
Line
Count
Source
252
19
  std::error_code *getErrorStorage() {
253
19
    assert(HasError && "Cannot get error when a value exists!");
254
19
    return reinterpret_cast<std::error_code *>(ErrorStorage.buffer);
255
19
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::sampleprof::SampleProfileReader, std::__1::default_delete<llvm::sampleprof::SampleProfileReader> > >::getErrorStorage()
Line
Count
Source
252
10
  std::error_code *getErrorStorage() {
253
10
    assert(HasError && "Cannot get error when a value exists!");
254
10
    return reinterpret_cast<std::error_code *>(ErrorStorage.buffer);
255
10
  }
Unexecuted instantiation: llvm::ErrorOr<std::__1::unique_ptr<llvm::WritableMemoryBuffer, std::__1::default_delete<llvm::WritableMemoryBuffer> > >::getErrorStorage()
Unexecuted instantiation: llvm::ErrorOr<std::__1::unique_ptr<llvm::WriteThroughMemoryBuffer, std::__1::default_delete<llvm::WriteThroughMemoryBuffer> > >::getErrorStorage()
llvm::ErrorOr<llvm::vfs::detail::InMemoryNode const*>::getErrorStorage()
Line
Count
Source
252
496k
  std::error_code *getErrorStorage() {
253
496k
    assert(HasError && "Cannot get error when a value exists!");
254
496k
    return reinterpret_cast<std::error_code *>(ErrorStorage.buffer);
255
496k
  }
llvm::ErrorOr<llvm::vfs::RedirectingFileSystem::Entry*>::getErrorStorage()
Line
Count
Source
252
39.5k
  std::error_code *getErrorStorage() {
253
39.5k
    assert(HasError && "Cannot get error when a value exists!");
254
39.5k
    return reinterpret_cast<std::error_code *>(ErrorStorage.buffer);
255
39.5k
  }
Unexecuted instantiation: llvm::ErrorOr<llvm::MD5::MD5Result>::getErrorStorage()
Unexecuted instantiation: llvm::ErrorOr<llvm::sys::fs::perms>::getErrorStorage()
Unexecuted instantiation: llvm::ErrorOr<llvm::sys::fs::space_info>::getErrorStorage()
llvm::ErrorOr<std::__1::unique_ptr<llvm::Module, std::__1::default_delete<llvm::Module> > >::getErrorStorage()
Line
Count
Source
252
2
  std::error_code *getErrorStorage() {
253
2
    assert(HasError && "Cannot get error when a value exists!");
254
2
    return reinterpret_cast<std::error_code *>(ErrorStorage.buffer);
255
2
  }
Unexecuted instantiation: llvm::ErrorOr<clang::PrecompiledPreamble>::getErrorStorage()
Unexecuted instantiation: llvm::ErrorOr<clang::PrecompiledPreamble::TempPCHFile>::getErrorStorage()
Unexecuted instantiation: llvm::ErrorOr<clang::serialized_diags::SerializedDiagnosticReader::Cursor>::getErrorStorage()
llvm::ErrorOr<llvm::StringRef>::getErrorStorage()
Line
Count
Source
252
22
  std::error_code *getErrorStorage() {
253
22
    assert(HasError && "Cannot get error when a value exists!");
254
22
    return reinterpret_cast<std::error_code *>(ErrorStorage.buffer);
255
22
  }
Unexecuted instantiation: llvm::ErrorOr<unsigned int>::getErrorStorage()
256
257
1.64M
  const std::error_code *getErrorStorage() const {
258
1.64M
    return const_cast<ErrorOr<T> *>(this)->getErrorStorage();
259
1.64M
  }
llvm::ErrorOr<llvm::sys::fs::basic_file_status>::getErrorStorage() const
Line
Count
Source
257
8
  const std::error_code *getErrorStorage() const {
258
8
    return const_cast<ErrorOr<T> *>(this)->getErrorStorage();
259
8
  }
Unexecuted instantiation: llvm::ErrorOr<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::getErrorStorage() const
llvm::ErrorOr<llvm::vfs::Status>::getErrorStorage() const
Line
Count
Source
257
527k
  const std::error_code *getErrorStorage() const {
258
527k
    return const_cast<ErrorOr<T> *>(this)->getErrorStorage();
259
527k
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::vfs::File, std::__1::default_delete<llvm::vfs::File> > >::getErrorStorage() const
Line
Count
Source
257
626k
  const std::error_code *getErrorStorage() const {
258
626k
    return const_cast<ErrorOr<T> *>(this)->getErrorStorage();
259
626k
  }
llvm::ErrorOr<std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> > >::getErrorStorage() const
Line
Count
Source
257
222k
  const std::error_code *getErrorStorage() const {
258
222k
    return const_cast<ErrorOr<T> *>(this)->getErrorStorage();
259
222k
  }
llvm::ErrorOr<unsigned long long>::getErrorStorage() const
Line
Count
Source
257
221
  const std::error_code *getErrorStorage() const {
258
221
    return const_cast<ErrorOr<T> *>(this)->getErrorStorage();
259
221
  }
Unexecuted instantiation: llvm::ErrorOr<llvm::StringMap<unsigned long long, llvm::MallocAllocator> >::getErrorStorage() const
llvm::ErrorOr<std::__1::unique_ptr<llvm::sampleprof::SampleProfileReader, std::__1::default_delete<llvm::sampleprof::SampleProfileReader> > >::getErrorStorage() const
Line
Count
Source
257
5
  const std::error_code *getErrorStorage() const {
258
5
    return const_cast<ErrorOr<T> *>(this)->getErrorStorage();
259
5
  }
Unexecuted instantiation: llvm::ErrorOr<std::__1::unique_ptr<llvm::WritableMemoryBuffer, std::__1::default_delete<llvm::WritableMemoryBuffer> > >::getErrorStorage() const
Unexecuted instantiation: llvm::ErrorOr<std::__1::unique_ptr<llvm::WriteThroughMemoryBuffer, std::__1::default_delete<llvm::WriteThroughMemoryBuffer> > >::getErrorStorage() const
llvm::ErrorOr<llvm::vfs::detail::InMemoryNode const*>::getErrorStorage() const
Line
Count
Source
257
248k
  const std::error_code *getErrorStorage() const {
258
248k
    return const_cast<ErrorOr<T> *>(this)->getErrorStorage();
259
248k
  }
llvm::ErrorOr<llvm::vfs::RedirectingFileSystem::Entry*>::getErrorStorage() const
Line
Count
Source
257
19.7k
  const std::error_code *getErrorStorage() const {
258
19.7k
    return const_cast<ErrorOr<T> *>(this)->getErrorStorage();
259
19.7k
  }
Unexecuted instantiation: llvm::ErrorOr<llvm::MD5::MD5Result>::getErrorStorage() const
Unexecuted instantiation: llvm::ErrorOr<llvm::sys::fs::perms>::getErrorStorage() const
Unexecuted instantiation: llvm::ErrorOr<llvm::sys::fs::space_info>::getErrorStorage() const
llvm::ErrorOr<std::__1::unique_ptr<llvm::Module, std::__1::default_delete<llvm::Module> > >::getErrorStorage() const
Line
Count
Source
257
1
  const std::error_code *getErrorStorage() const {
258
1
    return const_cast<ErrorOr<T> *>(this)->getErrorStorage();
259
1
  }
Unexecuted instantiation: llvm::ErrorOr<clang::PrecompiledPreamble>::getErrorStorage() const
Unexecuted instantiation: llvm::ErrorOr<clang::PrecompiledPreamble::TempPCHFile>::getErrorStorage() const
Unexecuted instantiation: llvm::ErrorOr<clang::serialized_diags::SerializedDiagnosticReader::Cursor>::getErrorStorage() const
Unexecuted instantiation: llvm::ErrorOr<unsigned int>::getErrorStorage() const
Unexecuted instantiation: llvm::ErrorOr<llvm::StringRef>::getErrorStorage() const
260
261
  union {
262
    AlignedCharArrayUnion<storage_type> TStorage;
263
    AlignedCharArrayUnion<std::error_code> ErrorStorage;
264
  };
265
  bool HasError : 1;
266
};
267
268
template <class T, class E>
269
typename std::enable_if<std::is_error_code_enum<E>::value ||
270
                            std::is_error_condition_enum<E>::value,
271
                        bool>::type
272
operator==(const ErrorOr<T> &Err, E Code) {
273
  return Err.getError() == Code;
274
}
275
276
} // end namespace llvm
277
278
#endif // LLVM_SUPPORT_ERROROR_H