Skip to content

Commit ad71b8f

Browse files
author
David Ungar
committed
hash templates for linux
1 parent f4dc888 commit ad71b8f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

include/swift/AST/FineGrainedDependencies.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ const std::string NodeKindNames[]{
378378
"topLevel", "nominal", "potentialMember", "member",
379379
"dynamicLookup", "externalDepend", "sourceFileProvide"};
380380

381+
381382
/// Instead of the status quo scheme of two kinds of "Depends", cascading and
382383
/// non-cascading this code represents each entity ("Provides" in the status
383384
/// quo), by a pair of nodes. One node represents the "implementation." If the
@@ -397,6 +398,7 @@ template <typename FnT> void forEachAspect(FnT fn) {
397398
fn(DeclAspect(i));
398399
}
399400

401+
400402
/// A pair of nodes that represent the two aspects of a given entity.
401403
/// Templated in order to serve for either SourceFileDepGraphNodes or
402404
/// ModuleDepGraphNodes.
@@ -575,6 +577,14 @@ struct std::hash<typename swift::fine_grained_dependencies::DeclAspect> {
575577
return size_t(aspect);
576578
}
577579
};
580+
template <>
581+
struct std::hash<typename swift::fine_grained_dependencies::NodeKind> {
582+
size_t
583+
operator()(const swift::fine_grained_dependencies::NodeKind kind) const {
584+
return size_t(kind);
585+
}
586+
};
587+
578588

579589
namespace swift {
580590
namespace fine_grained_dependencies {

0 commit comments

Comments
 (0)