File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
lib/AST/RequirementMachine Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -163,6 +163,10 @@ class Symbol final {
163
163
return Ptr;
164
164
}
165
165
166
+ static Symbol fromOpaquePointer (void *ptr) {
167
+ return Symbol ((Storage *) ptr);
168
+ }
169
+
166
170
static Symbol forName (Identifier name,
167
171
RewriteContext &ctx);
168
172
@@ -223,4 +227,24 @@ class Symbol final {
223
227
224
228
} // end namespace swift
225
229
230
+ namespace llvm {
231
+ template <> struct DenseMapInfo <swift::rewriting::Symbol> {
232
+ static swift::rewriting::Symbol getEmptyKey () {
233
+ return swift::rewriting::Symbol::fromOpaquePointer (
234
+ llvm::DenseMapInfo<void *>::getEmptyKey ());
235
+ }
236
+ static swift::rewriting::Symbol getTombstoneKey () {
237
+ return swift::rewriting::Symbol::fromOpaquePointer (
238
+ llvm::DenseMapInfo<void *>::getTombstoneKey ());
239
+ }
240
+ static unsigned getHashValue (swift::rewriting::Symbol Val) {
241
+ return DenseMapInfo<void *>::getHashValue (Val.getOpaquePointer ());
242
+ }
243
+ static bool isEqual (swift::rewriting::Symbol LHS,
244
+ swift::rewriting::Symbol RHS) {
245
+ return LHS == RHS;
246
+ }
247
+ };
248
+ } // end namespace llvm
249
+
226
250
#endif
You can’t perform that action at this time.
0 commit comments