Skip to content

Conversation

@qiongsiwu
Copy link
Contributor

@qiongsiwu qiongsiwu commented Nov 18, 2025

This PR teaches Swift to take advantage of the new clang dependency scanning API to use a single clang compiler instance per dependency scanning worker to perform by-name queries.

rdar://136303612

@qiongsiwu
Copy link
Contributor Author

qiongsiwu commented Nov 18, 2025

Note that CAS/plugin_cas.swift may fail before #85547 lands.

@qiongsiwu
Copy link
Contributor Author

Please test with following PR:
swiftlang/llvm-project#11821

@swift-ci please smoke test

@qiongsiwu qiongsiwu force-pushed the eng_136303612_SharingCI branch from fffde38 to 59c3895 Compare November 18, 2025 17:23
@qiongsiwu
Copy link
Contributor Author

Please test with following PR:
swiftlang/llvm-project#11821

@swift-ci please smoke test

@qiongsiwu
Copy link
Contributor Author

Please test with following PR:
swiftlang/llvm-project#11821

@swift-ci please smoke test

@qiongsiwu
Copy link
Contributor Author

@swift-ci please smoke test

@qiongsiwu
Copy link
Contributor Author

@swift-ci please test

@qiongsiwu
Copy link
Contributor Author

@swift-ci please test llvm

@qiongsiwu
Copy link
Contributor Author

@swift-ci please smoke test

@qiongsiwu
Copy link
Contributor Author

@swift-ci please test

Copy link
Contributor

@artemcm artemcm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool!

@qiongsiwu
Copy link
Contributor Author

@swift-ci please smoke test

@qiongsiwu qiongsiwu requested a review from artemcm December 2, 2025 16:26
@qiongsiwu
Copy link
Contributor Author

Thanks for the suggestions!

The latest commit folds the initialization into a create static method and move the constructor to a private method. The finalization is folded into the destructor of the ModuleDependencyScanner. I will need to update the clang side because the finalization implementation on the clang side cannot handle the situation where the initialization was never successful. Now we call the finalization in the destructor, we can be in a situation where the initialization never succeeds, and finalization is still called. I don't feel like having a status flag in the Swift ModuleDependencyScanner to track the initialization state so we can finalize correctly.

@qiongsiwu qiongsiwu requested a review from artemcm December 16, 2025 03:52
 Conflicts:
	include/swift/DependencyScan/ModuleDependencyScanner.h
	lib/DependencyScan/ModuleDependencyScanner.cpp
	lib/DependencyScan/ScanDependencies.cpp
@qiongsiwu
Copy link
Contributor Author

Please test with following PR:
swiftlang/llvm-project#12029

@swift-ci please smoke test

@qiongsiwu
Copy link
Contributor Author

Please test with following PR:
swiftlang/llvm-project#12029

@swift-ci please smoke test Windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants