Skip to content

[Caching] Adopt -finclude-tree-preserve-pch-path to fix -gmodules with #73038

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

benlangmuir
Copy link
Contributor

@benlangmuir benlangmuir commented Apr 15, 2024

  • Explanation: This fixes debugging of code built with Swift caching for types that come from clang modules and bridging headers. It does so by adopting the new clang -cc1 option -finclude-tree-preserve-pch-path that was designed to allow Swift to use -gmodules in caching builds as a stop gap until a full solution for Clang -gmodules caching is developed (the usage from Swift is simpler than for arbitrary Clang builds). Note: requires corresponding Clang change [cas] Add cc1 option -finclude-tree-preserve-pch-path llvm-project#8575
  • Scope: Fixes common debugging scenario (using types from clang modules or bridging header) and should have no negative impact.
  • Issue: rdar://126370706
  • Original PR: [Caching] Adopt -finclude-tree-preserve-pch-path to fix -gmodules with #73014
  • Risk: Low. This flag only impacts caching builds. The specific change should make caching builds behave more like non-caching builds in this area.
  • Testing: Regression tests for both Swift and Clang changes, manually tested that caching builds now can debug with clang modules + bridging header types.
  • Reviewers: @artemcm @cachemeifyoucan

This fixes -gmodules when caching by adopting the new clang -cc1 option
-finclude-tree-preserve-pch-path. -gmodules is required to make
debugging work when examining types that come from clang modules or
bridging headers, but was previously being disabled by clang's caching
support.

rdar://126370706
(cherry picked from commit d178172)
@benlangmuir
Copy link
Contributor Author

swiftlang/llvm-project#8575
@swift-ci please test

@fredriss fredriss merged commit 235b1c8 into swiftlang:release/6.0 Apr 16, 2024
@benlangmuir benlangmuir deleted the eng/blangmuir/finclude-tree-preserve-pch-path-6.0 branch April 16, 2024 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants