[PATCH] D146364: [Driver] Fix naming conflicts of getStatsFileName when using LTO
Yingwei Zheng via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Mar 19 06:39:58 PDT 2023
dtcxzyw updated this revision to Diff 506387.
dtcxzyw removed subscribers: MaskRay, cfe-commits, inglorion.
dtcxzyw added a comment.
Fix test errors.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146364/new/
https://reviews.llvm.org/D146364
Files:
clang/lib/Driver/ToolChains/CommonArgs.cpp
Index: clang/lib/Driver/ToolChains/CommonArgs.cpp
===================================================================
--- clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -1774,14 +1774,13 @@
StringRef SaveStats = A->getValue();
if (SaveStats == "obj" && Output.isFilename()) {
StatsFile.assign(Output.getFilename());
- llvm::sys::path::remove_filename(StatsFile);
- } else if (SaveStats != "cwd") {
+ } else if (SaveStats == "cwd") {
+ StatsFile.assign(llvm::sys::path::filename(Input.getBaseInput()));
+ } else {
D.Diag(diag::err_drv_invalid_value) << A->getAsString(Args) << SaveStats;
return {};
}
- StringRef BaseName = llvm::sys::path::filename(Input.getBaseInput());
- llvm::sys::path::append(StatsFile, BaseName);
llvm::sys::path::replace_extension(StatsFile, "stats");
} else {
assert(D.CCPrintInternalStats);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146364.506387.patch
Type: text/x-patch
Size: 939 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230319/210a0fec/attachment.bin>
More information about the cfe-commits
mailing list