Skip to content

Commit 0d459b7

Browse files
committed
[Driver][DXC] Treat stdin as HLSL
Differential Revision: https://reviews.llvm.org/D157562
1 parent 5aa06b1 commit 0d459b7

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

clang/lib/Driver/Driver.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2648,6 +2648,8 @@ void Driver::BuildInputs(const ToolChain &TC, DerivedArgList &Args,
26482648
if (memcmp(Value, "-", 2) == 0) {
26492649
if (IsFlangMode()) {
26502650
Ty = types::TY_Fortran;
2651+
} else if (IsDXCMode()) {
2652+
Ty = types::TY_HLSL;
26512653
} else {
26522654
// If running with -E, treat as a C input (this changes the
26532655
// builtin macros, for example). This may be overridden by -ObjC

clang/test/Driver/dxc_stdin.hlsl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// RUN: %clang_dxc -Tlib_6_7 - -### 2>&1 | FileCheck %s
2+
// CHECK: "-cc1"
3+
// CHECK-SAME: "-x" "hlsl" "-"

0 commit comments

Comments
 (0)