-
Notifications
You must be signed in to change notification settings - Fork 14.9k
[clang][deps] Add module map describing compiled module to file dependencies. #160226
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
46288ff
377a157
3902244
f2e0215
e0643f7
b9928d7
8af54e0
7cd357d
bbfebe5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -444,9 +444,11 @@ void ModuleDepCollector::applyDiscoveredDependencies(CompilerInvocation &CI) { | |
if (OptionalFileEntryRef CurrentModuleMap = | ||
PP.getHeaderSearchInfo() | ||
.getModuleMap() | ||
.getModuleMapFileForUniquing(CurrentModule)) | ||
.getModuleMapFileForUniquing(CurrentModule)) { | ||
CI.getFrontendOpts().ModuleMapFiles.emplace_back( | ||
CurrentModuleMap->getNameAsRequested()); | ||
Consumer.handleFileDependency(CurrentModuleMap->getNameAsRequested()); | ||
|
||
} | ||
|
||
SmallVector<ModuleID> DirectDeps; | ||
for (const auto &KV : ModularDeps) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,7 +46,8 @@ | |
// CHECK: "file-deps": [ | ||
// CHECK-NEXT: "[[PREFIX]]/modules-fmodule-name-no-module-built.m", | ||
// CHECK-NEXT: "[[PREFIX]]/Inputs/header3.h", | ||
// CHECK-NEXT: "[[PREFIX]]/Inputs/header.h" | ||
// CHECK-NEXT: "[[PREFIX]]/Inputs/header.h", | ||
// CHECK-NEXT: "Inputs/module.modulemap" | ||
|
||
// CHECK-NEXT: ], | ||
// CHECK-NEXT: "input-file": "[[PREFIX]]/modules-fmodule-name-no-module-built.m" | ||
// CHECK-NEXT: } |
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.
All other file dependencies go through
addFileDep
which handles making the file path match the expected style (absolute, with native path separators). That's why you're seeing a relative modulemap path.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.
I see, thanks. Switched to
addFileDep
as this looks like a common approach andConsumer.handleFileDependency
is invoked in 1 place only.