@@ -229,6 +229,13 @@ std::string FrontendSourceFileDepGraphFactory::getFingerprint(SourceFile *SF) {
229
229
return getInterfaceHash (SF);
230
230
}
231
231
232
+ std::string
233
+ FrontendSourceFileDepGraphFactory::getInterfaceHash (SourceFile *SF) {
234
+ llvm::SmallString<32 > interfaceHash;
235
+ SF->getInterfaceHash (interfaceHash);
236
+ return interfaceHash.str ().str ();
237
+ }
238
+
232
239
// ==============================================================================
233
240
// MARK: FrontendSourceFileDepGraphFactory - adding collections of defined Decls
234
241
// ==============================================================================
@@ -407,7 +414,8 @@ template <NodeKind kind, typename ContentsT>
407
414
void FrontendSourceFileDepGraphFactory::addAllDefinedDeclsOfAGivenType (
408
415
std::vector<ContentsT> &contentsVec) {
409
416
for (const auto &declOrPair : contentsVec) {
410
- Optional<std::string> fp = getFingerprintIfAny (declOrPair);
417
+ Optional<std::string> fp =
418
+ AbstractSourceFileDepGraphFactory::getFingerprintIfAny (declOrPair);
411
419
addADefinedDecl (
412
420
DependencyKey::createForProvidedEntityInterface<kind>(declOrPair),
413
421
fp ? StringRef (fp.getValue ()) : Optional<StringRef>());
@@ -519,33 +527,6 @@ void FrontendSourceFileDepGraphFactory::addAllUsedDecls() {
519
527
.enumerateAllUses ();
520
528
}
521
529
522
- // ==============================================================================
523
- // MARK: FrontendSourceFileDepGraphFactory - adding individual defined Decls
524
- // ==============================================================================
525
-
526
- std::string
527
- FrontendSourceFileDepGraphFactory::getInterfaceHash (SourceFile *SF) {
528
- llvm::SmallString<32 > interfaceHash;
529
- SF->getInterfaceHash (interfaceHash);
530
- return interfaceHash.str ().str ();
531
- }
532
-
533
- // / At present, only \c NominalTypeDecls have (body) fingerprints
534
- Optional<std::string> FrontendSourceFileDepGraphFactory::getFingerprintIfAny (
535
- std::pair<const NominalTypeDecl *, const ValueDecl *>) {
536
- return None;
537
- }
538
- Optional<std::string>
539
- FrontendSourceFileDepGraphFactory::getFingerprintIfAny (const Decl *d) {
540
- if (const auto *idc = dyn_cast<IterableDeclContext>(d)) {
541
- auto result = idc->getBodyFingerprint ();
542
- assert ((!result || !result->empty ()) &&
543
- " Fingerprint should never be empty" );
544
- return result;
545
- }
546
- return None;
547
- }
548
-
549
530
// ==============================================================================
550
531
// MARK: ModuleDepGraphFactory
551
532
// ==============================================================================
@@ -591,29 +572,10 @@ template <NodeKind kind, typename ContentsT>
591
572
void ModuleDepGraphFactory::addAllDefinedDeclsOfAGivenType (
592
573
std::vector<ContentsT> &contentsVec) {
593
574
for (const auto &declOrPair : contentsVec) {
594
- Optional<std::string> fp = getFingerprintIfAny (declOrPair);
575
+ Optional<std::string> fp =
576
+ AbstractSourceFileDepGraphFactory::getFingerprintIfAny (declOrPair);
595
577
addADefinedDecl (
596
578
DependencyKey::createForProvidedEntityInterface<kind>(declOrPair),
597
579
fp ? StringRef (fp.getValue ()) : Optional<StringRef>());
598
580
}
599
581
}
600
-
601
- // ==============================================================================
602
- // MARK: ModuleDepGraphFactory - adding individual defined Decls
603
- // ==============================================================================
604
-
605
- // / At present, only \c NominalTypeDecls have (body) fingerprints
606
- Optional<std::string> ModuleDepGraphFactory::getFingerprintIfAny (
607
- std::pair<const NominalTypeDecl *, const ValueDecl *>) {
608
- return None;
609
- }
610
- Optional<std::string>
611
- ModuleDepGraphFactory::getFingerprintIfAny (const Decl *d) {
612
- if (const auto *idc = dyn_cast<IterableDeclContext>(d)) {
613
- auto result = idc->getBodyFingerprint ();
614
- assert ((!result || !result->empty ()) &&
615
- " Fingerprint should never be empty" );
616
- return result;
617
- }
618
- return None;
619
- }
0 commit comments