Skip to content

Commit 4cc7589

Browse files
committed
RequirementMachine: Symbols and Terms should have PointerLikeTypeTraits
1 parent 22816b0 commit 4cc7589

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

lib/AST/RequirementMachine/Symbol.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,18 @@ namespace llvm {
277277
return LHS == RHS;
278278
}
279279
};
280+
281+
template<>
282+
struct PointerLikeTypeTraits<swift::rewriting::Symbol> {
283+
public:
284+
static inline void *getAsVoidPointer(swift::rewriting::Symbol Val) {
285+
return const_cast<void *>(Val.getOpaquePointer());
286+
}
287+
static inline swift::rewriting::Symbol getFromVoidPointer(void *Ptr) {
288+
return swift::rewriting::Symbol::fromOpaquePointer(Ptr);
289+
}
290+
enum { NumLowBitsAvailable = 1 };
291+
};
280292
} // end namespace llvm
281293

282294
#endif

lib/AST/RequirementMachine/Term.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,18 @@ namespace llvm {
229229
return LHS == RHS;
230230
}
231231
};
232+
233+
template<>
234+
struct PointerLikeTypeTraits<swift::rewriting::Term> {
235+
public:
236+
static inline void *getAsVoidPointer(swift::rewriting::Term Val) {
237+
return const_cast<void *>(Val.getOpaquePointer());
238+
}
239+
static inline swift::rewriting::Term getFromVoidPointer(void *Ptr) {
240+
return swift::rewriting::Term::fromOpaquePointer(Ptr);
241+
}
242+
enum { NumLowBitsAvailable = 1 };
243+
};
232244
} // end namespace llvm
233245

234246
#endif

0 commit comments

Comments
 (0)