[Dependency Scanning] Emit diagnostics from compilation instance initialization

This commit is contained in:
Artem Chikin
2024-06-17 13:49:09 -07:00
parent 55d4a56c69
commit 4b7bf3a59d
5 changed files with 117 additions and 93 deletions

View File

@@ -126,11 +126,13 @@ void swiftscan_dependency_info_dispose(swiftscan_dependency_info_t info) {
}
void swiftscan_dependency_set_dispose(swiftscan_dependency_set_t *set) {
for (size_t i = 0; i < set->count; ++i) {
swiftscan_dependency_info_dispose(set->modules[i]);
if (set) {
for (size_t i = 0; i < set->count; ++i) {
swiftscan_dependency_info_dispose(set->modules[i]);
}
delete[] set->modules;
delete set;
}
delete[] set->modules;
delete set;
}
//=== Scanner Cache Operations --------------------------------------------===//
@@ -753,11 +755,13 @@ void swiftscan_diagnostic_dispose(swiftscan_diagnostic_info_t diagnostic) {
void
swiftscan_diagnostics_set_dispose(swiftscan_diagnostic_set_t* diagnostics){
for (size_t i = 0; i < diagnostics->count; ++i) {
swiftscan_diagnostic_dispose(diagnostics->diagnostics[i]);
if (diagnostics) {
for (size_t i = 0; i < diagnostics->count; ++i) {
swiftscan_diagnostic_dispose(diagnostics->diagnostics[i]);
}
delete[] diagnostics->diagnostics;
delete diagnostics;
}
delete[] diagnostics->diagnostics;
delete diagnostics;
}
//=== Source Location -----------------------------------------------------===//