Skip to content

Commit 0ad6a87

Browse files
authored
Merge pull request #73911 from ahoppen/write-empty-record-files
[Index] Write empty record files
2 parents 45a299a + 0614fc9 commit 0ad6a87

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

lib/Index/IndexRecord.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -285,11 +285,6 @@ StringRef StdlibGroupsIndexRecordingConsumer::findGroupForSymbol(const IndexSymb
285285
static bool writeRecord(SymbolTracker &record, std::string Filename,
286286
std::string indexStorePath, DiagnosticEngine *diags,
287287
std::string &outRecordFile) {
288-
if (record.getOccurrences().empty()) {
289-
outRecordFile = std::string();
290-
return false;
291-
}
292-
293288
IndexRecordWriter recordWriter(indexStorePath);
294289
std::string error;
295290
auto result = recordWriter.beginRecord(

test/Index/Store/record-empty.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
// RUN: %target-swift-frontend -index-store-path %t/idx -o %t/file.o -typecheck -primary-file %s
33
// RUN: %target-swift-frontend -index-store-path %t/idx -o %t/file.o -typecheck %s
44
// RUN: c-index-test core -print-unit %t/idx | %FileCheck %s
5-
// CHECK-NOT: Record{{.*}}record-empty
5+
// CHECK: Record | user | {{.*}}{{/|\\}}record-empty.swift

test/Index/Store/unit-from-compile.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
// CHECK: DEPEND START
1818
// CHECK: Unit | system | {{.*}}{{/|\\}}Swift.swiftmodule
19-
// CHECK: DEPEND END (1)
19+
// CHECK: Record | user | {{.*}}{{/|\\}}unit-from-compile.swift
20+
// CHECK: DEPEND END (2)
2021

2122
// OPT: is-debug: 1

0 commit comments

Comments
 (0)