llvm-project
c9a86145 - [dsymutil] Support compilation-prefix-map.json from compilation caching (#242436)

Commit
2 hours ago
[dsymutil] Support compilation-prefix-map.json from compilation caching (#242436) Compilation caching can prefix map the paths that the compiler sees, so that cache keys don't depend on where the build happens, for example /path/to/project becomes /^src. The build system records the mapping in a compilation-prefix-map.json file in a parent directory of the object files, as a JSON object from each remapped prefix to the original one. dsymutil didn't support it, so it used the remapped paths from the debug info as is: it failed to copy the Swift interfaces that the debug info refers to, didn't recognize interfaces from the SDK or the toolchain that it should skip, and wrote the remapped paths into the dSYM. Load the compilation-prefix-map.json closest to each object file, and use it to find Swift interfaces and Clang modules, and to restore the original paths in the path attributes and line tables of the linked debug info. Clang modules use the map of the object file that refers to them. -object-prefix-map still only applies to looking up Clang modules. Also check whether Swift interface paths are absolute on either POSIX or Windows, like other paths from the debug info, which can come from another platform. On Windows, a POSIX absolute path was combined with the compilation directory.
Parents
Loading