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 @@ -65,6 +65,10 @@ class Term final {
65
65
return Ptr;
66
66
}
67
67
68
+ static Term fromOpaquePointer (void *ptr) {
69
+ return Term ((Storage *) ptr);
70
+ }
71
+
68
72
static Term get (const MutableTerm &term, RewriteContext &ctx);
69
73
70
74
ArrayRef<const ProtocolDecl *> getRootProtocols () const {
@@ -203,4 +207,24 @@ class MutableTerm final {
203
207
204
208
} // end namespace swift
205
209
210
+ namespace llvm {
211
+ template <> struct DenseMapInfo <swift::rewriting::Term> {
212
+ static swift::rewriting::Term getEmptyKey () {
213
+ return swift::rewriting::Term::fromOpaquePointer (
214
+ llvm::DenseMapInfo<void *>::getEmptyKey ());
215
+ }
216
+ static swift::rewriting::Term getTombstoneKey () {
217
+ return swift::rewriting::Term::fromOpaquePointer (
218
+ llvm::DenseMapInfo<void *>::getTombstoneKey ());
219
+ }
220
+ static unsigned getHashValue (swift::rewriting::Term Val) {
221
+ return DenseMapInfo<void *>::getHashValue (Val.getOpaquePointer ());
222
+ }
223
+ static bool isEqual (swift::rewriting::Term LHS,
224
+ swift::rewriting::Term RHS) {
225
+ return LHS == RHS;
226
+ }
227
+ };
228
+ } // end namespace llvm
229
+
206
230
#endif
You can’t perform that action at this time.
0 commit comments