[PATCH] D128462: [HLSL] add -I option for dxc mode.
Chris Bieneman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 14 15:53:15 PDT 2022
beanz added a comment.
This change works and avoids the duplicated group. The duplicated group results in the help spew duplicating the group heading, which is undesirable.
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index 6dd4ec82d376..2dcdbae4385d 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -6310,10 +6310,7 @@ def defsym : Separate<["-"], "defsym">,
// clang-cl Options
//===----------------------------------------------------------------------===//
-def cl_Group : OptionGroup<"<clang-cl options>">, Flags<[CLOption]>,
- HelpText<"CL.EXE COMPATIBILITY OPTIONS">;
-
-def cl_dxc_Group : OptionGroup<"<clang-cl options>">, Flags<[CLDXCOption]>,
+def cl_Group : OptionGroup<"<clang-cl options>">, Flags<[CLDXCOption]>,
HelpText<"CL.EXE COMPATIBILITY OPTIONS">;
def cl_compile_Group : OptionGroup<"<clang-cl compile-only options>">,
@@ -6344,7 +6341,7 @@ class CLJoinedOrSeparate<string name> : Option<["/", "-"], name,
KIND_JOINED_OR_SEPARATE>, Group<cl_Group>, Flags<[CLOption, NoXarchOption]>;
class CLDXCJoinedOrSeparate<string name> : Option<["/", "-"], name,
- KIND_JOINED_OR_SEPARATE>, Group<cl_dxc_Group>, Flags<[CLDXCOption, NoXarchOption]>;
+ KIND_JOINED_OR_SEPARATE>, Group<cl_Group>, Flags<[CLDXCOption, NoXarchOption]>;
class CLCompileJoinedOrSeparate<string name> : Option<["/", "-"], name,
KIND_JOINED_OR_SEPARATE>, Group<cl_compile_Group>,
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index bc26f0d279a2..ee72f0fcb54c 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -6238,6 +6238,10 @@ Driver::getIncludeExcludeOptionFlagMasks(bool IsClCompatMode) const {
} else {
ExcludedFlagsBitmask |= options::DXCOption;
}
+
+ if (!IsClCompatMode && !IsDXCMode())
+ ExcludedFlagsBitmask |= options::CLDXCOption;
+
return std::make_pair(IncludedFlagsBitmask, ExcludedFlagsBitmask);
}
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D128462/new/
https://reviews.llvm.org/D128462
More information about the cfe-commits
mailing list