/home/arjun/llvm-project/llvm/include/llvm/ADT/Optional.h
Line | Count | Source (jump to first uncovered line) |
1 | | //===- Optional.h - Simple variant for passing optional values --*- 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 | | // This file provides Optional, a template class modeled in the spirit of |
10 | | // OCaml's 'opt' variant. The idea is to strongly type whether or not |
11 | | // a value can be optional. |
12 | | // |
13 | | //===----------------------------------------------------------------------===// |
14 | | |
15 | | #ifndef LLVM_ADT_OPTIONAL_H |
16 | | #define LLVM_ADT_OPTIONAL_H |
17 | | |
18 | | #include "llvm/ADT/None.h" |
19 | | #include "llvm/Support/Compiler.h" |
20 | | #include "llvm/Support/type_traits.h" |
21 | | #include <cassert> |
22 | | #include <memory> |
23 | | #include <new> |
24 | | #include <utility> |
25 | | |
26 | | namespace llvm { |
27 | | |
28 | | class raw_ostream; |
29 | | |
30 | | namespace optional_detail { |
31 | | |
32 | | struct in_place_t {}; |
33 | | |
34 | | /// Storage for any type. |
35 | | template <typename T, bool = is_trivially_copyable<T>::value> |
36 | | class OptionalStorage { |
37 | | union { |
38 | | char empty; |
39 | | T value; |
40 | | }; |
41 | | bool hasVal; |
42 | | |
43 | | public: |
44 | 74 | ~OptionalStorage() { reset(); } _ZN4llvm15optional_detail15OptionalStorageINS_11SmallVectorIlLj8EEELb0EED2Ev Line | Count | Source | 44 | 72 | ~OptionalStorage() { reset(); } |
Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEELb0EED2Ev VirtualFileSystem.cpp:_ZN4llvm15optional_detail15OptionalStorageIN12_GLOBAL__N_114RealFileSystem16WorkingDirectoryELb0EED2Ev Line | Count | Source | 44 | 2 | ~OptionalStorage() { reset(); } |
Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir10DiagnosticELb0EED2Ev Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir21FlatAffineConstraintsELb0EED2Ev Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageISt4pairIN4mlir10IdentifierENS3_9AttributeEELb0EED2Ev Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir19MutableOperandRangeELb0EED2Ev |
45 | | |
46 | 46 | OptionalStorage() noexcept : empty(), hasVal(false) {} Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageINS_5APIntELb0EEC2Ev VirtualFileSystem.cpp:_ZN4llvm15optional_detail15OptionalStorageIN12_GLOBAL__N_114RealFileSystem16WorkingDirectoryELb0EEC2Ev Line | Count | Source | 46 | 2 | OptionalStorage() noexcept : empty(), hasVal(false) {} |
Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEELb0EEC2Ev Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir21FlatAffineConstraintsELb0EEC2Ev _ZN4llvm15optional_detail15OptionalStorageINS_11SmallVectorIlLj8EEELb0EEC2Ev Line | Count | Source | 46 | 44 | OptionalStorage() noexcept : empty(), hasVal(false) {} |
Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageISt4pairIN4mlir10IdentifierENS3_9AttributeEELb0EEC2Ev Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir10DiagnosticELb0EEC2Ev Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir11SymbolTable8UseRangeELb0EEC2Ev |
47 | | |
48 | | OptionalStorage(OptionalStorage const &other) : OptionalStorage() { |
49 | | if (other.hasValue()) { |
50 | | emplace(other.value); |
51 | | } |
52 | | } |
53 | 0 | OptionalStorage(OptionalStorage &&other) : OptionalStorage() { |
54 | 0 | if (other.hasValue()) { |
55 | 0 | emplace(std::move(other.value)); |
56 | 0 | } |
57 | 0 | } |
58 | | |
59 | | template <class... Args> |
60 | | explicit OptionalStorage(in_place_t, Args &&... args) |
61 | 28 | : value(std::forward<Args>(args)...), hasVal(true) {} Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageINS_5APIntELb0EEC2IJS2_EEENS0_10in_place_tEDpOT_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEELb0EEC2IJS7_EEENS0_10in_place_tEDpOT_ _ZN4llvm15optional_detail15OptionalStorageINS_11SmallVectorIlLj8EEELb0EEC2IJS3_EEENS0_10in_place_tEDpOT_ Line | Count | Source | 61 | 17 | : value(std::forward<Args>(args)...), hasVal(true) {} |
_ZN4llvm15optional_detail15OptionalStorageINS_11SmallVectorIlLj8EEELb0EEC2IJRKS3_EEENS0_10in_place_tEDpOT_ Line | Count | Source | 61 | 11 | : value(std::forward<Args>(args)...), hasVal(true) {} |
Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir19MutableOperandRangeELb0EEC2IJS3_EEENS0_10in_place_tEDpOT_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageISt4pairIN4mlir10IdentifierENS3_9AttributeEELb0EEC2IJRKS6_EEENS0_10in_place_tEDpOT_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageISt4pairIN4mlir10IdentifierENS3_9AttributeEELb0EEC2IJS6_EEENS0_10in_place_tEDpOT_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir10DiagnosticELb0EEC2IJS3_EEENS0_10in_place_tEDpOT_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir11SymbolTable8UseRangeELb0EEC2IJS4_EEENS0_10in_place_tEDpOT_ |
62 | | |
63 | 74 | void reset() noexcept { |
64 | 74 | if (hasVal) { |
65 | 28 | value.~T(); |
66 | 28 | hasVal = false; |
67 | 28 | } |
68 | 74 | } _ZN4llvm15optional_detail15OptionalStorageINS_11SmallVectorIlLj8EEELb0EE5resetEv Line | Count | Source | 63 | 72 | void reset() noexcept { | 64 | 72 | if (hasVal) { | 65 | 28 | value.~T(); | 66 | 28 | hasVal = false; | 67 | 28 | } | 68 | 72 | } |
Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir10DiagnosticELb0EE5resetEv Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageISt4pairIjS2_IN4mlir10IdentifierENS3_9AttributeEEELb0EE5resetEv Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEELb0EE5resetEv Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageINS_5APIntELb0EE5resetEv VirtualFileSystem.cpp:_ZN4llvm15optional_detail15OptionalStorageIN12_GLOBAL__N_114RealFileSystem16WorkingDirectoryELb0EE5resetEv Line | Count | Source | 63 | 2 | void reset() noexcept { | 64 | 2 | if (hasVal) { | 65 | 0 | value.~T(); | 66 | 0 | hasVal = false; | 67 | 0 | } | 68 | 2 | } |
Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir21FlatAffineConstraintsELb0EE5resetEv Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir11ResultRangeELb0EE5resetEv Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageISt4pairIN4mlir10IdentifierENS3_9AttributeEELb0EE5resetEv Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir19MutableOperandRangeELb0EE5resetEv Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir11SymbolTable8UseRangeELb0EE5resetEv |
69 | | |
70 | 87 | bool hasValue() const noexcept { return hasVal; } _ZNK4llvm15optional_detail15OptionalStorageINS_11SmallVectorIlLj8EEELb0EE8hasValueEv Line | Count | Source | 70 | 87 | bool hasValue() const noexcept { return hasVal; } |
Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageIN4mlir10DiagnosticELb0EE8hasValueEv Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEELb0EE8hasValueEv Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageINS_5APIntELb0EE8hasValueEv Unexecuted instantiation: VirtualFileSystem.cpp:_ZNK4llvm15optional_detail15OptionalStorageIN12_GLOBAL__N_114RealFileSystem16WorkingDirectoryELb0EE8hasValueEv Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageIN4mlir21FlatAffineConstraintsELb0EE8hasValueEv Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageIN4mlir11ResultRangeELb0EE8hasValueEv Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageIN4mlir19MutableOperandRangeELb0EE8hasValueEv Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageISt4pairIN4mlir10IdentifierENS3_9AttributeEELb0EE8hasValueEv Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageIN4mlir11SymbolTable8UseRangeELb0EE8hasValueEv Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageISt4pairIjS2_IN4mlir10IdentifierENS3_9AttributeEEELb0EE8hasValueEv |
71 | | |
72 | 64 | T &getValue() LLVM_LVALUE_FUNCTION noexcept { |
73 | 64 | assert(hasVal); |
74 | 64 | return value; |
75 | 64 | } _ZNR4llvm15optional_detail15OptionalStorageINS_11SmallVectorIlLj8EEELb0EE8getValueEv Line | Count | Source | 72 | 64 | T &getValue() LLVM_LVALUE_FUNCTION noexcept { | 73 | 64 | assert(hasVal); | 74 | 64 | return value; | 75 | 64 | } |
Unexecuted instantiation: _ZNR4llvm15optional_detail15OptionalStorageIN4mlir10DiagnosticELb0EE8getValueEv Unexecuted instantiation: _ZNR4llvm15optional_detail15OptionalStorageINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEELb0EE8getValueEv Unexecuted instantiation: _ZNR4llvm15optional_detail15OptionalStorageIN4mlir21FlatAffineConstraintsELb0EE8getValueEv Unexecuted instantiation: _ZNR4llvm15optional_detail15OptionalStorageIN4mlir11ResultRangeELb0EE8getValueEv Unexecuted instantiation: _ZNR4llvm15optional_detail15OptionalStorageIN4mlir19MutableOperandRangeELb0EE8getValueEv Unexecuted instantiation: _ZNR4llvm15optional_detail15OptionalStorageISt4pairIN4mlir10IdentifierENS3_9AttributeEELb0EE8getValueEv Unexecuted instantiation: _ZNR4llvm15optional_detail15OptionalStorageISt4pairIjS2_IN4mlir10IdentifierENS3_9AttributeEEELb0EE8getValueEv |
76 | 0 | T const &getValue() const LLVM_LVALUE_FUNCTION noexcept { |
77 | 0 | assert(hasVal); |
78 | 0 | return value; |
79 | 0 | } |
80 | | #if LLVM_HAS_RVALUE_REFERENCE_THIS |
81 | | T &&getValue() && noexcept { |
82 | | assert(hasVal); |
83 | | return std::move(value); |
84 | | } |
85 | | #endif |
86 | | |
87 | 0 | template <class... Args> void emplace(Args &&... args) { |
88 | 0 | reset(); |
89 | 0 | ::new ((void *)std::addressof(value)) T(std::forward<Args>(args)...); |
90 | 0 | hasVal = true; |
91 | 0 | } Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir10DiagnosticELb0EE7emplaceIJS3_EEEvDpOT_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageINS_11SmallVectorIlLj8EEELb0EE7emplaceIJS3_EEEvDpOT_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEELb0EE7emplaceIJS7_EEEvDpOT_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageINS_5APIntELb0EE7emplaceIJS2_EEEvDpOT_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir21FlatAffineConstraintsELb0EE7emplaceIJS3_EEEvDpOT_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir19MutableOperandRangeELb0EE7emplaceIJS3_EEEvDpOT_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageISt4pairIN4mlir10IdentifierENS3_9AttributeEELb0EE7emplaceIJS6_EEEvDpOT_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir11SymbolTable8UseRangeELb0EE7emplaceIJS4_EEEvDpOT_ |
92 | | |
93 | | OptionalStorage &operator=(T const &y) { |
94 | | if (hasValue()) { |
95 | | value = y; |
96 | | } else { |
97 | | ::new ((void *)std::addressof(value)) T(y); |
98 | | hasVal = true; |
99 | | } |
100 | | return *this; |
101 | | } |
102 | 0 | OptionalStorage &operator=(T &&y) { |
103 | 0 | if (hasValue()) { |
104 | 0 | value = std::move(y); |
105 | 0 | } else { |
106 | 0 | ::new ((void *)std::addressof(value)) T(std::move(y)); |
107 | 0 | hasVal = true; |
108 | 0 | } |
109 | 0 | return *this; |
110 | 0 | } Unexecuted instantiation: VirtualFileSystem.cpp:_ZN4llvm15optional_detail15OptionalStorageIN12_GLOBAL__N_114RealFileSystem16WorkingDirectoryELb0EEaSEOS4_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEELb0EEaSEOS7_ |
111 | | |
112 | | OptionalStorage &operator=(OptionalStorage const &other) { |
113 | | if (other.hasValue()) { |
114 | | if (hasValue()) { |
115 | | value = other.value; |
116 | | } else { |
117 | | ::new ((void *)std::addressof(value)) T(other.value); |
118 | | hasVal = true; |
119 | | } |
120 | | } else { |
121 | | reset(); |
122 | | } |
123 | | return *this; |
124 | | } |
125 | | |
126 | | OptionalStorage &operator=(OptionalStorage &&other) { |
127 | | if (other.hasValue()) { |
128 | | if (hasValue()) { |
129 | | value = std::move(other.value); |
130 | | } else { |
131 | | ::new ((void *)std::addressof(value)) T(std::move(other.value)); |
132 | | hasVal = true; |
133 | | } |
134 | | } else { |
135 | | reset(); |
136 | | } |
137 | | return *this; |
138 | | } |
139 | | }; |
140 | | |
141 | | template <typename T> class OptionalStorage<T, true> { |
142 | | union { |
143 | | char empty; |
144 | | T value; |
145 | | }; |
146 | | bool hasVal = false; |
147 | | |
148 | | public: |
149 | | ~OptionalStorage() = default; |
150 | | |
151 | 2.28k | OptionalStorage() noexcept : empty{} {} _ZN4llvm15optional_detail15OptionalStorageIN4mlir5ValueELb1EEC2Ev Line | Count | Source | 151 | 31 | OptionalStorage() noexcept : empty{} {} |
_ZN4llvm15optional_detail15OptionalStorageINS_9StringRefELb1EEC2Ev Line | Count | Source | 151 | 8 | OptionalStorage() noexcept : empty{} {} |
_ZN4llvm15optional_detail15OptionalStorageIjLb1EEC2Ev Line | Count | Source | 151 | 1.93k | OptionalStorage() noexcept : empty{} {} |
Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageINS_6Triple11SubArchTypeELb1EEC2Ev _ZN4llvm15optional_detail15OptionalStorageINS_6Triple10VendorTypeELb1EEC2Ev Line | Count | Source | 151 | 10 | OptionalStorage() noexcept : empty{} {} |
_ZN4llvm15optional_detail15OptionalStorageINS_6Triple6OSTypeELb1EEC2Ev Line | Count | Source | 151 | 8 | OptionalStorage() noexcept : empty{} {} |
_ZN4llvm15optional_detail15OptionalStorageINS_6Triple16ObjectFormatTypeELb1EEC2Ev Line | Count | Source | 151 | 6 | OptionalStorage() noexcept : empty{} {} |
_ZN4llvm15optional_detail15OptionalStorageINS_6Triple8ArchTypeELb1EEC2Ev Line | Count | Source | 151 | 8 | OptionalStorage() noexcept : empty{} {} |
_ZN4llvm15optional_detail15OptionalStorageINS_6Triple15EnvironmentTypeELb1EEC2Ev Line | Count | Source | 151 | 8 | OptionalStorage() noexcept : empty{} {} |
Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageINS_3ARM7ISAKindELb1EEC2Ev Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageImLb1EEC2Ev Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageINS_3sys2fs9file_typeELb1EEC2Ev Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageINS_3sys2fs5permsELb1EEC2Ev Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageINS_10AlignStyleELb1EEC2Ev Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIPKcLb1EEC2Ev Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageINS_8ArrayRefINS_9StringRefEEELb1EEC2Ev Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageINS_18ThreadPoolStrategyELb1EEC2Ev Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIlLb1EEC2Ev Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir8LocationELb1EEC2Ev _ZN4llvm15optional_detail15OptionalStorageIN4mlir7Simplex5PivotELb1EEC2Ev Line | Count | Source | 151 | 264 | OptionalStorage() noexcept : empty{} {} |
_ZN4llvm15optional_detail15OptionalStorageIN4mlir8FractionELb1EEC2Ev Line | Count | Source | 151 | 7 | OptionalStorage() noexcept : empty{} {} |
Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir13AtomicRMWKindELb1EEC2Ev Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir13CmpFPredicateELb1EEC2Ev Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir13CmpIPredicateELb1EEC2Ev Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageINS_8OptionalIN4mlir13AtomicRMWKindEEELb1EEC2Ev Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageINS_8OptionalIN4mlir13CmpFPredicateEEELb1EEC2Ev Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageINS_8OptionalIN4mlir13CmpIPredicateEEELb1EEC2Ev Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir12OperandRangeELb1EEC2Ev Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir13BlockArgumentELb1EEC2Ev Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIiLb1EEC2Ev Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir14FileLineColLocELb1EEC2Ev Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir11CallSiteLocELb1EEC2Ev Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageINS_15MutableArrayRefIN4mlir6detail12ExpectedDiagEEELb1EEC2Ev Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir11SymbolTable10VisibilityELb1EEC2Ev Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir10WalkResultELb1EEC2Ev |
152 | | |
153 | | OptionalStorage(OptionalStorage const &other) = default; |
154 | | OptionalStorage(OptionalStorage &&other) = default; |
155 | | |
156 | | OptionalStorage &operator=(OptionalStorage const &other) = default; |
157 | | OptionalStorage &operator=(OptionalStorage &&other) = default; |
158 | | |
159 | | template <class... Args> |
160 | | explicit OptionalStorage(in_place_t, Args &&... args) |
161 | 1.46k | : value(std::forward<Args>(args)...), hasVal(true) {} _ZN4llvm15optional_detail15OptionalStorageIjLb1EEC2IJjEEENS0_10in_place_tEDpOT_ Line | Count | Source | 161 | 606 | : value(std::forward<Args>(args)...), hasVal(true) {} |
Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageImLb1EEC2IJRKmEEENS0_10in_place_tEDpOT_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageImLb1EEC2IJmEEENS0_10in_place_tEDpOT_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageINS_10AlignStyleELb1EEC2IJS2_EEENS0_10in_place_tEDpOT_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageINS_15ReplacementItemELb1EEC2IJS2_EEENS0_10in_place_tEDpOT_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIjLb1EEC2IJRKjEEENS0_10in_place_tEDpOT_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageINS_9StringRefELb1EEC2IJS2_EEENS0_10in_place_tEDpOT_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageINS_18ThreadPoolStrategyELb1EEC2IJS2_EEENS0_10in_place_tEDpOT_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir5ValueELb1EEC2IJRKS3_EEENS0_10in_place_tEDpOT_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIlLb1EEC2IJlEEENS0_10in_place_tEDpOT_ _ZN4llvm15optional_detail15OptionalStorageIN4mlir7Simplex5PivotELb1EEC2IJS4_EEENS0_10in_place_tEDpOT_ Line | Count | Source | 161 | 606 | : value(std::forward<Args>(args)...), hasVal(true) {} |
_ZN4llvm15optional_detail15OptionalStorageIN4mlir8FractionELb1EEC2IJS3_EEENS0_10in_place_tEDpOT_ Line | Count | Source | 161 | 251 | : value(std::forward<Args>(args)...), hasVal(true) {} |
Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir13AtomicRMWKindELb1EEC2IJS3_EEENS0_10in_place_tEDpOT_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir13CmpFPredicateELb1EEC2IJS3_EEENS0_10in_place_tEDpOT_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir13CmpIPredicateELb1EEC2IJS3_EEENS0_10in_place_tEDpOT_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir12OperandRangeELb1EEC2IJS3_EEENS0_10in_place_tEDpOT_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir13BlockArgumentELb1EEC2IJS3_EEENS0_10in_place_tEDpOT_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir14FileLineColLocELb1EEC2IJS3_EEENS0_10in_place_tEDpOT_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir11CallSiteLocELb1EEC2IJS3_EEENS0_10in_place_tEDpOT_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageINS_15MutableArrayRefIN4mlir6detail12ExpectedDiagEEELb1EEC2IJS6_EEENS0_10in_place_tEDpOT_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir8LocationELb1EEC2IJS3_EEENS0_10in_place_tEDpOT_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir8LocationELb1EEC2IJRKS3_EEENS0_10in_place_tEDpOT_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir10WalkResultELb1EEC2IJS3_EEENS0_10in_place_tEDpOT_ |
162 | | |
163 | 0 | void reset() noexcept { |
164 | 0 | if (hasVal) { |
165 | 0 | value.~T(); |
166 | 0 | hasVal = false; |
167 | 0 | } |
168 | 0 | } |
169 | | |
170 | 15.8k | bool hasValue() const noexcept { return hasVal; } Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageINS_5AlignELb1EE8hasValueEv Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageINS_12DenormalMode16DenormalModeKindELb1EE8hasValueEv Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageIN4mlir11ParseResultELb1EE8hasValueEv Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageIN4mlir5ValueELb1EE8hasValueEv Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageImLb1EE8hasValueEv Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageIPKcLb1EE8hasValueEv Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageINS_18ThreadPoolStrategyELb1EE8hasValueEv Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageIbLb1EE8hasValueEv _ZNK4llvm15optional_detail15OptionalStorageINS_9StringRefELb1EE8hasValueEv Line | Count | Source | 170 | 192 | bool hasValue() const noexcept { return hasVal; } |
Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageINS_6Triple11SubArchTypeELb1EE8hasValueEv _ZNK4llvm15optional_detail15OptionalStorageINS_6Triple10VendorTypeELb1EE8hasValueEv Line | Count | Source | 170 | 170 | bool hasValue() const noexcept { return hasVal; } |
_ZNK4llvm15optional_detail15OptionalStorageINS_6Triple6OSTypeELb1EE8hasValueEv Line | Count | Source | 170 | 304 | bool hasValue() const noexcept { return hasVal; } |
_ZNK4llvm15optional_detail15OptionalStorageINS_6Triple16ObjectFormatTypeELb1EE8hasValueEv Line | Count | Source | 170 | 36 | bool hasValue() const noexcept { return hasVal; } |
_ZNK4llvm15optional_detail15OptionalStorageINS_6Triple8ArchTypeELb1EE8hasValueEv Line | Count | Source | 170 | 696 | bool hasValue() const noexcept { return hasVal; } |
_ZNK4llvm15optional_detail15OptionalStorageINS_6Triple15EnvironmentTypeELb1EE8hasValueEv Line | Count | Source | 170 | 168 | bool hasValue() const noexcept { return hasVal; } |
Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageINS_3ARM7ISAKindELb1EE8hasValueEv _ZNK4llvm15optional_detail15OptionalStorageIjLb1EE8hasValueEv Line | Count | Source | 170 | 13.1k | bool hasValue() const noexcept { return hasVal; } |
Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageINS_3sys2fs9file_typeELb1EE8hasValueEv Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageINS_3sys2fs5permsELb1EE8hasValueEv Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageINS_10AlignStyleELb1EE8hasValueEv Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageINS_15ReplacementItemELb1EE8hasValueEv Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageINS_8ArrayRefINS_9StringRefEEELb1EE8hasValueEv Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageIlLb1EE8hasValueEv _ZNK4llvm15optional_detail15OptionalStorageIN4mlir8FractionELb1EE8hasValueEv Line | Count | Source | 170 | 258 | bool hasValue() const noexcept { return hasVal; } |
_ZNK4llvm15optional_detail15OptionalStorageIN4mlir7Simplex5PivotELb1EE8hasValueEv Line | Count | Source | 170 | 870 | bool hasValue() const noexcept { return hasVal; } |
Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageINS_8OptionalIN4mlir13AtomicRMWKindEEELb1EE8hasValueEv Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageINS_8OptionalIN4mlir13CmpFPredicateEEELb1EE8hasValueEv Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageINS_8OptionalIN4mlir13CmpIPredicateEEELb1EE8hasValueEv Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageIN4mlir13BlockArgumentELb1EE8hasValueEv Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageIN4mlir13AtomicRMWKindELb1EE8hasValueEv Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageIN4mlir13CmpFPredicateELb1EE8hasValueEv Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageIN4mlir13CmpIPredicateELb1EE8hasValueEv Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageIN4mlir12OperandRangeELb1EE8hasValueEv Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageIiLb1EE8hasValueEv Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageIN4mlir8LocationELb1EE8hasValueEv Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageIN4mlir14FileLineColLocELb1EE8hasValueEv Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageIN4mlir11CallSiteLocELb1EE8hasValueEv Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageINS_15MutableArrayRefIN4mlir6detail12ExpectedDiagEEELb1EE8hasValueEv Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageIN4mlir11SymbolTable10VisibilityELb1EE8hasValueEv Unexecuted instantiation: _ZNK4llvm15optional_detail15OptionalStorageIN4mlir10WalkResultELb1EE8hasValueEv |
171 | | |
172 | 9.68k | T &getValue() LLVM_LVALUE_FUNCTION noexcept { |
173 | 9.68k | assert(hasVal); |
174 | 9.68k | return value; |
175 | 9.68k | } Unexecuted instantiation: _ZNR4llvm15optional_detail15OptionalStorageINS_5AlignELb1EE8getValueEv Unexecuted instantiation: _ZNR4llvm15optional_detail15OptionalStorageINS_12DenormalMode16DenormalModeKindELb1EE8getValueEv Unexecuted instantiation: _ZNR4llvm15optional_detail15OptionalStorageIPKcLb1EE8getValueEv Unexecuted instantiation: _ZNR4llvm15optional_detail15OptionalStorageINS_18ThreadPoolStrategyELb1EE8getValueEv Unexecuted instantiation: _ZNR4llvm15optional_detail15OptionalStorageINS_9StringRefELb1EE8getValueEv Unexecuted instantiation: _ZNR4llvm15optional_detail15OptionalStorageINS_6Triple11SubArchTypeELb1EE8getValueEv Unexecuted instantiation: _ZNR4llvm15optional_detail15OptionalStorageINS_6Triple10VendorTypeELb1EE8getValueEv _ZNR4llvm15optional_detail15OptionalStorageINS_6Triple6OSTypeELb1EE8getValueEv Line | Count | Source | 172 | 8 | T &getValue() LLVM_LVALUE_FUNCTION noexcept { | 173 | 8 | assert(hasVal); | 174 | 8 | return value; | 175 | 8 | } |
Unexecuted instantiation: _ZNR4llvm15optional_detail15OptionalStorageINS_6Triple16ObjectFormatTypeELb1EE8getValueEv _ZNR4llvm15optional_detail15OptionalStorageINS_6Triple8ArchTypeELb1EE8getValueEv Line | Count | Source | 172 | 8 | T &getValue() LLVM_LVALUE_FUNCTION noexcept { | 173 | 8 | assert(hasVal); | 174 | 8 | return value; | 175 | 8 | } |
_ZNR4llvm15optional_detail15OptionalStorageINS_6Triple15EnvironmentTypeELb1EE8getValueEv Line | Count | Source | 172 | 8 | T &getValue() LLVM_LVALUE_FUNCTION noexcept { | 173 | 8 | assert(hasVal); | 174 | 8 | return value; | 175 | 8 | } |
Unexecuted instantiation: _ZNR4llvm15optional_detail15OptionalStorageINS_3ARM7ISAKindELb1EE8getValueEv _ZNR4llvm15optional_detail15OptionalStorageIjLb1EE8getValueEv Line | Count | Source | 172 | 8.46k | T &getValue() LLVM_LVALUE_FUNCTION noexcept { | 173 | 8.46k | assert(hasVal); | 174 | 8.46k | return value; | 175 | 8.46k | } |
Unexecuted instantiation: _ZNR4llvm15optional_detail15OptionalStorageImLb1EE8getValueEv Unexecuted instantiation: _ZNR4llvm15optional_detail15OptionalStorageIbLb1EE8getValueEv Unexecuted instantiation: _ZNR4llvm15optional_detail15OptionalStorageINS_10AlignStyleELb1EE8getValueEv Unexecuted instantiation: _ZNR4llvm15optional_detail15OptionalStorageINS_15ReplacementItemELb1EE8getValueEv Unexecuted instantiation: _ZNR4llvm15optional_detail15OptionalStorageINS_8ArrayRefINS_9StringRefEEELb1EE8getValueEv Unexecuted instantiation: _ZNR4llvm15optional_detail15OptionalStorageIN4mlir5ValueELb1EE8getValueEv Unexecuted instantiation: _ZNR4llvm15optional_detail15OptionalStorageIlLb1EE8getValueEv _ZNR4llvm15optional_detail15OptionalStorageIN4mlir7Simplex5PivotELb1EE8getValueEv Line | Count | Source | 172 | 999 | T &getValue() LLVM_LVALUE_FUNCTION noexcept { | 173 | 999 | assert(hasVal); | 174 | 999 | return value; | 175 | 999 | } |
_ZNR4llvm15optional_detail15OptionalStorageIN4mlir8FractionELb1EE8getValueEv Line | Count | Source | 172 | 199 | T &getValue() LLVM_LVALUE_FUNCTION noexcept { | 173 | 199 | assert(hasVal); | 174 | 199 | return value; | 175 | 199 | } |
Unexecuted instantiation: _ZNR4llvm15optional_detail15OptionalStorageINS_8OptionalIN4mlir13AtomicRMWKindEEELb1EE8getValueEv Unexecuted instantiation: _ZNR4llvm15optional_detail15OptionalStorageINS_8OptionalIN4mlir13CmpFPredicateEEELb1EE8getValueEv Unexecuted instantiation: _ZNR4llvm15optional_detail15OptionalStorageINS_8OptionalIN4mlir13CmpIPredicateEEELb1EE8getValueEv Unexecuted instantiation: _ZNR4llvm15optional_detail15OptionalStorageIN4mlir13AtomicRMWKindELb1EE8getValueEv Unexecuted instantiation: _ZNR4llvm15optional_detail15OptionalStorageIN4mlir13CmpFPredicateELb1EE8getValueEv Unexecuted instantiation: _ZNR4llvm15optional_detail15OptionalStorageIN4mlir13CmpIPredicateELb1EE8getValueEv Unexecuted instantiation: _ZNR4llvm15optional_detail15OptionalStorageIN4mlir12OperandRangeELb1EE8getValueEv Unexecuted instantiation: _ZNR4llvm15optional_detail15OptionalStorageIN4mlir8LocationELb1EE8getValueEv Unexecuted instantiation: _ZNR4llvm15optional_detail15OptionalStorageIN4mlir14FileLineColLocELb1EE8getValueEv Unexecuted instantiation: _ZNR4llvm15optional_detail15OptionalStorageIN4mlir11CallSiteLocELb1EE8getValueEv Unexecuted instantiation: _ZNR4llvm15optional_detail15OptionalStorageINS_15MutableArrayRefIN4mlir6detail12ExpectedDiagEEELb1EE8getValueEv Unexecuted instantiation: _ZNR4llvm15optional_detail15OptionalStorageIN4mlir11SymbolTable10VisibilityELb1EE8getValueEv |
176 | 540 | T const &getValue() const LLVM_LVALUE_FUNCTION noexcept { |
177 | 540 | assert(hasVal); |
178 | 540 | return value; |
179 | 540 | } Unexecuted instantiation: _ZNKR4llvm15optional_detail15OptionalStorageINS_5AlignELb1EE8getValueEv Unexecuted instantiation: _ZNKR4llvm15optional_detail15OptionalStorageIN4mlir11ParseResultELb1EE8getValueEv Unexecuted instantiation: _ZNKR4llvm15optional_detail15OptionalStorageIN4mlir5ValueELb1EE8getValueEv Unexecuted instantiation: _ZNKR4llvm15optional_detail15OptionalStorageImLb1EE8getValueEv _ZNKR4llvm15optional_detail15OptionalStorageIjLb1EE8getValueEv Line | Count | Source | 176 | 540 | T const &getValue() const LLVM_LVALUE_FUNCTION noexcept { | 177 | 540 | assert(hasVal); | 178 | 540 | return value; | 179 | 540 | } |
Unexecuted instantiation: _ZNKR4llvm15optional_detail15OptionalStorageINS_3sys2fs9file_typeELb1EE8getValueEv Unexecuted instantiation: _ZNKR4llvm15optional_detail15OptionalStorageINS_3sys2fs5permsELb1EE8getValueEv Unexecuted instantiation: _ZNKR4llvm15optional_detail15OptionalStorageINS_9StringRefELb1EE8getValueEv Unexecuted instantiation: _ZNKR4llvm15optional_detail15OptionalStorageIlLb1EE8getValueEv Unexecuted instantiation: _ZNKR4llvm15optional_detail15OptionalStorageIiLb1EE8getValueEv Unexecuted instantiation: _ZNKR4llvm15optional_detail15OptionalStorageIN4mlir10WalkResultELb1EE8getValueEv |
180 | | #if LLVM_HAS_RVALUE_REFERENCE_THIS |
181 | | T &&getValue() && noexcept { |
182 | | assert(hasVal); |
183 | | return std::move(value); |
184 | | } |
185 | | #endif |
186 | | |
187 | 0 | template <class... Args> void emplace(Args &&... args) { |
188 | 0 | reset(); |
189 | 0 | ::new ((void *)std::addressof(value)) T(std::forward<Args>(args)...); |
190 | 0 | hasVal = true; |
191 | 0 | } |
192 | | |
193 | 2.03k | OptionalStorage &operator=(T const &y) { |
194 | 2.03k | if (hasValue()) { |
195 | 639 | value = y; |
196 | 1.39k | } else { |
197 | 1.39k | ::new ((void *)std::addressof(value)) T(y); |
198 | 1.39k | hasVal = true; |
199 | 1.39k | } |
200 | 2.03k | return *this; |
201 | 2.03k | } Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir5ValueELb1EEaSERKS3_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageImLb1EEaSERKm Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIbLb1EEaSERKb Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIlLb1EEaSERKl _ZN4llvm15optional_detail15OptionalStorageIjLb1EEaSERKj Line | Count | Source | 193 | 2.03k | OptionalStorage &operator=(T const &y) { | 194 | 2.03k | if (hasValue()) { | 195 | 639 | value = y; | 196 | 1.39k | } else { | 197 | 1.39k | ::new ((void *)std::addressof(value)) T(y); | 198 | 1.39k | hasVal = true; | 199 | 1.39k | } | 200 | 2.03k | return *this; | 201 | 2.03k | } |
Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIiLb1EEaSERKi Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir8LocationELb1EEaSERKS3_ |
202 | 24 | OptionalStorage &operator=(T &&y) { |
203 | 24 | if (hasValue()) { |
204 | 0 | value = std::move(y); |
205 | 24 | } else { |
206 | 24 | ::new ((void *)std::addressof(value)) T(std::move(y)); |
207 | 24 | hasVal = true; |
208 | 24 | } |
209 | 24 | return *this; |
210 | 24 | } Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageINS_12DenormalMode16DenormalModeKindELb1EEaSEOS3_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIPKcLb1EEaSEOS3_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIbLb1EEaSEOb Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageINS_6Triple11SubArchTypeELb1EEaSEOS3_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageINS_6Triple10VendorTypeELb1EEaSEOS3_ _ZN4llvm15optional_detail15OptionalStorageINS_6Triple6OSTypeELb1EEaSEOS3_ Line | Count | Source | 202 | 8 | OptionalStorage &operator=(T &&y) { | 203 | 8 | if (hasValue()) { | 204 | 0 | value = std::move(y); | 205 | 8 | } else { | 206 | 8 | ::new ((void *)std::addressof(value)) T(std::move(y)); | 207 | 8 | hasVal = true; | 208 | 8 | } | 209 | 8 | return *this; | 210 | 8 | } |
Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageINS_6Triple16ObjectFormatTypeELb1EEaSEOS3_ _ZN4llvm15optional_detail15OptionalStorageINS_6Triple8ArchTypeELb1EEaSEOS3_ Line | Count | Source | 202 | 8 | OptionalStorage &operator=(T &&y) { | 203 | 8 | if (hasValue()) { | 204 | 0 | value = std::move(y); | 205 | 8 | } else { | 206 | 8 | ::new ((void *)std::addressof(value)) T(std::move(y)); | 207 | 8 | hasVal = true; | 208 | 8 | } | 209 | 8 | return *this; | 210 | 8 | } |
_ZN4llvm15optional_detail15OptionalStorageINS_6Triple15EnvironmentTypeELb1EEaSEOS3_ Line | Count | Source | 202 | 8 | OptionalStorage &operator=(T &&y) { | 203 | 8 | if (hasValue()) { | 204 | 0 | value = std::move(y); | 205 | 8 | } else { | 206 | 8 | ::new ((void *)std::addressof(value)) T(std::move(y)); | 207 | 8 | hasVal = true; | 208 | 8 | } | 209 | 8 | return *this; | 210 | 8 | } |
Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageINS_9StringRefELb1EEaSEOS2_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageINS_3ARM7ISAKindELb1EEaSEOS3_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIjLb1EEaSEOj Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageImLb1EEaSEOm Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageINS_8OptionalIN4mlir13AtomicRMWKindEEELb1EEaSEOS5_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageINS_8OptionalIN4mlir13CmpFPredicateEEELb1EEaSEOS5_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageINS_8OptionalIN4mlir13CmpIPredicateEEELb1EEaSEOS5_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIlLb1EEaSEOl Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIiLb1EEaSEOi Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageINS_15MutableArrayRefIN4mlir6detail12ExpectedDiagEEELb1EEaSEOS6_ Unexecuted instantiation: _ZN4llvm15optional_detail15OptionalStorageIN4mlir11SymbolTable10VisibilityELb1EEaSEOS4_ |
211 | | }; |
212 | | |
213 | | } // namespace optional_detail |
214 | | |
215 | | template <typename T> class Optional { |
216 | | optional_detail::OptionalStorage<T> Storage; |
217 | | |
218 | | public: |
219 | | using value_type = T; |
220 | | |
221 | 2.30k | constexpr Optional() {} Unexecuted instantiation: _ZN4llvm8OptionalINS_6Triple11SubArchTypeEEC2Ev _ZN4llvm8OptionalINS_6Triple10VendorTypeEEC2Ev Line | Count | Source | 221 | 10 | constexpr Optional() {} |
_ZN4llvm8OptionalINS_6Triple6OSTypeEEC2Ev Line | Count | Source | 221 | 8 | constexpr Optional() {} |
_ZN4llvm8OptionalINS_6Triple16ObjectFormatTypeEEC2Ev Line | Count | Source | 221 | 6 | constexpr Optional() {} |
_ZN4llvm8OptionalINS_6Triple8ArchTypeEEC2Ev Line | Count | Source | 221 | 8 | constexpr Optional() {} |
_ZN4llvm8OptionalINS_6Triple15EnvironmentTypeEEC2Ev Line | Count | Source | 221 | 8 | constexpr Optional() {} |
_ZN4llvm8OptionalINS_9StringRefEEC2Ev Line | Count | Source | 221 | 6 | constexpr Optional() {} |
Unexecuted instantiation: _ZN4llvm8OptionalINS_3ARM7ISAKindEEC2Ev Line | Count | Source | 221 | 1.93k | constexpr Optional() {} |
Unexecuted instantiation: _ZN4llvm8OptionalImEC2Ev VirtualFileSystem.cpp:_ZN4llvm8OptionalIN12_GLOBAL__N_114RealFileSystem16WorkingDirectoryEEC2Ev Line | Count | Source | 221 | 2 | constexpr Optional() {} |
Unexecuted instantiation: _ZN4llvm8OptionalIPKcEC2Ev Unexecuted instantiation: _ZN4llvm8OptionalINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2Ev Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir21FlatAffineConstraintsEEC2Ev _ZN4llvm8OptionalIN4mlir7Simplex5PivotEEC2Ev Line | Count | Source | 221 | 264 | constexpr Optional() {} |
_ZN4llvm8OptionalIN4mlir8FractionEEC2Ev Line | Count | Source | 221 | 7 | constexpr Optional() {} |
_ZN4llvm8OptionalINS_11SmallVectorIlLj8EEEEC2Ev Line | Count | Source | 221 | 44 | constexpr Optional() {} |
Unexecuted instantiation: _ZN4llvm8OptionalINS0_IN4mlir13AtomicRMWKindEEEEC2Ev Unexecuted instantiation: _ZN4llvm8OptionalINS0_IN4mlir13CmpFPredicateEEEEC2Ev Unexecuted instantiation: _ZN4llvm8OptionalINS0_IN4mlir13CmpIPredicateEEEEC2Ev Unexecuted instantiation: _ZN4llvm8OptionalIlEC2Ev Unexecuted instantiation: _ZN4llvm8OptionalIiEC2Ev Unexecuted instantiation: _ZN4llvm8OptionalISt4pairIN4mlir10IdentifierENS2_9AttributeEEEC2Ev Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir11SymbolTable10VisibilityEEC2Ev |
222 | 33 | constexpr Optional(NoneType) {} _ZN4llvm8OptionalIN4mlir5ValueEEC2ENS_8NoneTypeE Line | Count | Source | 222 | 31 | constexpr Optional(NoneType) {} |
_ZN4llvm8OptionalINS_9StringRefEEC2ENS_8NoneTypeE Line | Count | Source | 222 | 2 | constexpr Optional(NoneType) {} |
Unexecuted instantiation: _ZN4llvm8OptionalINS_5APIntEEC2ENS_8NoneTypeE Unexecuted instantiation: _ZN4llvm8OptionalIjEC2ENS_8NoneTypeE Unexecuted instantiation: _ZN4llvm8OptionalINS_3sys2fs9file_typeEEC2ENS_8NoneTypeE Unexecuted instantiation: _ZN4llvm8OptionalINS_3sys2fs5permsEEC2ENS_8NoneTypeE Unexecuted instantiation: _ZN4llvm8OptionalImEC2ENS_8NoneTypeE Unexecuted instantiation: _ZN4llvm8OptionalINS_10AlignStyleEEC2ENS_8NoneTypeE Unexecuted instantiation: _ZN4llvm8OptionalINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2ENS_8NoneTypeE Unexecuted instantiation: _ZN4llvm8OptionalINS_8ArrayRefINS_9StringRefEEEEC2ENS_8NoneTypeE Unexecuted instantiation: _ZN4llvm8OptionalINS_18ThreadPoolStrategyEEC2ENS_8NoneTypeE Unexecuted instantiation: _ZN4llvm8OptionalIlEC2ENS_8NoneTypeE Unexecuted instantiation: _ZN4llvm8OptionalINS_11SmallVectorIlLj8EEEEC2ENS_8NoneTypeE Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir8LocationEEC2ENS_8NoneTypeE Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir13AtomicRMWKindEEC2ENS_8NoneTypeE Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir13CmpFPredicateEEC2ENS_8NoneTypeE Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir13CmpIPredicateEEC2ENS_8NoneTypeE Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir12OperandRangeEEC2ENS_8NoneTypeE Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir13BlockArgumentEEC2ENS_8NoneTypeE Unexecuted instantiation: _ZN4llvm8OptionalISt4pairIN4mlir10IdentifierENS2_9AttributeEEEC2ENS_8NoneTypeE Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir14FileLineColLocEEC2ENS_8NoneTypeE Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir11CallSiteLocEEC2ENS_8NoneTypeE Unexecuted instantiation: _ZN4llvm8OptionalINS_15MutableArrayRefIN4mlir6detail12ExpectedDiagEEEEC2ENS_8NoneTypeE Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir10WalkResultEEC2ENS_8NoneTypeE Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir11SymbolTable8UseRangeEEC2ENS_8NoneTypeE |
223 | | |
224 | 11 | Optional(const T &y) : Storage(optional_detail::in_place_t{}, y) {} Unexecuted instantiation: _ZN4llvm8OptionalImEC2ERKm Unexecuted instantiation: _ZN4llvm8OptionalIjEC2ERKj Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir5ValueEEC2ERKS2_ _ZN4llvm8OptionalINS_11SmallVectorIlLj8EEEEC2ERKS2_ Line | Count | Source | 224 | 11 | Optional(const T &y) : Storage(optional_detail::in_place_t{}, y) {} |
Unexecuted instantiation: _ZN4llvm8OptionalISt4pairIN4mlir10IdentifierENS2_9AttributeEEEC2ERKS5_ Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir8LocationEEC2ERKS2_ |
225 | | Optional(const Optional &O) = default; |
226 | | |
227 | 1.48k | Optional(T &&y) : Storage(optional_detail::in_place_t{}, std::move(y)) {} Unexecuted instantiation: _ZN4llvm8OptionalINS_5APIntEEC2EOS1_ _ZN4llvm8OptionalIjEC2EOj Line | Count | Source | 227 | 606 | Optional(T &&y) : Storage(optional_detail::in_place_t{}, std::move(y)) {} |
Unexecuted instantiation: _ZN4llvm8OptionalImEC2EOm Unexecuted instantiation: _ZN4llvm8OptionalINS_10AlignStyleEEC2EOS1_ Unexecuted instantiation: _ZN4llvm8OptionalINS_15ReplacementItemEEC2EOS1_ Unexecuted instantiation: _ZN4llvm8OptionalINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2EOS6_ Unexecuted instantiation: _ZN4llvm8OptionalINS_9StringRefEEC2EOS1_ Unexecuted instantiation: _ZN4llvm8OptionalINS_18ThreadPoolStrategyEEC2EOS1_ Unexecuted instantiation: _ZN4llvm8OptionalIlEC2EOl _ZN4llvm8OptionalINS_11SmallVectorIlLj8EEEEC2EOS2_ Line | Count | Source | 227 | 17 | Optional(T &&y) : Storage(optional_detail::in_place_t{}, std::move(y)) {} |
_ZN4llvm8OptionalIN4mlir7Simplex5PivotEEC2EOS3_ Line | Count | Source | 227 | 606 | Optional(T &&y) : Storage(optional_detail::in_place_t{}, std::move(y)) {} |
_ZN4llvm8OptionalIN4mlir8FractionEEC2EOS2_ Line | Count | Source | 227 | 251 | Optional(T &&y) : Storage(optional_detail::in_place_t{}, std::move(y)) {} |
Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir13AtomicRMWKindEEC2EOS2_ Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir13CmpFPredicateEEC2EOS2_ Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir13CmpIPredicateEEC2EOS2_ Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir12OperandRangeEEC2EOS2_ Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir19MutableOperandRangeEEC2EOS2_ Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir13BlockArgumentEEC2EOS2_ Unexecuted instantiation: _ZN4llvm8OptionalISt4pairIN4mlir10IdentifierENS2_9AttributeEEEC2EOS5_ Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir10DiagnosticEEC2EOS2_ Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir14FileLineColLocEEC2EOS2_ Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir11CallSiteLocEEC2EOS2_ Unexecuted instantiation: _ZN4llvm8OptionalINS_15MutableArrayRefIN4mlir6detail12ExpectedDiagEEEEC2EOS5_ Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir8LocationEEC2EOS2_ Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir10WalkResultEEC2EOS2_ Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir11SymbolTable8UseRangeEEC2EOS3_ |
228 | 0 | Optional(Optional &&O) = default; |
229 | | |
230 | 24 | Optional &operator=(T &&y) { |
231 | 24 | Storage = std::move(y); |
232 | 24 | return *this; |
233 | 24 | } Unexecuted instantiation: _ZN4llvm8OptionalINS_12DenormalMode16DenormalModeKindEEaSEOS2_ Unexecuted instantiation: _ZN4llvm8OptionalIPKcEaSEOS2_ Unexecuted instantiation: _ZN4llvm8OptionalIbEaSEOb Unexecuted instantiation: _ZN4llvm8OptionalINS_6Triple11SubArchTypeEEaSEOS2_ Unexecuted instantiation: _ZN4llvm8OptionalINS_6Triple10VendorTypeEEaSEOS2_ _ZN4llvm8OptionalINS_6Triple6OSTypeEEaSEOS2_ Line | Count | Source | 230 | 8 | Optional &operator=(T &&y) { | 231 | 8 | Storage = std::move(y); | 232 | 8 | return *this; | 233 | 8 | } |
Unexecuted instantiation: _ZN4llvm8OptionalINS_6Triple16ObjectFormatTypeEEaSEOS2_ _ZN4llvm8OptionalINS_6Triple8ArchTypeEEaSEOS2_ Line | Count | Source | 230 | 8 | Optional &operator=(T &&y) { | 231 | 8 | Storage = std::move(y); | 232 | 8 | return *this; | 233 | 8 | } |
_ZN4llvm8OptionalINS_6Triple15EnvironmentTypeEEaSEOS2_ Line | Count | Source | 230 | 8 | Optional &operator=(T &&y) { | 231 | 8 | Storage = std::move(y); | 232 | 8 | return *this; | 233 | 8 | } |
Unexecuted instantiation: _ZN4llvm8OptionalINS_9StringRefEEaSEOS1_ Unexecuted instantiation: _ZN4llvm8OptionalINS_3ARM7ISAKindEEaSEOS2_ Unexecuted instantiation: _ZN4llvm8OptionalIjEaSEOj Unexecuted instantiation: _ZN4llvm8OptionalImEaSEOm Unexecuted instantiation: VirtualFileSystem.cpp:_ZN4llvm8OptionalIN12_GLOBAL__N_114RealFileSystem16WorkingDirectoryEEaSEOS3_ Unexecuted instantiation: _ZN4llvm8OptionalINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEaSEOS6_ Unexecuted instantiation: _ZN4llvm8OptionalINS0_IN4mlir13AtomicRMWKindEEEEaSEOS3_ Unexecuted instantiation: _ZN4llvm8OptionalINS0_IN4mlir13CmpFPredicateEEEEaSEOS3_ Unexecuted instantiation: _ZN4llvm8OptionalINS0_IN4mlir13CmpIPredicateEEEEaSEOS3_ Unexecuted instantiation: _ZN4llvm8OptionalIlEaSEOl Unexecuted instantiation: _ZN4llvm8OptionalIiEaSEOi Unexecuted instantiation: _ZN4llvm8OptionalINS_15MutableArrayRefIN4mlir6detail12ExpectedDiagEEEEaSEOS5_ Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir11SymbolTable10VisibilityEEaSEOS3_ |
234 | | Optional &operator=(Optional &&O) = default; |
235 | | |
236 | | /// Create a new object by constructing it in place with the given arguments. |
237 | 0 | template <typename... ArgTypes> void emplace(ArgTypes &&... Args) { |
238 | 0 | Storage.emplace(std::forward<ArgTypes>(Args)...); |
239 | 0 | } Unexecuted instantiation: _ZN4llvm8OptionalINS_5AlignEE7emplaceIJRmEEEvDpOT_ Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir21FlatAffineConstraintsEE7emplaceIJS2_EEEvDpOT_ |
240 | | |
241 | | static inline Optional create(const T *y) { |
242 | | return y ? Optional(*y) : Optional(); |
243 | | } |
244 | | |
245 | 2.03k | Optional &operator=(const T &y) { |
246 | 2.03k | Storage = y; |
247 | 2.03k | return *this; |
248 | 2.03k | } Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir5ValueEEaSERKS2_ Unexecuted instantiation: _ZN4llvm8OptionalImEaSERKm Unexecuted instantiation: _ZN4llvm8OptionalIbEaSERKb Unexecuted instantiation: _ZN4llvm8OptionalIlEaSERKl _ZN4llvm8OptionalIjEaSERKj Line | Count | Source | 245 | 2.03k | Optional &operator=(const T &y) { | 246 | 2.03k | Storage = y; | 247 | 2.03k | return *this; | 248 | 2.03k | } |
Unexecuted instantiation: _ZN4llvm8OptionalIiEaSERKi Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir8LocationEEaSERKS2_ |
249 | | Optional &operator=(const Optional &O) = default; |
250 | | |
251 | 0 | void reset() { Storage.reset(); } |
252 | | |
253 | 0 | const T *getPointer() const { return &Storage.getValue(); } Unexecuted instantiation: _ZNK4llvm8OptionalINS_5AlignEE10getPointerEv Unexecuted instantiation: VirtualFileSystem.cpp:_ZNK4llvm8OptionalIN12_GLOBAL__N_114RealFileSystem16WorkingDirectoryEE10getPointerEv |
254 | 400 | T *getPointer() { return &Storage.getValue(); } Unexecuted instantiation: _ZN4llvm8OptionalINS_5AlignEE10getPointerEv Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir10DiagnosticEE10getPointerEv Unexecuted instantiation: _ZN4llvm8OptionalINS_9StringRefEE10getPointerEv Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir21FlatAffineConstraintsEE10getPointerEv _ZN4llvm8OptionalIN4mlir7Simplex5PivotEE10getPointerEv Line | Count | Source | 254 | 400 | T *getPointer() { return &Storage.getValue(); } |
Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir12OperandRangeEE10getPointerEv Unexecuted instantiation: _ZN4llvm8OptionalISt4pairIN4mlir10IdentifierENS2_9AttributeEEE10getPointerEv Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir14FileLineColLocEE10getPointerEv Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir11CallSiteLocEE10getPointerEv |
255 | 540 | const T &getValue() const LLVM_LVALUE_FUNCTION { return Storage.getValue(); } Unexecuted instantiation: _ZNKR4llvm8OptionalINS_5AlignEE8getValueEv Unexecuted instantiation: _ZNKR4llvm8OptionalIN4mlir11ParseResultEE8getValueEv Unexecuted instantiation: _ZNKR4llvm8OptionalIN4mlir5ValueEE8getValueEv Unexecuted instantiation: _ZNKR4llvm8OptionalImE8getValueEv _ZNKR4llvm8OptionalIjE8getValueEv Line | Count | Source | 255 | 540 | const T &getValue() const LLVM_LVALUE_FUNCTION { return Storage.getValue(); } |
Unexecuted instantiation: _ZNKR4llvm8OptionalINS_3sys2fs9file_typeEE8getValueEv Unexecuted instantiation: _ZNKR4llvm8OptionalINS_3sys2fs5permsEE8getValueEv Unexecuted instantiation: _ZNKR4llvm8OptionalINS_9StringRefEE8getValueEv Unexecuted instantiation: _ZNKR4llvm8OptionalIlE8getValueEv Unexecuted instantiation: _ZNKR4llvm8OptionalIiE8getValueEv Unexecuted instantiation: _ZNKR4llvm8OptionalIN4mlir10WalkResultEE8getValueEv |
256 | 9.34k | T &getValue() LLVM_LVALUE_FUNCTION { return Storage.getValue(); } _ZNR4llvm8OptionalINS_11SmallVectorIlLj8EEEE8getValueEv Line | Count | Source | 256 | 64 | T &getValue() LLVM_LVALUE_FUNCTION { return Storage.getValue(); } |
Unexecuted instantiation: _ZNR4llvm8OptionalINS_5AlignEE8getValueEv Unexecuted instantiation: _ZNR4llvm8OptionalINS_12DenormalMode16DenormalModeKindEE8getValueEv Unexecuted instantiation: _ZNR4llvm8OptionalIPKcE8getValueEv Unexecuted instantiation: _ZNR4llvm8OptionalINS_18ThreadPoolStrategyEE8getValueEv Unexecuted instantiation: _ZNR4llvm8OptionalINS_9StringRefEE8getValueEv Unexecuted instantiation: _ZNR4llvm8OptionalINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE8getValueEv Unexecuted instantiation: _ZNR4llvm8OptionalINS_6Triple11SubArchTypeEE8getValueEv Unexecuted instantiation: _ZNR4llvm8OptionalINS_6Triple10VendorTypeEE8getValueEv _ZNR4llvm8OptionalINS_6Triple6OSTypeEE8getValueEv Line | Count | Source | 256 | 8 | T &getValue() LLVM_LVALUE_FUNCTION { return Storage.getValue(); } |
Unexecuted instantiation: _ZNR4llvm8OptionalINS_6Triple16ObjectFormatTypeEE8getValueEv _ZNR4llvm8OptionalINS_6Triple8ArchTypeEE8getValueEv Line | Count | Source | 256 | 8 | T &getValue() LLVM_LVALUE_FUNCTION { return Storage.getValue(); } |
_ZNR4llvm8OptionalINS_6Triple15EnvironmentTypeEE8getValueEv Line | Count | Source | 256 | 8 | T &getValue() LLVM_LVALUE_FUNCTION { return Storage.getValue(); } |
Unexecuted instantiation: _ZNR4llvm8OptionalINS_3ARM7ISAKindEE8getValueEv _ZNR4llvm8OptionalIjE8getValueEv Line | Count | Source | 256 | 8.46k | T &getValue() LLVM_LVALUE_FUNCTION { return Storage.getValue(); } |
Unexecuted instantiation: _ZNR4llvm8OptionalImE8getValueEv Unexecuted instantiation: _ZNR4llvm8OptionalIbE8getValueEv Unexecuted instantiation: _ZNR4llvm8OptionalINS_10AlignStyleEE8getValueEv Unexecuted instantiation: _ZNR4llvm8OptionalINS_15ReplacementItemEE8getValueEv Unexecuted instantiation: _ZNR4llvm8OptionalINS_8ArrayRefINS_9StringRefEEEE8getValueEv Unexecuted instantiation: _ZNR4llvm8OptionalIN4mlir5ValueEE8getValueEv Unexecuted instantiation: _ZNR4llvm8OptionalIlE8getValueEv Unexecuted instantiation: _ZNR4llvm8OptionalIN4mlir21FlatAffineConstraintsEE8getValueEv Unexecuted instantiation: _ZNR4llvm8OptionalIN4mlir11ResultRangeEE8getValueEv _ZNR4llvm8OptionalIN4mlir7Simplex5PivotEE8getValueEv Line | Count | Source | 256 | 599 | T &getValue() LLVM_LVALUE_FUNCTION { return Storage.getValue(); } |
_ZNR4llvm8OptionalIN4mlir8FractionEE8getValueEv Line | Count | Source | 256 | 199 | T &getValue() LLVM_LVALUE_FUNCTION { return Storage.getValue(); } |
Unexecuted instantiation: _ZNR4llvm8OptionalINS0_IN4mlir13AtomicRMWKindEEEE8getValueEv Unexecuted instantiation: _ZNR4llvm8OptionalINS0_IN4mlir13CmpFPredicateEEEE8getValueEv Unexecuted instantiation: _ZNR4llvm8OptionalINS0_IN4mlir13CmpIPredicateEEEE8getValueEv Unexecuted instantiation: _ZNR4llvm8OptionalIN4mlir19MutableOperandRangeEE8getValueEv Unexecuted instantiation: _ZNR4llvm8OptionalIN4mlir13AtomicRMWKindEE8getValueEv Unexecuted instantiation: _ZNR4llvm8OptionalIN4mlir13CmpFPredicateEE8getValueEv Unexecuted instantiation: _ZNR4llvm8OptionalIN4mlir13CmpIPredicateEE8getValueEv Unexecuted instantiation: _ZNR4llvm8OptionalIN4mlir8LocationEE8getValueEv Unexecuted instantiation: _ZNR4llvm8OptionalIN4mlir10DiagnosticEE8getValueEv Unexecuted instantiation: _ZNR4llvm8OptionalIN4mlir14FileLineColLocEE8getValueEv Unexecuted instantiation: _ZNR4llvm8OptionalINS_15MutableArrayRefIN4mlir6detail12ExpectedDiagEEEE8getValueEv Unexecuted instantiation: _ZNR4llvm8OptionalISt4pairIjS1_IN4mlir10IdentifierENS2_9AttributeEEEE8getValueEv Unexecuted instantiation: _ZNR4llvm8OptionalIN4mlir11SymbolTable10VisibilityEE8getValueEv |
257 | | |
258 | 12.9k | explicit operator bool() const { return hasValue(); } Unexecuted instantiation: _ZNK4llvm8OptionalINS_5AlignEEcvbEv Unexecuted instantiation: _ZNK4llvm8OptionalINS_12DenormalMode16DenormalModeKindEEcvbEv Unexecuted instantiation: _ZNK4llvm8OptionalIPKcEcvbEv Unexecuted instantiation: _ZNK4llvm8OptionalINS_18ThreadPoolStrategyEEcvbEv _ZNK4llvm8OptionalINS_9StringRefEEcvbEv Line | Count | Source | 258 | 192 | explicit operator bool() const { return hasValue(); } |
Unexecuted instantiation: _ZNK4llvm8OptionalINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEcvbEv Unexecuted instantiation: _ZNK4llvm8OptionalINS_6Triple11SubArchTypeEEcvbEv _ZNK4llvm8OptionalINS_6Triple10VendorTypeEEcvbEv Line | Count | Source | 258 | 170 | explicit operator bool() const { return hasValue(); } |
_ZNK4llvm8OptionalINS_6Triple6OSTypeEEcvbEv Line | Count | Source | 258 | 296 | explicit operator bool() const { return hasValue(); } |
_ZNK4llvm8OptionalINS_6Triple16ObjectFormatTypeEEcvbEv Line | Count | Source | 258 | 36 | explicit operator bool() const { return hasValue(); } |
_ZNK4llvm8OptionalINS_6Triple8ArchTypeEEcvbEv Line | Count | Source | 258 | 688 | explicit operator bool() const { return hasValue(); } |
_ZNK4llvm8OptionalINS_6Triple15EnvironmentTypeEEcvbEv Line | Count | Source | 258 | 160 | explicit operator bool() const { return hasValue(); } |
Unexecuted instantiation: _ZNK4llvm8OptionalINS_3ARM7ISAKindEEcvbEv _ZNK4llvm8OptionalIjEcvbEv Line | Count | Source | 258 | 10.3k | explicit operator bool() const { return hasValue(); } |
Unexecuted instantiation: _ZNK4llvm8OptionalImEcvbEv Unexecuted instantiation: VirtualFileSystem.cpp:_ZNK4llvm8OptionalIN12_GLOBAL__N_114RealFileSystem16WorkingDirectoryEEcvbEv Unexecuted instantiation: _ZNK4llvm8OptionalINS_10AlignStyleEEcvbEv Unexecuted instantiation: _ZNK4llvm8OptionalINS_8ArrayRefINS_9StringRefEEEEcvbEv Unexecuted instantiation: _ZNK4llvm8OptionalIN4mlir5ValueEEcvbEv Unexecuted instantiation: _ZNK4llvm8OptionalIN4mlir21FlatAffineConstraintsEEcvbEv Unexecuted instantiation: _ZNK4llvm8OptionalIlEcvbEv Unexecuted instantiation: _ZNK4llvm8OptionalIN4mlir11ResultRangeEEcvbEv _ZNK4llvm8OptionalIN4mlir7Simplex5PivotEEcvbEv Line | Count | Source | 258 | 870 | explicit operator bool() const { return hasValue(); } |
_ZNK4llvm8OptionalIN4mlir8FractionEEcvbEv Line | Count | Source | 258 | 161 | explicit operator bool() const { return hasValue(); } |
_ZNK4llvm8OptionalINS_11SmallVectorIlLj8EEEEcvbEv Line | Count | Source | 258 | 42 | explicit operator bool() const { return hasValue(); } |
Unexecuted instantiation: _ZNK4llvm8OptionalINS0_IN4mlir13AtomicRMWKindEEEEcvbEv Unexecuted instantiation: _ZNK4llvm8OptionalINS0_IN4mlir13CmpFPredicateEEEEcvbEv Unexecuted instantiation: _ZNK4llvm8OptionalINS0_IN4mlir13CmpIPredicateEEEEcvbEv Unexecuted instantiation: _ZNK4llvm8OptionalIN4mlir19MutableOperandRangeEEcvbEv Unexecuted instantiation: _ZNK4llvm8OptionalIN4mlir13BlockArgumentEEcvbEv Unexecuted instantiation: _ZNK4llvm8OptionalIN4mlir13AtomicRMWKindEEcvbEv Unexecuted instantiation: _ZNK4llvm8OptionalIN4mlir13CmpFPredicateEEcvbEv Unexecuted instantiation: _ZNK4llvm8OptionalIN4mlir13CmpIPredicateEEcvbEv Unexecuted instantiation: _ZNK4llvm8OptionalIN4mlir12OperandRangeEEcvbEv Unexecuted instantiation: _ZNK4llvm8OptionalIiEcvbEv Unexecuted instantiation: _ZNK4llvm8OptionalISt4pairIN4mlir10IdentifierENS2_9AttributeEEEcvbEv Unexecuted instantiation: _ZNK4llvm8OptionalIN4mlir8LocationEEcvbEv Unexecuted instantiation: _ZNK4llvm8OptionalIN4mlir14FileLineColLocEEcvbEv Unexecuted instantiation: _ZNK4llvm8OptionalIN4mlir11CallSiteLocEEcvbEv Unexecuted instantiation: _ZNK4llvm8OptionalINS_15MutableArrayRefIN4mlir6detail12ExpectedDiagEEEEcvbEv Unexecuted instantiation: _ZNK4llvm8OptionalISt4pairIjS1_IN4mlir10IdentifierENS2_9AttributeEEEEcvbEv Unexecuted instantiation: _ZNK4llvm8OptionalIN4mlir11SymbolTable10VisibilityEEcvbEv Unexecuted instantiation: _ZNK4llvm8OptionalIN4mlir10WalkResultEEcvbEv |
259 | 13.8k | bool hasValue() const { return Storage.hasValue(); } _ZNK4llvm8OptionalINS_11SmallVectorIlLj8EEEE8hasValueEv Line | Count | Source | 259 | 87 | bool hasValue() const { return Storage.hasValue(); } |
Unexecuted instantiation: _ZNK4llvm8OptionalINS_5AlignEE8hasValueEv Unexecuted instantiation: _ZNK4llvm8OptionalINS_12DenormalMode16DenormalModeKindEE8hasValueEv Unexecuted instantiation: _ZNK4llvm8OptionalIN4mlir10DiagnosticEE8hasValueEv Unexecuted instantiation: _ZNK4llvm8OptionalIN4mlir11ParseResultEE8hasValueEv Unexecuted instantiation: _ZNK4llvm8OptionalIN4mlir5ValueEE8hasValueEv Unexecuted instantiation: _ZNK4llvm8OptionalImE8hasValueEv Unexecuted instantiation: _ZNK4llvm8OptionalIPKcE8hasValueEv Unexecuted instantiation: _ZNK4llvm8OptionalINS_18ThreadPoolStrategyEE8hasValueEv _ZNK4llvm8OptionalINS_9StringRefEE8hasValueEv Line | Count | Source | 259 | 192 | bool hasValue() const { return Storage.hasValue(); } |
Unexecuted instantiation: _ZNK4llvm8OptionalINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE8hasValueEv Unexecuted instantiation: _ZNK4llvm8OptionalINS_6Triple11SubArchTypeEE8hasValueEv _ZNK4llvm8OptionalINS_6Triple10VendorTypeEE8hasValueEv Line | Count | Source | 259 | 170 | bool hasValue() const { return Storage.hasValue(); } |
_ZNK4llvm8OptionalINS_6Triple6OSTypeEE8hasValueEv Line | Count | Source | 259 | 296 | bool hasValue() const { return Storage.hasValue(); } |
_ZNK4llvm8OptionalINS_6Triple16ObjectFormatTypeEE8hasValueEv Line | Count | Source | 259 | 36 | bool hasValue() const { return Storage.hasValue(); } |
_ZNK4llvm8OptionalINS_6Triple8ArchTypeEE8hasValueEv Line | Count | Source | 259 | 688 | bool hasValue() const { return Storage.hasValue(); } |
_ZNK4llvm8OptionalINS_6Triple15EnvironmentTypeEE8hasValueEv Line | Count | Source | 259 | 160 | bool hasValue() const { return Storage.hasValue(); } |
Unexecuted instantiation: _ZNK4llvm8OptionalINS_3ARM7ISAKindEE8hasValueEv _ZNK4llvm8OptionalIjE8hasValueEv Line | Count | Source | 259 | 11.0k | bool hasValue() const { return Storage.hasValue(); } |
Unexecuted instantiation: VirtualFileSystem.cpp:_ZNK4llvm8OptionalIN12_GLOBAL__N_114RealFileSystem16WorkingDirectoryEE8hasValueEv Unexecuted instantiation: _ZNK4llvm8OptionalINS_3sys2fs9file_typeEE8hasValueEv Unexecuted instantiation: _ZNK4llvm8OptionalINS_3sys2fs5permsEE8hasValueEv Unexecuted instantiation: _ZNK4llvm8OptionalIbE8hasValueEv Unexecuted instantiation: _ZNK4llvm8OptionalINS_10AlignStyleEE8hasValueEv Unexecuted instantiation: _ZNK4llvm8OptionalINS_15ReplacementItemEE8hasValueEv Unexecuted instantiation: _ZNK4llvm8OptionalINS_8ArrayRefINS_9StringRefEEEE8hasValueEv Unexecuted instantiation: _ZNK4llvm8OptionalIlE8hasValueEv Unexecuted instantiation: _ZNK4llvm8OptionalIN4mlir21FlatAffineConstraintsEE8hasValueEv Unexecuted instantiation: _ZNK4llvm8OptionalIN4mlir11ResultRangeEE8hasValueEv _ZNK4llvm8OptionalIN4mlir8FractionEE8hasValueEv Line | Count | Source | 259 | 258 | bool hasValue() const { return Storage.hasValue(); } |
_ZNK4llvm8OptionalIN4mlir7Simplex5PivotEE8hasValueEv Line | Count | Source | 259 | 870 | bool hasValue() const { return Storage.hasValue(); } |
Unexecuted instantiation: _ZNK4llvm8OptionalINS0_IN4mlir13AtomicRMWKindEEEE8hasValueEv Unexecuted instantiation: _ZNK4llvm8OptionalINS0_IN4mlir13CmpFPredicateEEEE8hasValueEv Unexecuted instantiation: _ZNK4llvm8OptionalINS0_IN4mlir13CmpIPredicateEEEE8hasValueEv Unexecuted instantiation: _ZNK4llvm8OptionalIN4mlir19MutableOperandRangeEE8hasValueEv Unexecuted instantiation: _ZNK4llvm8OptionalIN4mlir13BlockArgumentEE8hasValueEv Unexecuted instantiation: _ZNK4llvm8OptionalIN4mlir13AtomicRMWKindEE8hasValueEv Unexecuted instantiation: _ZNK4llvm8OptionalIN4mlir13CmpFPredicateEE8hasValueEv Unexecuted instantiation: _ZNK4llvm8OptionalIN4mlir13CmpIPredicateEE8hasValueEv Unexecuted instantiation: _ZNK4llvm8OptionalIN4mlir12OperandRangeEE8hasValueEv Unexecuted instantiation: _ZNK4llvm8OptionalIiE8hasValueEv Unexecuted instantiation: _ZNK4llvm8OptionalISt4pairIN4mlir10IdentifierENS2_9AttributeEEE8hasValueEv Unexecuted instantiation: _ZNK4llvm8OptionalIN4mlir8LocationEE8hasValueEv Unexecuted instantiation: _ZNK4llvm8OptionalIN4mlir14FileLineColLocEE8hasValueEv Unexecuted instantiation: _ZNK4llvm8OptionalIN4mlir11CallSiteLocEE8hasValueEv Unexecuted instantiation: _ZNK4llvm8OptionalINS_15MutableArrayRefIN4mlir6detail12ExpectedDiagEEEE8hasValueEv Unexecuted instantiation: _ZNK4llvm8OptionalISt4pairIjS1_IN4mlir10IdentifierENS2_9AttributeEEEE8hasValueEv Unexecuted instantiation: _ZNK4llvm8OptionalIN4mlir11SymbolTable10VisibilityEE8hasValueEv Unexecuted instantiation: _ZNK4llvm8OptionalIN4mlir10WalkResultEE8hasValueEv |
260 | 0 | const T *operator->() const { return getPointer(); } Unexecuted instantiation: _ZNK4llvm8OptionalINS_5AlignEEptEv Unexecuted instantiation: VirtualFileSystem.cpp:_ZNK4llvm8OptionalIN12_GLOBAL__N_114RealFileSystem16WorkingDirectoryEEptEv |
261 | 400 | T *operator->() { return getPointer(); } Unexecuted instantiation: _ZN4llvm8OptionalINS_5AlignEEptEv Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir10DiagnosticEEptEv Unexecuted instantiation: _ZN4llvm8OptionalINS_9StringRefEEptEv Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir21FlatAffineConstraintsEEptEv _ZN4llvm8OptionalIN4mlir7Simplex5PivotEEptEv Line | Count | Source | 261 | 400 | T *operator->() { return getPointer(); } |
Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir12OperandRangeEEptEv Unexecuted instantiation: _ZN4llvm8OptionalISt4pairIN4mlir10IdentifierENS2_9AttributeEEEptEv Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir14FileLineColLocEEptEv Unexecuted instantiation: _ZN4llvm8OptionalIN4mlir11CallSiteLocEEptEv |
262 | 0 | const T &operator*() const LLVM_LVALUE_FUNCTION { return getValue(); } Unexecuted instantiation: _ZNKR4llvm8OptionalImEdeEv Unexecuted instantiation: _ZNKR4llvm8OptionalINS_9StringRefEEdeEv Unexecuted instantiation: _ZNKR4llvm8OptionalIN4mlir5ValueEEdeEv Unexecuted instantiation: _ZNKR4llvm8OptionalIlEdeEv Unexecuted instantiation: _ZNKR4llvm8OptionalIiEdeEv Unexecuted instantiation: _ZNKR4llvm8OptionalIN4mlir10WalkResultEEdeEv |
263 | 9.34k | T &operator*() LLVM_LVALUE_FUNCTION { return getValue(); } _ZNR4llvm8OptionalINS_11SmallVectorIlLj8EEEEdeEv Line | Count | Source | 263 | 64 | T &operator*() LLVM_LVALUE_FUNCTION { return getValue(); } |
Unexecuted instantiation: _ZNR4llvm8OptionalINS_5AlignEEdeEv Unexecuted instantiation: _ZNR4llvm8OptionalINS_12DenormalMode16DenormalModeKindEEdeEv Unexecuted instantiation: _ZNR4llvm8OptionalIPKcEdeEv Unexecuted instantiation: _ZNR4llvm8OptionalINS_18ThreadPoolStrategyEEdeEv Unexecuted instantiation: _ZNR4llvm8OptionalINS_9StringRefEEdeEv Unexecuted instantiation: _ZNR4llvm8OptionalINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEdeEv Unexecuted instantiation: _ZNR4llvm8OptionalINS_6Triple11SubArchTypeEEdeEv Unexecuted instantiation: _ZNR4llvm8OptionalINS_6Triple10VendorTypeEEdeEv _ZNR4llvm8OptionalINS_6Triple6OSTypeEEdeEv Line | Count | Source | 263 | 8 | T &operator*() LLVM_LVALUE_FUNCTION { return getValue(); } |
Unexecuted instantiation: _ZNR4llvm8OptionalINS_6Triple16ObjectFormatTypeEEdeEv _ZNR4llvm8OptionalINS_6Triple8ArchTypeEEdeEv Line | Count | Source | 263 | 8 | T &operator*() LLVM_LVALUE_FUNCTION { return getValue(); } |
_ZNR4llvm8OptionalINS_6Triple15EnvironmentTypeEEdeEv Line | Count | Source | 263 | 8 | T &operator*() LLVM_LVALUE_FUNCTION { return getValue(); } |
Unexecuted instantiation: _ZNR4llvm8OptionalINS_3ARM7ISAKindEEdeEv _ZNR4llvm8OptionalIjEdeEv Line | Count | Source | 263 | 8.46k | T &operator*() LLVM_LVALUE_FUNCTION { return getValue(); } |
Unexecuted instantiation: _ZNR4llvm8OptionalImEdeEv Unexecuted instantiation: _ZNR4llvm8OptionalINS_10AlignStyleEEdeEv Unexecuted instantiation: _ZNR4llvm8OptionalINS_15ReplacementItemEEdeEv Unexecuted instantiation: _ZNR4llvm8OptionalINS_8ArrayRefINS_9StringRefEEEEdeEv Unexecuted instantiation: _ZNR4llvm8OptionalIN4mlir21FlatAffineConstraintsEEdeEv Unexecuted instantiation: _ZNR4llvm8OptionalIN4mlir11ResultRangeEEdeEv _ZNR4llvm8OptionalIN4mlir7Simplex5PivotEEdeEv Line | Count | Source | 263 | 599 | T &operator*() LLVM_LVALUE_FUNCTION { return getValue(); } |
_ZNR4llvm8OptionalIN4mlir8FractionEEdeEv Line | Count | Source | 263 | 199 | T &operator*() LLVM_LVALUE_FUNCTION { return getValue(); } |
Unexecuted instantiation: _ZNR4llvm8OptionalINS0_IN4mlir13AtomicRMWKindEEEEdeEv Unexecuted instantiation: _ZNR4llvm8OptionalINS0_IN4mlir13CmpFPredicateEEEEdeEv Unexecuted instantiation: _ZNR4llvm8OptionalINS0_IN4mlir13CmpIPredicateEEEEdeEv Unexecuted instantiation: _ZNR4llvm8OptionalIN4mlir19MutableOperandRangeEEdeEv Unexecuted instantiation: _ZNR4llvm8OptionalIlEdeEv Unexecuted instantiation: _ZNR4llvm8OptionalIN4mlir8LocationEEdeEv Unexecuted instantiation: _ZNR4llvm8OptionalIN4mlir10DiagnosticEEdeEv Unexecuted instantiation: _ZNR4llvm8OptionalIN4mlir14FileLineColLocEEdeEv Unexecuted instantiation: _ZNR4llvm8OptionalINS_15MutableArrayRefIN4mlir6detail12ExpectedDiagEEEEdeEv Unexecuted instantiation: _ZNR4llvm8OptionalISt4pairIjS1_IN4mlir10IdentifierENS2_9AttributeEEEEdeEv Unexecuted instantiation: _ZNR4llvm8OptionalIN4mlir11SymbolTable10VisibilityEEdeEv |
264 | | |
265 | | template <typename U> |
266 | 606 | constexpr T getValueOr(U &&value) const LLVM_LVALUE_FUNCTION { |
267 | 606 | return hasValue() ? getValue() : std::forward<U>(value); |
268 | 606 | } Unexecuted instantiation: _ZNKR4llvm8OptionalIjE10getValueOrIiEEjOT_ Unexecuted instantiation: _ZNKR4llvm8OptionalINS_3sys2fs9file_typeEE10getValueOrIS3_EES3_OT_ Unexecuted instantiation: _ZNKR4llvm8OptionalINS_3sys2fs5permsEE10getValueOrIS3_EES3_OT_ Unexecuted instantiation: _ZNKR4llvm8OptionalImE10getValueOrIjEEmOT_ Unexecuted instantiation: _ZNKR4llvm8OptionalImE10getValueOrImEEmOT_ _ZNKR4llvm8OptionalIjE10getValueOrIRiEEjOT_ Line | Count | Source | 266 | 606 | constexpr T getValueOr(U &&value) const LLVM_LVALUE_FUNCTION { | 267 | 606 | return hasValue() ? getValue() : std::forward<U>(value); | 268 | 606 | } |
|
269 | | |
270 | | /// Apply a function to the value if present; otherwise return None. |
271 | | template <class Function> |
272 | | auto map(const Function &F) const LLVM_LVALUE_FUNCTION |
273 | | -> Optional<decltype(F(getValue()))> { |
274 | | if (*this) return F(getValue()); |
275 | | return None; |
276 | | } |
277 | | |
278 | | #if LLVM_HAS_RVALUE_REFERENCE_THIS |
279 | | T &&getValue() && { return std::move(Storage.getValue()); } |
280 | 0 | T &&operator*() && { return std::move(Storage.getValue()); } |
281 | | |
282 | | template <typename U> |
283 | | T getValueOr(U &&value) && { |
284 | | return hasValue() ? std::move(getValue()) : std::forward<U>(value); |
285 | | } |
286 | | |
287 | | /// Apply a function to the value if present; otherwise return None. |
288 | | template <class Function> |
289 | | auto map(const Function &F) && |
290 | | -> Optional<decltype(F(std::move(*this).getValue()))> { |
291 | | if (*this) return F(std::move(*this).getValue()); |
292 | | return None; |
293 | | } |
294 | | #endif |
295 | | }; |
296 | | |
297 | | template <typename T, typename U> |
298 | 0 | bool operator==(const Optional<T> &X, const Optional<U> &Y) { |
299 | 0 | if (X && Y) |
300 | 0 | return *X == *Y; |
301 | 0 | return X.hasValue() == Y.hasValue(); |
302 | 0 | } |
303 | | |
304 | | template <typename T, typename U> |
305 | | bool operator!=(const Optional<T> &X, const Optional<U> &Y) { |
306 | | return !(X == Y); |
307 | | } |
308 | | |
309 | | template <typename T, typename U> |
310 | | bool operator<(const Optional<T> &X, const Optional<U> &Y) { |
311 | | if (X && Y) |
312 | | return *X < *Y; |
313 | | return X.hasValue() < Y.hasValue(); |
314 | | } |
315 | | |
316 | | template <typename T, typename U> |
317 | | bool operator<=(const Optional<T> &X, const Optional<U> &Y) { |
318 | | return !(Y < X); |
319 | | } |
320 | | |
321 | | template <typename T, typename U> |
322 | | bool operator>(const Optional<T> &X, const Optional<U> &Y) { |
323 | | return Y < X; |
324 | | } |
325 | | |
326 | | template <typename T, typename U> |
327 | | bool operator>=(const Optional<T> &X, const Optional<U> &Y) { |
328 | | return !(X < Y); |
329 | | } |
330 | | |
331 | | template<typename T> |
332 | 0 | bool operator==(const Optional<T> &X, NoneType) { |
333 | 0 | return !X; |
334 | 0 | } Unexecuted instantiation: _ZN4llvmeqIlEEbRKNS_8OptionalIT_EENS_8NoneTypeE Unexecuted instantiation: _ZN4llvmeqIN4mlir5ValueEEEbRKNS_8OptionalIT_EENS_8NoneTypeE |
335 | | |
336 | | template<typename T> |
337 | | bool operator==(NoneType, const Optional<T> &X) { |
338 | | return X == None; |
339 | | } |
340 | | |
341 | | template<typename T> |
342 | | bool operator!=(const Optional<T> &X, NoneType) { |
343 | | return !(X == None); |
344 | | } |
345 | | |
346 | | template<typename T> |
347 | | bool operator!=(NoneType, const Optional<T> &X) { |
348 | | return X != None; |
349 | | } |
350 | | |
351 | | template <typename T> bool operator<(const Optional<T> &X, NoneType) { |
352 | | return false; |
353 | | } |
354 | | |
355 | | template <typename T> bool operator<(NoneType, const Optional<T> &X) { |
356 | | return X.hasValue(); |
357 | | } |
358 | | |
359 | | template <typename T> bool operator<=(const Optional<T> &X, NoneType) { |
360 | | return !(None < X); |
361 | | } |
362 | | |
363 | | template <typename T> bool operator<=(NoneType, const Optional<T> &X) { |
364 | | return !(X < None); |
365 | | } |
366 | | |
367 | | template <typename T> bool operator>(const Optional<T> &X, NoneType) { |
368 | | return None < X; |
369 | | } |
370 | | |
371 | | template <typename T> bool operator>(NoneType, const Optional<T> &X) { |
372 | | return X < None; |
373 | | } |
374 | | |
375 | | template <typename T> bool operator>=(const Optional<T> &X, NoneType) { |
376 | | return None <= X; |
377 | | } |
378 | | |
379 | | template <typename T> bool operator>=(NoneType, const Optional<T> &X) { |
380 | | return X <= None; |
381 | | } |
382 | | |
383 | 0 | template <typename T> bool operator==(const Optional<T> &X, const T &Y) { |
384 | 0 | return X && *X == Y; |
385 | 0 | } Unexecuted instantiation: _ZN4llvmeqINS_9StringRefEEEbRKNS_8OptionalIT_EERKS3_ Unexecuted instantiation: _ZN4llvmeqIN4mlir10WalkResultEEEbRKNS_8OptionalIT_EERKS4_ |
386 | | |
387 | | template <typename T> bool operator==(const T &X, const Optional<T> &Y) { |
388 | | return Y && X == *Y; |
389 | | } |
390 | | |
391 | 0 | template <typename T> bool operator!=(const Optional<T> &X, const T &Y) { |
392 | 0 | return !(X == Y); |
393 | 0 | } |
394 | | |
395 | | template <typename T> bool operator!=(const T &X, const Optional<T> &Y) { |
396 | | return !(X == Y); |
397 | | } |
398 | | |
399 | 0 | template <typename T> bool operator<(const Optional<T> &X, const T &Y) { |
400 | 0 | return !X || *X < Y; |
401 | 0 | } |
402 | | |
403 | 0 | template <typename T> bool operator<(const T &X, const Optional<T> &Y) { |
404 | 0 | return Y && X < *Y; |
405 | 0 | } |
406 | | |
407 | | template <typename T> bool operator<=(const Optional<T> &X, const T &Y) { |
408 | | return !(Y < X); |
409 | | } |
410 | | |
411 | | template <typename T> bool operator<=(const T &X, const Optional<T> &Y) { |
412 | | return !(Y < X); |
413 | | } |
414 | | |
415 | | template <typename T> bool operator>(const Optional<T> &X, const T &Y) { |
416 | | return Y < X; |
417 | | } |
418 | | |
419 | 0 | template <typename T> bool operator>(const T &X, const Optional<T> &Y) { |
420 | 0 | return Y < X; |
421 | 0 | } |
422 | | |
423 | | template <typename T> bool operator>=(const Optional<T> &X, const T &Y) { |
424 | | return !(X < Y); |
425 | | } |
426 | | |
427 | | template <typename T> bool operator>=(const T &X, const Optional<T> &Y) { |
428 | | return !(X < Y); |
429 | | } |
430 | | |
431 | | raw_ostream &operator<<(raw_ostream &OS, NoneType); |
432 | | |
433 | | template <typename T, typename = decltype(std::declval<raw_ostream &>() |
434 | | << std::declval<const T &>())> |
435 | 0 | raw_ostream &operator<<(raw_ostream &OS, const Optional<T> &O) { |
436 | 0 | if (O) |
437 | 0 | OS << *O; |
438 | 0 | else |
439 | 0 | OS << None; |
440 | 0 | return OS; |
441 | 0 | } |
442 | | |
443 | | } // end namespace llvm |
444 | | |
445 | | #endif // LLVM_ADT_OPTIONAL_H |