Skip to content

Commit 75ec24e

Browse files
authored
[HLSL][clang][Driver] Fix error when using the option -fcgl in --driver-mode=dxc. (#97001)
When -fcgl is set in --driver-mode=dxc, both -S and -emit-llvm are currently enabled. This results in the following error: ``` error: '-S' action ignored; '-emit-llvm' action specified previously. ``` This change fixes the issue by not rendering -S in RenderHLSLOptions. Additionally, a test has been added to ensure that enabling -fcgl does not trigger any diagnostics Fixes #97296
1 parent 9f3bfbb commit 75ec24e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3666,7 +3666,6 @@ static void RenderHLSLOptions(const ArgList &Args, ArgStringList &CmdArgs,
36663666
const unsigned ForwardedArguments[] = {options::OPT_dxil_validator_version,
36673667
options::OPT_D,
36683668
options::OPT_I,
3669-
options::OPT_S,
36703669
options::OPT_O,
36713670
options::OPT_emit_llvm,
36723671
options::OPT_emit_obj,

clang/test/Driver/dxc_fcgl.hlsl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
// RUN: not %clang_dxc -fcgl -T lib_6_7 foo.hlsl -### %s 2>&1 | FileCheck %s
2+
// RUN: %clang_dxc -fcgl -T lib_6_7 %s -Xclang -verify
23

34
// Make sure fcgl option flag which translated into "-emit-llvm" "-disable-llvm-passes".
4-
// CHECK:"-S"
5-
// CHECK-SAME:"-emit-llvm" "-disable-llvm-passes"
5+
// CHECK: "-emit-llvm"
6+
// CHECK-SAME: "-disable-llvm-passes"
67

8+
// Make sure fcgl option not generate any diagnostics.
9+
// expected-no-diagnostics

0 commit comments

Comments
 (0)