[PATCH] D124946: [clang] serialize ORIGINAL_PCH_DIR relative to BaseDirectory
Richard Howell via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri May 6 13:48:46 PDT 2022
rmaz updated this revision to Diff 427731.
rmaz added a comment.
fix for missing temp dir in test
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D124946/new/
https://reviews.llvm.org/D124946
Files:
clang/lib/Serialization/ASTReader.cpp
clang/lib/Serialization/ASTWriter.cpp
clang/test/Modules/relative-original-dir.m
Index: clang/test/Modules/relative-original-dir.m
===================================================================
--- /dev/null
+++ clang/test/Modules/relative-original-dir.m
@@ -0,0 +1,7 @@
+// RUN: rm -rf %t/normal-module-map
+// RUN: mkdir -p %t
+// RUN: cp -r %S/Inputs/normal-module-map %t
+// RUN: %clang_cc1 -fmodules -fno-implicit-modules -fmodule-name=libA -emit-module %t/normal-module-map/module.map -o %t/normal-module-map/outdir/mod.pcm
+// RUN: llvm-bcanalyzer --dump --disable-histogram %t/normal-module-map/outdir/mod.pcm | FileCheck %s
+
+// CHECK: <ORIGINAL_PCH_DIR abbrevid=7/> blob data = 'outdir'
Index: clang/lib/Serialization/ASTWriter.cpp
===================================================================
--- clang/lib/Serialization/ASTWriter.cpp
+++ clang/lib/Serialization/ASTWriter.cpp
@@ -1461,8 +1461,7 @@
unsigned AbbrevCode = Stream.EmitAbbrev(std::move(Abbrev));
SmallString<128> OutputPath(OutputFile);
-
- SM.getFileManager().makeAbsolutePath(OutputPath);
+ PreparePathForOutput(OutputPath);
StringRef origDir = llvm::sys::path::parent_path(OutputPath);
RecordData::value_type Record[] = {ORIGINAL_PCH_DIR};
Index: clang/lib/Serialization/ASTReader.cpp
===================================================================
--- clang/lib/Serialization/ASTReader.cpp
+++ clang/lib/Serialization/ASTReader.cpp
@@ -2898,6 +2898,7 @@
case ORIGINAL_PCH_DIR:
F.OriginalDir = std::string(Blob);
+ ResolveImportedPath(F, F.OriginalDir);
break;
case MODULE_NAME:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124946.427731.patch
Type: text/x-patch
Size: 1554 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220506/527a778e/attachment.bin>
More information about the cfe-commits
mailing list