Skip to content

Commit fa3d4c5

Browse files
author
David Ungar
committed
Move fine-grained NodeKind to ReferenceDependencyKeys.h
1 parent d5047ee commit fa3d4c5

File tree

2 files changed

+31
-27
lines changed

2 files changed

+31
-27
lines changed

include/swift/AST/FineGrainedDependencies.h

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "swift/Basic/LLVM.h"
1818
#include "swift/Basic/NullablePtr.h"
1919
#include "swift/Basic/Range.h"
20+
#include "swift/Basic/ReferenceDependencyKeys.h"
2021
#include "llvm/ADT/Hashing.h"
2122
#include "llvm/Support/MD5.h"
2223
#include "llvm/Support/MemoryBuffer.h"
@@ -350,33 +351,6 @@ bool emitReferenceDependencies(DiagnosticEngine &diags, SourceFile *SF,
350351
// MARK: Enums
351352
//==============================================================================
352353

353-
/// Encode the current sorts of dependencies as kinds of nodes in the dependency
354-
/// graph, splitting the current *member* into \ref member and \ref
355-
/// potentialMember and adding \ref sourceFileProvide.
356-
357-
enum class NodeKind {
358-
topLevel,
359-
nominal,
360-
/// In the status quo scheme, *member* dependencies could have blank names
361-
/// for the member, to indicate that the provider might add members.
362-
/// This code uses a separate kind, \ref potentialMember. The holder field is
363-
/// unused.
364-
potentialMember,
365-
/// Corresponding to the status quo *member* dependency with a non-blank
366-
/// member.
367-
member,
368-
dynamicLookup,
369-
externalDepend,
370-
sourceFileProvide,
371-
/// For iterating through the NodeKinds.
372-
kindCount
373-
};
374-
375-
/// Used for printing out NodeKinds to dot files, and dumping nodes for
376-
/// debugging.
377-
const std::string NodeKindNames[]{
378-
"topLevel", "nominal", "potentialMember", "member",
379-
"dynamicLookup", "externalDepend", "sourceFileProvide"};
380354

381355
/// Instead of the status quo scheme of two kinds of "Depends", cascading and
382356
/// non-cascading this code represents each entity ("Provides" in the status

include/swift/Basic/ReferenceDependencyKeys.h

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,36 @@ static constexpr StringLiteral dependsExternal("depends-external");
3333

3434
static constexpr StringLiteral interfaceHash("interface-hash");
3535
} // end namespace reference_dependency_keys
36+
37+
namespace fine_grained_dependencies {
38+
/// Encode the current sorts of dependencies as kinds of nodes in the dependency
39+
/// graph, splitting the current *member* into \ref member and \ref
40+
/// potentialMember and adding \ref sourceFileProvide.
41+
42+
enum class NodeKind {
43+
topLevel,
44+
nominal,
45+
/// In the status quo scheme, *member* dependencies could have blank names
46+
/// for the member, to indicate that the provider might add members.
47+
/// This code uses a separate kind, \ref potentialMember. The holder field is
48+
/// unused.
49+
potentialMember,
50+
/// Corresponding to the status quo *member* dependency with a non-blank
51+
/// member.
52+
member,
53+
dynamicLookup,
54+
externalDepend,
55+
sourceFileProvide,
56+
/// For iterating through the NodeKinds.
57+
kindCount
58+
};
59+
60+
/// Used for printing out NodeKinds to dot files, and dumping nodes for
61+
/// debugging.
62+
const std::string NodeKindNames[]{
63+
"topLevel", "nominal", "potentialMember", "member",
64+
"dynamicLookup", "externalDepend", "sourceFileProvide"};
65+
} // end namespace fine_grained_dependencies
3666
} // end namespace swift
3767

3868
#endif

0 commit comments

Comments
 (0)