[PATCH] D157562: [Driver][DXC] Treat stdin as HLSL
Justin Bogner via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 9 16:34:09 PDT 2023
bogner created this revision.
bogner added reviewers: beanz, python3kgae.
Herald added subscribers: Anastasia, mcrosier.
Herald added a project: All.
bogner requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay.
Herald added a project: clang.
Repository:
rG LLVM Github Monorepo
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.548812.patch
Type: text/x-patch
Size: 825 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230809/abd27aa1/attachment.bin>
More information about the cfe-commits
mailing list