@@ -133,32 +133,34 @@ inline void opaqueFree(void * _Nonnull p) {
133
133
}
134
134
135
135
static void printSwiftResilientStorageClass (raw_ostream &os) {
136
- // FIXME: mark noexcept.
137
136
auto name = cxx_synthesis::getCxxOpaqueStorageClassName ();
138
137
static_assert (TargetValueWitnessFlags<uint64_t >::AlignmentMask ==
139
138
TargetValueWitnessFlags<uint32_t >::AlignmentMask,
140
139
" alignment mask doesn't match" );
141
140
os << " /// Container for an opaque Swift value, like resilient struct.\n " ;
142
141
os << " class " << name << " {\n " ;
143
142
os << " public:\n " ;
144
- os << " inline " << name << " () : storage(nullptr) { }\n " ;
143
+ os << " inline " << name << " () noexcept : storage(nullptr) { }\n " ;
145
144
os << " inline " << name
146
- << " (ValueWitnessTable * _Nonnull vwTable) : storage("
145
+ << " (ValueWitnessTable * _Nonnull vwTable) noexcept : storage("
147
146
" reinterpret_cast<char *>(opaqueAlloc(vwTable->size, (vwTable->flags &"
148
147
<< TargetValueWitnessFlags<uint64_t >::AlignmentMask << " ) + 1))) { }\n " ;
149
148
os << " inline " << name << " (" << name
150
- << " && other) : storage(other.storage) { other.storage = nullptr; }\n " ;
151
- os << " inline " << name << " (const " << name << " &) = delete;\n " ;
149
+ << " && other) noexcept : storage(other.storage) { other.storage = "
150
+ " nullptr; }\n " ;
151
+ os << " inline " << name << " (const " << name << " &) noexcept = delete;\n " ;
152
152
os << " inline ~" << name
153
- << " () { if (storage) { opaqueFree(static_cast<char "
153
+ << " () noexcept { if (storage) { opaqueFree(static_cast<char "
154
154
" * _Nonnull>(storage)); } }\n " ;
155
155
os << " void operator =(" << name
156
- << " && other) { auto temp = storage; storage = other.storage; "
156
+ << " && other) noexcept { auto temp = storage; storage = other.storage; "
157
157
" other.storage = temp; }\n " ;
158
- os << " void operator =(const " << name << " &) = delete;\n " ;
159
- os << " inline char * _Nonnull getOpaquePointer() { return static_cast<char "
158
+ os << " void operator =(const " << name << " &) noexcept = delete;\n " ;
159
+ os << " inline char * _Nonnull getOpaquePointer() noexcept { return "
160
+ " static_cast<char "
160
161
" * _Nonnull>(storage); }\n " ;
161
- os << " inline const char * _Nonnull getOpaquePointer() const { return "
162
+ os << " inline const char * _Nonnull getOpaquePointer() const noexcept { "
163
+ " return "
162
164
" static_cast<char * _Nonnull>(storage); }\n " ;
163
165
os << " private:\n " ;
164
166
os << " char * _Nullable storage;\n " ;
0 commit comments