[PATCH] D117292: [Driver] Pass the flag -dI to cc1 invocation
Qichao Gu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 14 01:54:13 PST 2022
qichaogu created this revision.
qichaogu added a reviewer: cfe-commits.
qichaogu requested review of this revision.
Hook up the flag -dI in the driver to pass it to cc1 invocation.
https://reviews.llvm.org/D117292
Files:
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/preprocessor.c
Index: clang/test/Driver/preprocessor.c
===================================================================
--- clang/test/Driver/preprocessor.c
+++ clang/test/Driver/preprocessor.c
@@ -4,3 +4,11 @@
#define A B
A A
+// The driver should pass preprocessor dump flags (-dD, -dM and -dI) to cc1 invocation
+// RUN: %clang -### -E -dD %s 2>&1 | FileCheck --check-prefix=CHECK-dD %s
+// RUN: %clang -### -E -dM %s 2>&1 | FileCheck --check-prefix=CHECK-dM %s
+// RUN: %clang -### -E -dI %s 2>&1 | FileCheck --check-prefix=CHECK-dI %s
+// CHECK-dD: clang{{.*}} "-cc1" {{.*}} "-dD"
+// CHECK-dM: clang{{.*}} "-cc1" {{.*}} "-dM"
+// CHECK-dI: clang{{.*}} "-cc1" {{.*}} "-dI"
+
Index: clang/lib/Driver/ToolChains/Clang.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -6666,6 +6666,7 @@
Args.AddLastArg(CmdArgs, options::OPT_dM);
Args.AddLastArg(CmdArgs, options::OPT_dD);
+ Args.AddLastArg(CmdArgs, options::OPT_dI);
Args.AddLastArg(CmdArgs, options::OPT_fmax_tokens_EQ);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117292.399931.patch
Type: text/x-patch
Size: 1093 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220114/67836899/attachment.bin>
More information about the cfe-commits
mailing list