forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 331
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[clang] Report the on-disk paths for inputs to module compiles
Since D135636, PCM files contain the "as requested" path of input files. The machinery for generating dependency files reports those paths as they appeared in the PCM file, which may confuse consumers that are not aware of VFS overlays that might've been in place at compile-time. This patch makes sure the "use-external-name" setting is being respected when generating dependency files in modular builds by piping the paths serialized in PCMs through `FileEntryRef::getName()` before putting them into dependency files. rdar://103459532 Reviewed By: benlangmuir Differential Revision: https://reviews.llvm.org/D141644 (cherry picked from commit 347028a)
- Loading branch information
1 parent
996354c
commit 2216ee8
Showing
3 changed files
with
52 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// RUN: rm -rf %t | ||
// RUN: split-file %s %t | ||
|
||
//--- module.modulemap | ||
module M { header "m.h" } | ||
|
||
//--- m-real.h | ||
|
||
//--- overlay.json.template | ||
{ | ||
"version": 0, | ||
"case-sensitive": "false", | ||
"roots": [ | ||
{ | ||
"external-contents": "DIR/m-real.h", | ||
"name": "DIR/m.h", | ||
"type": "file" | ||
} | ||
] | ||
} | ||
|
||
//--- tu.c | ||
#include "m.h" | ||
|
||
// RUN: sed -e "s|DIR|%/t|g" %t/overlay.json.template > %t/overlay.json | ||
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/cache \ | ||
// RUN: -ivfsoverlay %t/overlay.json -dependency-file %t/tu.d -MT %t/tu.o -fsyntax-only %t/tu.c | ||
// RUN: FileCheck %s --input-file=%t/tu.d | ||
// CHECK: {{.*}}tu.o: \ | ||
// CHECK-NEXT: {{.*}}tu.c \ | ||
// CHECK-NEXT: {{.*}}module.modulemap \ | ||
// CHECK-NEXT: {{.*}}m-real.h |