-
Notifications
You must be signed in to change notification settings - Fork 344
[clang][modules][deps] Cherry-pick explicit modules commits #5568
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
[clang][modules][deps] Cherry-pick explicit modules commits #5568
Conversation
This is a fix related to D135414. The original intention was to keep `BaseFS` as a member of the worker and conditionally overlay it with local in-memory FS. The `move` of ref-counted `BaseFS` was not intended, and it's a bug. Disabling parallelism in the "by-module-name" test reliably reproduces this, and the test itself doesn't *need* parallelism. (I think `-j 4` was cargo culted from another test.) Reusing that test to check for correct behavior... Reviewed By: DavidSpickett Differential Revision: https://reviews.llvm.org/D136124 (cherry picked from commit d239f3c)
(cherry picked from commit 6dda497)
This patch adds new functions for writing/reading `FileID`s and uses them to replace some ad-hoc code. Reviewed By: dexonsmith Differential Revision: https://reviews.llvm.org/D137211 (cherry picked from commit fdbc55a)
…instead of SourceLocation For pragma diagnostic mappings, we always write/read `SourceLocation` with offset 0. This is equivalent to just writing a `FileID`, which is exactly what this patch starts doing. Depends on D137211. Reviewed By: dexonsmith Differential Revision: https://reviews.llvm.org/D137213 (cherry picked from commit f61c135)
…ceManager offsets This patch is a NFC prep for D136624, where we start adjusting offsets into `SourceManager`. Depends on D137213. Reviewed By: dexonsmith Differential Revision: https://reviews.llvm.org/D137214 (cherry picked from commit 0bfc97e)
This is a prep-patch for D136624 which allows querying `SourceManager` with raw offsets instead of `SourceLocation`s. Reviewed By: dexonsmith Differential Revision: https://reviews.llvm.org/D137215 (cherry picked from commit 9ae6e6a)
…affecting files This patch delays some `ASTWriter` logic until after we've checked whether the source location entry we're serializing as an affecting file or not. Depends on D137214. Reviewed By: dexonsmith Differential Revision: https://reviews.llvm.org/D137216 (cherry picked from commit a13122c)
In D106876, we stopped serializing module map files that didn't affect compilation of the current module. However, since each `SourceLocation` is simply an offset into `SourceManager`'s global buffer of concatenated input files in, these need to be adjusted during serialization. Otherwise, they can incorrectly point after the buffer or into subsequent input file. This patch starts adjusting `SourceLocation`s, `FileID`s and other `SourceManager` offsets in `ASTWriter`. Reviewed By: dexonsmith Differential Revision: https://reviews.llvm.org/D136624 (cherry picked from commit 6924a49)
The dependency scanner relies on the module map filtering logic in `ASTWriter`. The algorithm currently considers all system module maps affecting, which is not only sub-optimal, but can also cause failures when building a module explicitly (see attached test case). This patch applies the same filtering logic to system module maps. Reviewed By: Bigcheese Differential Revision: https://reviews.llvm.org/D136007 (cherry picked from commit f33173a)
@swift-ci please test |
1 similar comment
@swift-ci please test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. This should fix an assertion we're seeing in rdar://problem/102119326 (cc: @fredriss)
Any chance we can also include 060b253? |
That commit already is in the target branch: 35515c9. |
Ah. I was looking it up by hash. Thank you! |
I believe some Swift fixes came in recently that might unblock this |
This PR cherry-picks upstream commits motivated by implicitly discovered, explicitly built Clang modules.