[PATCH] D157562: [Driver][DXC] Treat stdin as HLSL

Justin Bogner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 10 09:53:10 PDT 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG0d459b71dc28: [Driver][DXC] Treat stdin as HLSL (authored by bogner).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157562/new/

https://reviews.llvm.org/D157562

Files:
  clang/lib/Driver/Driver.cpp
  clang/test/Driver/dxc_stdin.hlsl


Index: clang/test/Driver/dxc_stdin.hlsl
===================================================================
--- /dev/null
+++ clang/test/Driver/dxc_stdin.hlsl
@@ -0,0 +1,3 @@
+// RUN: %clang_dxc -Tlib_6_7 - -### 2>&1 | FileCheck %s
+// CHECK: "-cc1"
+// CHECK-SAME: "-x" "hlsl" "-"
Index: clang/lib/Driver/Driver.cpp
===================================================================
--- clang/lib/Driver/Driver.cpp
+++ clang/lib/Driver/Driver.cpp
@@ -2648,6 +2648,8 @@
         if (memcmp(Value, "-", 2) == 0) {
           if (IsFlangMode()) {
             Ty = types::TY_Fortran;
+          } else if (IsDXCMode()) {
+            Ty = types::TY_HLSL;
           } else {
             // If running with -E, treat as a C input (this changes the
             // builtin macros, for example). This may be overridden by -ObjC


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157562.549087.patch
Type: text/x-patch
Size: 825 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230810/b31fdc0f/attachment.bin>


More information about the cfe-commits mailing list