[PATCH] D134657: [Driver] pass -fcrash-diagnostics-dir to LTO
Yuanfang Chen via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 27 13:14:35 PDT 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG5839fb6d25b4: [Driver] pass -fcrash-diagnostics-dir to LTO (authored by ychen).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D134657/new/
https://reviews.llvm.org/D134657
Files:
clang/lib/Driver/ToolChains/CommonArgs.cpp
clang/test/Driver/crash-diagnostics-dir-2.c
Index: clang/test/Driver/crash-diagnostics-dir-2.c
===================================================================
--- clang/test/Driver/crash-diagnostics-dir-2.c
+++ clang/test/Driver/crash-diagnostics-dir-2.c
@@ -3,3 +3,12 @@
// OPTION: "-crash-diagnostics-dir=mydumps"
// RUN: %clang -### -c %s 2>&1 | FileCheck %s --check-prefix=NOOPTION
// NOOPTION-NOT: "-crash-diagnostics-dir
+
+// RUN: %clang -### -fcrash-diagnostics-dir=mydumps -flto %s 2>&1 \
+// RUN: | FileCheck %s --check-prefix=LTO-OPTION
+// LTO-OPTION: "-cc1"
+// LTO-OPTION: "-plugin-opt=-crash-diagnostics-dir=mydumps"
+
+// RUN: %clang -### -flto %s 2>&1 | FileCheck %s --check-prefix=LTO-NOOPTION
+// LTO-NOOPTION: "-cc1"
+// LTO-NOOPTION-NOT: "-plugin-opt=-crash-diagnostics-dir=mydumps"
Index: clang/lib/Driver/ToolChains/CommonArgs.cpp
===================================================================
--- clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -632,6 +632,11 @@
CmdArgs.push_back(
Args.MakeArgString(Twine("-plugin-opt=stats-file=") + StatsFile));
+ // Setup crash diagnostics dir.
+ if (Arg *A = Args.getLastArg(options::OPT_fcrash_diagnostics_dir))
+ CmdArgs.push_back(Args.MakeArgString(
+ Twine("-plugin-opt=-crash-diagnostics-dir=") + A->getValue()));
+
addX86AlignBranchArgs(D, Args, CmdArgs, /*IsLTO=*/true);
// Handle remark diagnostics on screen options: '-Rpass-*'.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134657.463323.patch
Type: text/x-patch
Size: 1454 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220927/bcb65404/attachment-0001.bin>
More information about the cfe-commits
mailing list