File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -54,4 +54,33 @@ struct Located {
54
54
55
55
} // end namespace swift
56
56
57
+ namespace llvm {
58
+
59
+ template <typename T> struct DenseMapInfo ;
60
+
61
+ template <typename T>
62
+ struct DenseMapInfo <swift::Located<T>> {
63
+
64
+ static inline swift::Located<T> getEmptyKey () {
65
+ return swift::Located<T>(DenseMapInfo<T>::getEmptyKey (),
66
+ DenseMapInfo<swift::SourceLoc>::getEmptyKey ());
67
+ }
68
+
69
+ static inline swift::Located<T> getTombstoneKey () {
70
+ return swift::Located<T>(DenseMapInfo<T>::getTombstoneKey (),
71
+ DenseMapInfo<swift::SourceLoc>::getTombstoneKey ());
72
+ }
73
+
74
+ static unsigned getHashValue (const swift::Located<T> &LocatedVal) {
75
+ return combineHashValue (DenseMapInfo<T>::getHashValue (LocatedVal.Item ),
76
+ DenseMapInfo<swift::SourceLoc>::getHashValue (LocatedVal.Loc ));
77
+ }
78
+
79
+ static bool isEqual (const swift::Located<T> &LHS, const swift::Located<T> &RHS) {
80
+ return DenseMapInfo<T>::isEqual (LHS.Item , RHS.Item ) &&
81
+ DenseMapInfo<T>::isEqual (LHS.Loc , RHS.Loc );
82
+ }
83
+ };
84
+ } // namespace llvm
85
+
57
86
#endif // SWIFT_BASIC_LOCATED_H
Original file line number Diff line number Diff line change @@ -631,7 +631,7 @@ class LLVM_LIBRARY_VISIBILITY ClangImporter::Implementation
631
631
public:
632
632
// / Load a module using either method.
633
633
ModuleDecl *loadModule (SourceLoc importLoc,
634
- ArrayRef<std::pair <Identifier, SourceLoc >> path);
634
+ ArrayRef<Located <Identifier>> path);
635
635
636
636
void recordImplicitUnwrapForDecl (ValueDecl *decl, bool isIUO) {
637
637
if (!isIUO)
You can’t perform that action at this time.
0 commit comments