/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/include/llvm/Support/FormatVariadicDetails.h
Line | Count | Source |
1 | | //===- FormatVariadicDetails.h - Helpers for FormatVariadic.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 LLVM_SUPPORT_FORMATVARIADIC_DETAILS_H |
10 | | #define LLVM_SUPPORT_FORMATVARIADIC_DETAILS_H |
11 | | |
12 | | #include "llvm/ADT/StringRef.h" |
13 | | #include "llvm/Support/raw_ostream.h" |
14 | | |
15 | | #include <type_traits> |
16 | | |
17 | | namespace llvm { |
18 | | template <typename T, typename Enable = void> struct format_provider {}; |
19 | | class Error; |
20 | | |
21 | | namespace detail { |
22 | | class format_adapter { |
23 | | virtual void anchor(); |
24 | | |
25 | | protected: |
26 | 471k | virtual ~format_adapter() {} |
27 | | |
28 | | public: |
29 | | virtual void format(raw_ostream &S, StringRef Options) = 0; |
30 | | }; |
31 | | |
32 | | template <typename T> class provider_format_adapter : public format_adapter { |
33 | | T Item; |
34 | | |
35 | | public: |
36 | 131k | explicit provider_format_adapter(T &&Item) : Item(std::forward<T>(Item)) {} llvm::detail::provider_format_adapter<llvm::StringRef&>::provider_format_adapter(llvm::StringRef&) Line | Count | Source | 36 | 9.98k | explicit provider_format_adapter(T &&Item) : Item(std::forward<T>(Item)) {} |
llvm::detail::provider_format_adapter<unsigned int&>::provider_format_adapter(unsigned int&) Line | Count | Source | 36 | 5.95k | explicit provider_format_adapter(T &&Item) : Item(std::forward<T>(Item)) {} |
llvm::detail::provider_format_adapter<unsigned int const&>::provider_format_adapter(unsigned int const&) Line | Count | Source | 36 | 399 | explicit provider_format_adapter(T &&Item) : Item(std::forward<T>(Item)) {} |
llvm::detail::provider_format_adapter<char const* const&>::provider_format_adapter(char const* const&) Line | Count | Source | 36 | 16 | explicit provider_format_adapter(T &&Item) : Item(std::forward<T>(Item)) {} |
llvm::detail::provider_format_adapter<int>::provider_format_adapter(int&&) Line | Count | Source | 36 | 3.66k | explicit provider_format_adapter(T &&Item) : Item(std::forward<T>(Item)) {} |
llvm::detail::provider_format_adapter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>::provider_format_adapter(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 36 | 20 | explicit provider_format_adapter(T &&Item) : Item(std::forward<T>(Item)) {} |
Unexecuted instantiation: llvm::detail::provider_format_adapter<llvm::json::Value&>::provider_format_adapter(llvm::json::Value&) llvm::detail::provider_format_adapter<unsigned int>::provider_format_adapter(unsigned int&&) Line | Count | Source | 36 | 17.8k | explicit provider_format_adapter(T &&Item) : Item(std::forward<T>(Item)) {} |
llvm::detail::provider_format_adapter<llvm::codeview::GloballyHashedType const&>::provider_format_adapter(llvm::codeview::GloballyHashedType const&) Line | Count | Source | 36 | 20 | explicit provider_format_adapter(T &&Item) : Item(std::forward<T>(Item)) {} |
llvm::detail::provider_format_adapter<llvm::dwarf::Tag>::provider_format_adapter(llvm::dwarf::Tag&&) Line | Count | Source | 36 | 8.06k | explicit provider_format_adapter(T &&Item) : Item(std::forward<T>(Item)) {} |
llvm::detail::provider_format_adapter<llvm::dwarf::Attribute const&>::provider_format_adapter(llvm::dwarf::Attribute const&) Line | Count | Source | 36 | 7.22k | explicit provider_format_adapter(T &&Item) : Item(std::forward<T>(Item)) {} |
llvm::detail::provider_format_adapter<llvm::dwarf::Form const&>::provider_format_adapter(llvm::dwarf::Form const&) Line | Count | Source | 36 | 7.86k | explicit provider_format_adapter(T &&Item) : Item(std::forward<T>(Item)) {} |
llvm::detail::provider_format_adapter<llvm::dwarf::Tag const&>::provider_format_adapter(llvm::dwarf::Tag const&) Line | Count | Source | 36 | 456 | explicit provider_format_adapter(T &&Item) : Item(std::forward<T>(Item)) {} |
llvm::detail::provider_format_adapter<llvm::dwarf::Index const&>::provider_format_adapter(llvm::dwarf::Index const&) Line | Count | Source | 36 | 769 | explicit provider_format_adapter(T &&Item) : Item(std::forward<T>(Item)) {} |
llvm::detail::provider_format_adapter<llvm::dwarf::Attribute&>::provider_format_adapter(llvm::dwarf::Attribute&) Line | Count | Source | 36 | 29.6k | explicit provider_format_adapter(T &&Item) : Item(std::forward<T>(Item)) {} |
llvm::detail::provider_format_adapter<llvm::dwarf::Form&>::provider_format_adapter(llvm::dwarf::Form&) Line | Count | Source | 36 | 19.0k | explicit provider_format_adapter(T &&Item) : Item(std::forward<T>(Item)) {} |
llvm::detail::provider_format_adapter<unsigned long>::provider_format_adapter(unsigned long&&) Line | Count | Source | 36 | 82 | explicit provider_format_adapter(T &&Item) : Item(std::forward<T>(Item)) {} |
llvm::detail::provider_format_adapter<unsigned long long const&>::provider_format_adapter(unsigned long long const&) Line | Count | Source | 36 | 3 | explicit provider_format_adapter(T &&Item) : Item(std::forward<T>(Item)) {} |
llvm::detail::provider_format_adapter<unsigned long long&>::provider_format_adapter(unsigned long long&) Line | Count | Source | 36 | 1.89k | explicit provider_format_adapter(T &&Item) : Item(std::forward<T>(Item)) {} |
llvm::detail::provider_format_adapter<char const*&>::provider_format_adapter(char const*&) Line | Count | Source | 36 | 1.06k | explicit provider_format_adapter(T &&Item) : Item(std::forward<T>(Item)) {} |
llvm::detail::provider_format_adapter<llvm::dwarf::Index&>::provider_format_adapter(llvm::dwarf::Index&) Line | Count | Source | 36 | 4 | explicit provider_format_adapter(T &&Item) : Item(std::forward<T>(Item)) {} |
llvm::detail::provider_format_adapter<llvm::dwarf::Form>::provider_format_adapter(llvm::dwarf::Form&&) Line | Count | Source | 36 | 3 | explicit provider_format_adapter(T &&Item) : Item(std::forward<T>(Item)) {} |
llvm::detail::provider_format_adapter<llvm::StringLiteral const&>::provider_format_adapter(llvm::StringLiteral const&) Line | Count | Source | 36 | 3 | explicit provider_format_adapter(T &&Item) : Item(std::forward<T>(Item)) {} |
llvm::detail::provider_format_adapter<llvm::dwarf::Index>::provider_format_adapter(llvm::dwarf::Index&&) Line | Count | Source | 36 | 5 | explicit provider_format_adapter(T &&Item) : Item(std::forward<T>(Item)) {} |
llvm::detail::provider_format_adapter<llvm::iterator_range<llvm::StringRef*> >::provider_format_adapter(llvm::iterator_range<llvm::StringRef*>&&) Line | Count | Source | 36 | 2 | explicit provider_format_adapter(T &&Item) : Item(std::forward<T>(Item)) {} |
llvm::detail::provider_format_adapter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::provider_format_adapter(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&) Line | Count | Source | 36 | 10.1k | explicit provider_format_adapter(T &&Item) : Item(std::forward<T>(Item)) {} |
llvm::detail::provider_format_adapter<llvm::json::Value>::provider_format_adapter(llvm::json::Value&&) Line | Count | Source | 36 | 2 | explicit provider_format_adapter(T &&Item) : Item(std::forward<T>(Item)) {} |
llvm::detail::provider_format_adapter<llvm::StringRef const&>::provider_format_adapter(llvm::StringRef const&) Line | Count | Source | 36 | 244 | explicit provider_format_adapter(T &&Item) : Item(std::forward<T>(Item)) {} |
llvm::detail::provider_format_adapter<char const*>::provider_format_adapter(char const*&&) Line | Count | Source | 36 | 112 | explicit provider_format_adapter(T &&Item) : Item(std::forward<T>(Item)) {} |
Unexecuted instantiation: llvm::detail::provider_format_adapter<llvm::codeview::GUID const&>::provider_format_adapter(llvm::codeview::GUID const&) llvm::detail::provider_format_adapter<llvm::StringRef>::provider_format_adapter(llvm::StringRef&&) Line | Count | Source | 36 | 6.90k | explicit provider_format_adapter(T &&Item) : Item(std::forward<T>(Item)) {} |
llvm::detail::provider_format_adapter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>::provider_format_adapter(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Line | Count | Source | 36 | 427 | explicit provider_format_adapter(T &&Item) : Item(std::forward<T>(Item)) {} |
|
37 | | |
38 | 131k | void format(llvm::raw_ostream &S, StringRef Options) override { |
39 | 131k | format_provider<typename std::decay<T>::type>::format(Item, S, Options); |
40 | 131k | } llvm::detail::provider_format_adapter<llvm::StringRef&>::format(llvm::raw_ostream&, llvm::StringRef) Line | Count | Source | 38 | 9.88k | void format(llvm::raw_ostream &S, StringRef Options) override { | 39 | 9.88k | format_provider<typename std::decay<T>::type>::format(Item, S, Options); | 40 | 9.88k | } |
llvm::detail::provider_format_adapter<unsigned int&>::format(llvm::raw_ostream&, llvm::StringRef) Line | Count | Source | 38 | 5.64k | void format(llvm::raw_ostream &S, StringRef Options) override { | 39 | 5.64k | format_provider<typename std::decay<T>::type>::format(Item, S, Options); | 40 | 5.64k | } |
llvm::detail::provider_format_adapter<unsigned int const&>::format(llvm::raw_ostream&, llvm::StringRef) Line | Count | Source | 38 | 399 | void format(llvm::raw_ostream &S, StringRef Options) override { | 39 | 399 | format_provider<typename std::decay<T>::type>::format(Item, S, Options); | 40 | 399 | } |
llvm::detail::provider_format_adapter<char const* const&>::format(llvm::raw_ostream&, llvm::StringRef) Line | Count | Source | 38 | 16 | void format(llvm::raw_ostream &S, StringRef Options) override { | 39 | 16 | format_provider<typename std::decay<T>::type>::format(Item, S, Options); | 40 | 16 | } |
llvm::detail::provider_format_adapter<int>::format(llvm::raw_ostream&, llvm::StringRef) Line | Count | Source | 38 | 3.66k | void format(llvm::raw_ostream &S, StringRef Options) override { | 39 | 3.66k | format_provider<typename std::decay<T>::type>::format(Item, S, Options); | 40 | 3.66k | } |
llvm::detail::provider_format_adapter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>::format(llvm::raw_ostream&, llvm::StringRef) Line | Count | Source | 38 | 20 | void format(llvm::raw_ostream &S, StringRef Options) override { | 39 | 20 | format_provider<typename std::decay<T>::type>::format(Item, S, Options); | 40 | 20 | } |
Unexecuted instantiation: llvm::detail::provider_format_adapter<llvm::json::Value&>::format(llvm::raw_ostream&, llvm::StringRef) llvm::detail::provider_format_adapter<unsigned int>::format(llvm::raw_ostream&, llvm::StringRef) Line | Count | Source | 38 | 17.8k | void format(llvm::raw_ostream &S, StringRef Options) override { | 39 | 17.8k | format_provider<typename std::decay<T>::type>::format(Item, S, Options); | 40 | 17.8k | } |
llvm::detail::provider_format_adapter<llvm::codeview::GloballyHashedType const&>::format(llvm::raw_ostream&, llvm::StringRef) Line | Count | Source | 38 | 20 | void format(llvm::raw_ostream &S, StringRef Options) override { | 39 | 20 | format_provider<typename std::decay<T>::type>::format(Item, S, Options); | 40 | 20 | } |
llvm::detail::provider_format_adapter<llvm::dwarf::Tag>::format(llvm::raw_ostream&, llvm::StringRef) Line | Count | Source | 38 | 8.06k | void format(llvm::raw_ostream &S, StringRef Options) override { | 39 | 8.06k | format_provider<typename std::decay<T>::type>::format(Item, S, Options); | 40 | 8.06k | } |
llvm::detail::provider_format_adapter<llvm::dwarf::Attribute const&>::format(llvm::raw_ostream&, llvm::StringRef) Line | Count | Source | 38 | 7.22k | void format(llvm::raw_ostream &S, StringRef Options) override { | 39 | 7.22k | format_provider<typename std::decay<T>::type>::format(Item, S, Options); | 40 | 7.22k | } |
llvm::detail::provider_format_adapter<llvm::dwarf::Form const&>::format(llvm::raw_ostream&, llvm::StringRef) Line | Count | Source | 38 | 7.86k | void format(llvm::raw_ostream &S, StringRef Options) override { | 39 | 7.86k | format_provider<typename std::decay<T>::type>::format(Item, S, Options); | 40 | 7.86k | } |
llvm::detail::provider_format_adapter<llvm::dwarf::Tag const&>::format(llvm::raw_ostream&, llvm::StringRef) Line | Count | Source | 38 | 456 | void format(llvm::raw_ostream &S, StringRef Options) override { | 39 | 456 | format_provider<typename std::decay<T>::type>::format(Item, S, Options); | 40 | 456 | } |
llvm::detail::provider_format_adapter<llvm::dwarf::Index const&>::format(llvm::raw_ostream&, llvm::StringRef) Line | Count | Source | 38 | 769 | void format(llvm::raw_ostream &S, StringRef Options) override { | 39 | 769 | format_provider<typename std::decay<T>::type>::format(Item, S, Options); | 40 | 769 | } |
llvm::detail::provider_format_adapter<llvm::dwarf::Attribute&>::format(llvm::raw_ostream&, llvm::StringRef) Line | Count | Source | 38 | 29.6k | void format(llvm::raw_ostream &S, StringRef Options) override { | 39 | 29.6k | format_provider<typename std::decay<T>::type>::format(Item, S, Options); | 40 | 29.6k | } |
llvm::detail::provider_format_adapter<llvm::dwarf::Form&>::format(llvm::raw_ostream&, llvm::StringRef) Line | Count | Source | 38 | 19.0k | void format(llvm::raw_ostream &S, StringRef Options) override { | 39 | 19.0k | format_provider<typename std::decay<T>::type>::format(Item, S, Options); | 40 | 19.0k | } |
llvm::detail::provider_format_adapter<unsigned long>::format(llvm::raw_ostream&, llvm::StringRef) Line | Count | Source | 38 | 82 | void format(llvm::raw_ostream &S, StringRef Options) override { | 39 | 82 | format_provider<typename std::decay<T>::type>::format(Item, S, Options); | 40 | 82 | } |
llvm::detail::provider_format_adapter<unsigned long long const&>::format(llvm::raw_ostream&, llvm::StringRef) Line | Count | Source | 38 | 3 | void format(llvm::raw_ostream &S, StringRef Options) override { | 39 | 3 | format_provider<typename std::decay<T>::type>::format(Item, S, Options); | 40 | 3 | } |
llvm::detail::provider_format_adapter<unsigned long long&>::format(llvm::raw_ostream&, llvm::StringRef) Line | Count | Source | 38 | 1.89k | void format(llvm::raw_ostream &S, StringRef Options) override { | 39 | 1.89k | format_provider<typename std::decay<T>::type>::format(Item, S, Options); | 40 | 1.89k | } |
llvm::detail::provider_format_adapter<char const*&>::format(llvm::raw_ostream&, llvm::StringRef) Line | Count | Source | 38 | 1.06k | void format(llvm::raw_ostream &S, StringRef Options) override { | 39 | 1.06k | format_provider<typename std::decay<T>::type>::format(Item, S, Options); | 40 | 1.06k | } |
llvm::detail::provider_format_adapter<llvm::dwarf::Index&>::format(llvm::raw_ostream&, llvm::StringRef) Line | Count | Source | 38 | 4 | void format(llvm::raw_ostream &S, StringRef Options) override { | 39 | 4 | format_provider<typename std::decay<T>::type>::format(Item, S, Options); | 40 | 4 | } |
llvm::detail::provider_format_adapter<llvm::dwarf::Form>::format(llvm::raw_ostream&, llvm::StringRef) Line | Count | Source | 38 | 3 | void format(llvm::raw_ostream &S, StringRef Options) override { | 39 | 3 | format_provider<typename std::decay<T>::type>::format(Item, S, Options); | 40 | 3 | } |
llvm::detail::provider_format_adapter<llvm::StringLiteral const&>::format(llvm::raw_ostream&, llvm::StringRef) Line | Count | Source | 38 | 3 | void format(llvm::raw_ostream &S, StringRef Options) override { | 39 | 3 | format_provider<typename std::decay<T>::type>::format(Item, S, Options); | 40 | 3 | } |
llvm::detail::provider_format_adapter<llvm::dwarf::Index>::format(llvm::raw_ostream&, llvm::StringRef) Line | Count | Source | 38 | 5 | void format(llvm::raw_ostream &S, StringRef Options) override { | 39 | 5 | format_provider<typename std::decay<T>::type>::format(Item, S, Options); | 40 | 5 | } |
llvm::detail::provider_format_adapter<llvm::iterator_range<llvm::StringRef*> >::format(llvm::raw_ostream&, llvm::StringRef) Line | Count | Source | 38 | 2 | void format(llvm::raw_ostream &S, StringRef Options) override { | 39 | 2 | format_provider<typename std::decay<T>::type>::format(Item, S, Options); | 40 | 2 | } |
llvm::detail::provider_format_adapter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::format(llvm::raw_ostream&, llvm::StringRef) Line | Count | Source | 38 | 10.2k | void format(llvm::raw_ostream &S, StringRef Options) override { | 39 | 10.2k | format_provider<typename std::decay<T>::type>::format(Item, S, Options); | 40 | 10.2k | } |
llvm::detail::provider_format_adapter<llvm::json::Value>::format(llvm::raw_ostream&, llvm::StringRef) Line | Count | Source | 38 | 2 | void format(llvm::raw_ostream &S, StringRef Options) override { | 39 | 2 | format_provider<typename std::decay<T>::type>::format(Item, S, Options); | 40 | 2 | } |
llvm::detail::provider_format_adapter<llvm::StringRef const&>::format(llvm::raw_ostream&, llvm::StringRef) Line | Count | Source | 38 | 244 | void format(llvm::raw_ostream &S, StringRef Options) override { | 39 | 244 | format_provider<typename std::decay<T>::type>::format(Item, S, Options); | 40 | 244 | } |
llvm::detail::provider_format_adapter<char const*>::format(llvm::raw_ostream&, llvm::StringRef) Line | Count | Source | 38 | 112 | void format(llvm::raw_ostream &S, StringRef Options) override { | 39 | 112 | format_provider<typename std::decay<T>::type>::format(Item, S, Options); | 40 | 112 | } |
Unexecuted instantiation: llvm::detail::provider_format_adapter<llvm::codeview::GUID const&>::format(llvm::raw_ostream&, llvm::StringRef) llvm::detail::provider_format_adapter<llvm::StringRef>::format(llvm::raw_ostream&, llvm::StringRef) Line | Count | Source | 38 | 6.90k | void format(llvm::raw_ostream &S, StringRef Options) override { | 39 | 6.90k | format_provider<typename std::decay<T>::type>::format(Item, S, Options); | 40 | 6.90k | } |
llvm::detail::provider_format_adapter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>::format(llvm::raw_ostream&, llvm::StringRef) Line | Count | Source | 38 | 427 | void format(llvm::raw_ostream &S, StringRef Options) override { | 39 | 427 | format_provider<typename std::decay<T>::type>::format(Item, S, Options); | 40 | 427 | } |
|
41 | | }; |
42 | | |
43 | | template <typename T> |
44 | | class stream_operator_format_adapter : public format_adapter { |
45 | | T Item; |
46 | | |
47 | | public: |
48 | | explicit stream_operator_format_adapter(T &&Item) |
49 | | : Item(std::forward<T>(Item)) {} |
50 | | |
51 | | void format(llvm::raw_ostream &S, StringRef Options) override { S << Item; } |
52 | | }; |
53 | | |
54 | | template <typename T> class missing_format_adapter; |
55 | | |
56 | | // Test if format_provider<T> is defined on T and contains a member function |
57 | | // with the signature: |
58 | | // static void format(const T&, raw_stream &, StringRef); |
59 | | // |
60 | | template <class T> class has_FormatProvider { |
61 | | public: |
62 | | using Decayed = typename std::decay<T>::type; |
63 | | typedef void (*Signature_format)(const Decayed &, llvm::raw_ostream &, |
64 | | StringRef); |
65 | | |
66 | | template <typename U> |
67 | | static char test(SameType<Signature_format, &U::format> *); |
68 | | |
69 | | template <typename U> static double test(...); |
70 | | |
71 | | static bool const value = |
72 | | (sizeof(test<llvm::format_provider<Decayed>>(nullptr)) == 1); |
73 | | }; |
74 | | |
75 | | // Test if raw_ostream& << T -> raw_ostream& is findable via ADL. |
76 | | template <class T> class has_StreamOperator { |
77 | | public: |
78 | | using ConstRefT = const typename std::decay<T>::type &; |
79 | | |
80 | | template <typename U> |
81 | | static char test(typename std::enable_if< |
82 | | std::is_same<decltype(std::declval<llvm::raw_ostream &>() |
83 | | << std::declval<U>()), |
84 | | llvm::raw_ostream &>::value, |
85 | | int *>::type); |
86 | | |
87 | | template <typename U> static double test(...); |
88 | | |
89 | | static bool const value = (sizeof(test<ConstRefT>(nullptr)) == 1); |
90 | | }; |
91 | | |
92 | | // Simple template that decides whether a type T should use the member-function |
93 | | // based format() invocation. |
94 | | template <typename T> |
95 | | struct uses_format_member |
96 | | : public std::integral_constant< |
97 | | bool, |
98 | | std::is_base_of<format_adapter, |
99 | | typename std::remove_reference<T>::type>::value> {}; |
100 | | |
101 | | // Simple template that decides whether a type T should use the format_provider |
102 | | // based format() invocation. The member function takes priority, so this test |
103 | | // will only be true if there is not ALSO a format member. |
104 | | template <typename T> |
105 | | struct uses_format_provider |
106 | | : public std::integral_constant< |
107 | | bool, !uses_format_member<T>::value && has_FormatProvider<T>::value> { |
108 | | }; |
109 | | |
110 | | // Simple template that decides whether a type T should use the operator<< |
111 | | // based format() invocation. This takes last priority. |
112 | | template <typename T> |
113 | | struct uses_stream_operator |
114 | | : public std::integral_constant<bool, !uses_format_member<T>::value && |
115 | | !uses_format_provider<T>::value && |
116 | | has_StreamOperator<T>::value> {}; |
117 | | |
118 | | // Simple template that decides whether a type T has neither a member-function |
119 | | // nor format_provider based implementation that it can use. Mostly used so |
120 | | // that the compiler spits out a nice diagnostic when a type with no format |
121 | | // implementation can be located. |
122 | | template <typename T> |
123 | | struct uses_missing_provider |
124 | | : public std::integral_constant<bool, !uses_format_member<T>::value && |
125 | | !uses_format_provider<T>::value && |
126 | | !uses_stream_operator<T>::value> { |
127 | | }; |
128 | | |
129 | | template <typename T> |
130 | | typename std::enable_if<uses_format_member<T>::value, T>::type |
131 | | build_format_adapter(T &&Item) { |
132 | | return std::forward<T>(Item); |
133 | | } |
134 | | |
135 | | template <typename T> |
136 | | typename std::enable_if<uses_format_provider<T>::value, |
137 | | provider_format_adapter<T>>::type |
138 | 131k | build_format_adapter(T &&Item) { |
139 | 131k | return provider_format_adapter<T>(std::forward<T>(Item)); |
140 | 131k | } std::__1::enable_if<uses_format_provider<llvm::StringRef&>::value, llvm::detail::provider_format_adapter<llvm::StringRef&> >::type llvm::detail::build_format_adapter<llvm::StringRef&>(llvm::StringRef&&&) Line | Count | Source | 138 | 9.98k | build_format_adapter(T &&Item) { | 139 | 9.98k | return provider_format_adapter<T>(std::forward<T>(Item)); | 140 | 9.98k | } |
std::__1::enable_if<uses_format_provider<unsigned int&>::value, llvm::detail::provider_format_adapter<unsigned int&> >::type llvm::detail::build_format_adapter<unsigned int&>(unsigned int&&&) Line | Count | Source | 138 | 5.95k | build_format_adapter(T &&Item) { | 139 | 5.95k | return provider_format_adapter<T>(std::forward<T>(Item)); | 140 | 5.95k | } |
std::__1::enable_if<uses_format_provider<unsigned int const&>::value, llvm::detail::provider_format_adapter<unsigned int const&> >::type llvm::detail::build_format_adapter<unsigned int const&>(unsigned int const&&&) Line | Count | Source | 138 | 399 | build_format_adapter(T &&Item) { | 139 | 399 | return provider_format_adapter<T>(std::forward<T>(Item)); | 140 | 399 | } |
std::__1::enable_if<uses_format_provider<char const* const&>::value, llvm::detail::provider_format_adapter<char const* const&> >::type llvm::detail::build_format_adapter<char const* const&>(char const* const&&&) Line | Count | Source | 138 | 16 | build_format_adapter(T &&Item) { | 139 | 16 | return provider_format_adapter<T>(std::forward<T>(Item)); | 140 | 16 | } |
std::__1::enable_if<uses_format_provider<int>::value, llvm::detail::provider_format_adapter<int> >::type llvm::detail::build_format_adapter<int>(int&&) Line | Count | Source | 138 | 3.66k | build_format_adapter(T &&Item) { | 139 | 3.66k | return provider_format_adapter<T>(std::forward<T>(Item)); | 140 | 3.66k | } |
std::__1::enable_if<uses_format_provider<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>::value, llvm::detail::provider_format_adapter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&> >::type llvm::detail::build_format_adapter<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&&&) Line | Count | Source | 138 | 20 | build_format_adapter(T &&Item) { | 139 | 20 | return provider_format_adapter<T>(std::forward<T>(Item)); | 140 | 20 | } |
Unexecuted instantiation: std::__1::enable_if<uses_format_provider<llvm::json::Value&>::value, llvm::detail::provider_format_adapter<llvm::json::Value&> >::type llvm::detail::build_format_adapter<llvm::json::Value&>(llvm::json::Value&&&) std::__1::enable_if<uses_format_provider<unsigned int>::value, llvm::detail::provider_format_adapter<unsigned int> >::type llvm::detail::build_format_adapter<unsigned int>(unsigned int&&) Line | Count | Source | 138 | 17.8k | build_format_adapter(T &&Item) { | 139 | 17.8k | return provider_format_adapter<T>(std::forward<T>(Item)); | 140 | 17.8k | } |
std::__1::enable_if<uses_format_provider<llvm::codeview::GloballyHashedType const&>::value, llvm::detail::provider_format_adapter<llvm::codeview::GloballyHashedType const&> >::type llvm::detail::build_format_adapter<llvm::codeview::GloballyHashedType const&>(llvm::codeview::GloballyHashedType const&&&) Line | Count | Source | 138 | 20 | build_format_adapter(T &&Item) { | 139 | 20 | return provider_format_adapter<T>(std::forward<T>(Item)); | 140 | 20 | } |
std::__1::enable_if<uses_format_provider<llvm::dwarf::Tag>::value, llvm::detail::provider_format_adapter<llvm::dwarf::Tag> >::type llvm::detail::build_format_adapter<llvm::dwarf::Tag>(llvm::dwarf::Tag&&) Line | Count | Source | 138 | 8.06k | build_format_adapter(T &&Item) { | 139 | 8.06k | return provider_format_adapter<T>(std::forward<T>(Item)); | 140 | 8.06k | } |
std::__1::enable_if<uses_format_provider<llvm::dwarf::Attribute const&>::value, llvm::detail::provider_format_adapter<llvm::dwarf::Attribute const&> >::type llvm::detail::build_format_adapter<llvm::dwarf::Attribute const&>(llvm::dwarf::Attribute const&&&) Line | Count | Source | 138 | 7.22k | build_format_adapter(T &&Item) { | 139 | 7.22k | return provider_format_adapter<T>(std::forward<T>(Item)); | 140 | 7.22k | } |
std::__1::enable_if<uses_format_provider<llvm::dwarf::Form const&>::value, llvm::detail::provider_format_adapter<llvm::dwarf::Form const&> >::type llvm::detail::build_format_adapter<llvm::dwarf::Form const&>(llvm::dwarf::Form const&&&) Line | Count | Source | 138 | 7.86k | build_format_adapter(T &&Item) { | 139 | 7.86k | return provider_format_adapter<T>(std::forward<T>(Item)); | 140 | 7.86k | } |
std::__1::enable_if<uses_format_provider<llvm::dwarf::Tag const&>::value, llvm::detail::provider_format_adapter<llvm::dwarf::Tag const&> >::type llvm::detail::build_format_adapter<llvm::dwarf::Tag const&>(llvm::dwarf::Tag const&&&) Line | Count | Source | 138 | 456 | build_format_adapter(T &&Item) { | 139 | 456 | return provider_format_adapter<T>(std::forward<T>(Item)); | 140 | 456 | } |
std::__1::enable_if<uses_format_provider<llvm::dwarf::Index const&>::value, llvm::detail::provider_format_adapter<llvm::dwarf::Index const&> >::type llvm::detail::build_format_adapter<llvm::dwarf::Index const&>(llvm::dwarf::Index const&&&) Line | Count | Source | 138 | 769 | build_format_adapter(T &&Item) { | 139 | 769 | return provider_format_adapter<T>(std::forward<T>(Item)); | 140 | 769 | } |
std::__1::enable_if<uses_format_provider<llvm::dwarf::Attribute&>::value, llvm::detail::provider_format_adapter<llvm::dwarf::Attribute&> >::type llvm::detail::build_format_adapter<llvm::dwarf::Attribute&>(llvm::dwarf::Attribute&&&) Line | Count | Source | 138 | 29.6k | build_format_adapter(T &&Item) { | 139 | 29.6k | return provider_format_adapter<T>(std::forward<T>(Item)); | 140 | 29.6k | } |
std::__1::enable_if<uses_format_provider<llvm::dwarf::Form&>::value, llvm::detail::provider_format_adapter<llvm::dwarf::Form&> >::type llvm::detail::build_format_adapter<llvm::dwarf::Form&>(llvm::dwarf::Form&&&) Line | Count | Source | 138 | 19.0k | build_format_adapter(T &&Item) { | 139 | 19.0k | return provider_format_adapter<T>(std::forward<T>(Item)); | 140 | 19.0k | } |
std::__1::enable_if<uses_format_provider<unsigned long>::value, llvm::detail::provider_format_adapter<unsigned long> >::type llvm::detail::build_format_adapter<unsigned long>(unsigned long&&) Line | Count | Source | 138 | 82 | build_format_adapter(T &&Item) { | 139 | 82 | return provider_format_adapter<T>(std::forward<T>(Item)); | 140 | 82 | } |
std::__1::enable_if<uses_format_provider<unsigned long long const&>::value, llvm::detail::provider_format_adapter<unsigned long long const&> >::type llvm::detail::build_format_adapter<unsigned long long const&>(unsigned long long const&&&) Line | Count | Source | 138 | 3 | build_format_adapter(T &&Item) { | 139 | 3 | return provider_format_adapter<T>(std::forward<T>(Item)); | 140 | 3 | } |
std::__1::enable_if<uses_format_provider<unsigned long long&>::value, llvm::detail::provider_format_adapter<unsigned long long&> >::type llvm::detail::build_format_adapter<unsigned long long&>(unsigned long long&&&) Line | Count | Source | 138 | 1.89k | build_format_adapter(T &&Item) { | 139 | 1.89k | return provider_format_adapter<T>(std::forward<T>(Item)); | 140 | 1.89k | } |
std::__1::enable_if<uses_format_provider<char const*&>::value, llvm::detail::provider_format_adapter<char const*&> >::type llvm::detail::build_format_adapter<char const*&>(char const*&&&) Line | Count | Source | 138 | 1.06k | build_format_adapter(T &&Item) { | 139 | 1.06k | return provider_format_adapter<T>(std::forward<T>(Item)); | 140 | 1.06k | } |
std::__1::enable_if<uses_format_provider<llvm::dwarf::Index&>::value, llvm::detail::provider_format_adapter<llvm::dwarf::Index&> >::type llvm::detail::build_format_adapter<llvm::dwarf::Index&>(llvm::dwarf::Index&&&) Line | Count | Source | 138 | 4 | build_format_adapter(T &&Item) { | 139 | 4 | return provider_format_adapter<T>(std::forward<T>(Item)); | 140 | 4 | } |
std::__1::enable_if<uses_format_provider<llvm::dwarf::Form>::value, llvm::detail::provider_format_adapter<llvm::dwarf::Form> >::type llvm::detail::build_format_adapter<llvm::dwarf::Form>(llvm::dwarf::Form&&) Line | Count | Source | 138 | 3 | build_format_adapter(T &&Item) { | 139 | 3 | return provider_format_adapter<T>(std::forward<T>(Item)); | 140 | 3 | } |
std::__1::enable_if<uses_format_provider<llvm::StringLiteral const&>::value, llvm::detail::provider_format_adapter<llvm::StringLiteral const&> >::type llvm::detail::build_format_adapter<llvm::StringLiteral const&>(llvm::StringLiteral const&&&) Line | Count | Source | 138 | 3 | build_format_adapter(T &&Item) { | 139 | 3 | return provider_format_adapter<T>(std::forward<T>(Item)); | 140 | 3 | } |
std::__1::enable_if<uses_format_provider<llvm::dwarf::Index>::value, llvm::detail::provider_format_adapter<llvm::dwarf::Index> >::type llvm::detail::build_format_adapter<llvm::dwarf::Index>(llvm::dwarf::Index&&) Line | Count | Source | 138 | 5 | build_format_adapter(T &&Item) { | 139 | 5 | return provider_format_adapter<T>(std::forward<T>(Item)); | 140 | 5 | } |
std::__1::enable_if<uses_format_provider<llvm::iterator_range<llvm::StringRef*> >::value, llvm::detail::provider_format_adapter<llvm::iterator_range<llvm::StringRef*> > >::type llvm::detail::build_format_adapter<llvm::iterator_range<llvm::StringRef*> >(llvm::iterator_range<llvm::StringRef*>&&) Line | Count | Source | 138 | 2 | build_format_adapter(T &&Item) { | 139 | 2 | return provider_format_adapter<T>(std::forward<T>(Item)); | 140 | 2 | } |
std::__1::enable_if<uses_format_provider<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value, llvm::detail::provider_format_adapter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >::type llvm::detail::build_format_adapter<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> >&&) Line | Count | Source | 138 | 10.1k | build_format_adapter(T &&Item) { | 139 | 10.1k | return provider_format_adapter<T>(std::forward<T>(Item)); | 140 | 10.1k | } |
std::__1::enable_if<uses_format_provider<llvm::json::Value>::value, llvm::detail::provider_format_adapter<llvm::json::Value> >::type llvm::detail::build_format_adapter<llvm::json::Value>(llvm::json::Value&&) Line | Count | Source | 138 | 2 | build_format_adapter(T &&Item) { | 139 | 2 | return provider_format_adapter<T>(std::forward<T>(Item)); | 140 | 2 | } |
std::__1::enable_if<uses_format_provider<llvm::StringRef const&>::value, llvm::detail::provider_format_adapter<llvm::StringRef const&> >::type llvm::detail::build_format_adapter<llvm::StringRef const&>(llvm::StringRef const&&&) Line | Count | Source | 138 | 244 | build_format_adapter(T &&Item) { | 139 | 244 | return provider_format_adapter<T>(std::forward<T>(Item)); | 140 | 244 | } |
std::__1::enable_if<uses_format_provider<char const*>::value, llvm::detail::provider_format_adapter<char const*> >::type llvm::detail::build_format_adapter<char const*>(char const*&&) Line | Count | Source | 138 | 112 | build_format_adapter(T &&Item) { | 139 | 112 | return provider_format_adapter<T>(std::forward<T>(Item)); | 140 | 112 | } |
Unexecuted instantiation: std::__1::enable_if<uses_format_provider<llvm::codeview::GUID const&>::value, llvm::detail::provider_format_adapter<llvm::codeview::GUID const&> >::type llvm::detail::build_format_adapter<llvm::codeview::GUID const&>(llvm::codeview::GUID const&&&) std::__1::enable_if<uses_format_provider<llvm::StringRef>::value, llvm::detail::provider_format_adapter<llvm::StringRef> >::type llvm::detail::build_format_adapter<llvm::StringRef>(llvm::StringRef&&) Line | Count | Source | 138 | 6.90k | build_format_adapter(T &&Item) { | 139 | 6.90k | return provider_format_adapter<T>(std::forward<T>(Item)); | 140 | 6.90k | } |
std::__1::enable_if<uses_format_provider<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>::value, llvm::detail::provider_format_adapter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&> >::type llvm::detail::build_format_adapter<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> >&&&) Line | Count | Source | 138 | 427 | build_format_adapter(T &&Item) { | 139 | 427 | return provider_format_adapter<T>(std::forward<T>(Item)); | 140 | 427 | } |
|
141 | | |
142 | | template <typename T> |
143 | | typename std::enable_if<uses_stream_operator<T>::value, |
144 | | stream_operator_format_adapter<T>>::type |
145 | | build_format_adapter(T &&Item) { |
146 | | // If the caller passed an Error by value, then stream_operator_format_adapter |
147 | | // would be responsible for consuming it. |
148 | | // Make the caller opt into this by calling fmt_consume(). |
149 | | static_assert( |
150 | | !std::is_same<llvm::Error, typename std::remove_cv<T>::type>::value, |
151 | | "llvm::Error-by-value must be wrapped in fmt_consume() for formatv"); |
152 | | return stream_operator_format_adapter<T>(std::forward<T>(Item)); |
153 | | } |
154 | | |
155 | | template <typename T> |
156 | | typename std::enable_if<uses_missing_provider<T>::value, |
157 | | missing_format_adapter<T>>::type |
158 | | build_format_adapter(T &&Item) { |
159 | | return missing_format_adapter<T>(); |
160 | | } |
161 | | } |
162 | | } |
163 | | |
164 | | #endif |