mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[DepScan] Teach dependency scanner to remap path for canonicalization
Allow DependencyScanner to canonicalize path using a prefix map. When option `-scanner-prefix-map` option is used, dependency scanner will remap all the input paths in following: * all the paths in the CAS file system or clang include tree * all the paths related to input on the command-line returned by scanner This allows all the input paths to be canonicalized so cache key can be computed reguardless of the exact on disk path. The sourceFile field is not remapped so build system can track the exact file as on the local file system.
This commit is contained in:
@@ -1809,6 +1809,9 @@ static bool ParseSearchPathArgs(SearchPathOptions &Opts,
|
||||
auto SplitMap = StringRef(A).split('=');
|
||||
Opts.DeserializedPathRecoverer.addMapping(SplitMap.first, SplitMap.second);
|
||||
}
|
||||
for (StringRef Opt : Args.getAllArgValues(OPT_scanner_prefix_map)) {
|
||||
Opts.ScannerPrefixMapper.push_back(Opt.str());
|
||||
}
|
||||
// Opts.RuntimeIncludePath is set by calls to
|
||||
// setRuntimeIncludePath() or setMainExecutablePath().
|
||||
// Opts.RuntimeImportPath is set by calls to
|
||||
|
||||
Reference in New Issue
Block a user