[clang] serialize ORIGINAL_PCH_DIR relative to BaseDirectory
authorRichard Howell <rhow@fb.com>
Wed, 4 May 2022 17:25:34 +0000 (10:25 -0700)
committerRichard Howell <rhow@fb.com>
Thu, 12 May 2022 14:31:19 +0000 (07:31 -0700)
commitee51e9795a31e1280e30179215c27e09927230e2
treedf32f852443ec2a06adca6ea6cc2892930a6d2df
parentf11056943e56a32d81bb36d11fb5ce8d2b2ce79b
[clang] serialize ORIGINAL_PCH_DIR relative to BaseDirectory

This diff changes the serialization of the `ORIGINAL_PCH_DIR`
entry in module files to be serialized relative to the module's
`BaseDirectory`. This will allow for the module to be relocatable
across machines.

The path is restored relative to the module's BaseDirectory on
deserialization.

Reviewed By: urnathan

Differential Revision: https://reviews.llvm.org/D124946
clang/lib/Serialization/ASTReader.cpp
clang/lib/Serialization/ASTWriter.cpp
clang/test/Modules/relative-original-dir.m [new file with mode: 0644]