-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[HLSL] Allow non .hlsl
files as source files
#137378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Changes the driver to assume input file with an unknown extension are HLSL source files instead of object files. Fixes llvm#137370
@llvm/pr-subscribers-clang-driver Author: Steven Perron (s-perron) ChangesChanges the driver to assume input file with an unknown extension are Fixes #137370 Full diff: https://github.com/llvm/llvm-project/pull/137378.diff 2 Files Affected:
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 2b8c6e35263b1..a648cc928afdc 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -3001,6 +3001,8 @@ void Driver::BuildInputs(const ToolChain &TC, DerivedArgList &Args,
Ty = types::TY_CXX;
else if (CCCIsCPP() || CCGenDiagnostics)
Ty = types::TY_C;
+ else if (IsDXCMode())
+ Ty = types::TY_HLSL;
else
Ty = types::TY_Object;
}
diff --git a/clang/test/Driver/dxc_I.test b/clang/test/Driver/dxc_I.test
new file mode 100644
index 0000000000000..e88537c6b1ab8
--- /dev/null
+++ b/clang/test/Driver/dxc_I.test
@@ -0,0 +1,4 @@
+// RUN: %clang_dxc -Tlib_6_3 -### %s 2>&1 | FileCheck %s
+
+// Make sure a non `.hlsl` file is considered an HLSL source file in dxc mode.
+// CHECK: "-x" "hlsl" "{{.*}}/dxc_I.test"
|
@llvm/pr-subscribers-clang Author: Steven Perron (s-perron) ChangesChanges the driver to assume input file with an unknown extension are Fixes #137370 Full diff: https://github.com/llvm/llvm-project/pull/137378.diff 2 Files Affected:
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 2b8c6e35263b1..a648cc928afdc 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -3001,6 +3001,8 @@ void Driver::BuildInputs(const ToolChain &TC, DerivedArgList &Args,
Ty = types::TY_CXX;
else if (CCCIsCPP() || CCGenDiagnostics)
Ty = types::TY_C;
+ else if (IsDXCMode())
+ Ty = types::TY_HLSL;
else
Ty = types::TY_Object;
}
diff --git a/clang/test/Driver/dxc_I.test b/clang/test/Driver/dxc_I.test
new file mode 100644
index 0000000000000..e88537c6b1ab8
--- /dev/null
+++ b/clang/test/Driver/dxc_I.test
@@ -0,0 +1,4 @@
+// RUN: %clang_dxc -Tlib_6_3 -### %s 2>&1 | FileCheck %s
+
+// Make sure a non `.hlsl` file is considered an HLSL source file in dxc mode.
+// CHECK: "-x" "hlsl" "{{.*}}/dxc_I.test"
|
Changes the driver to assume input file with an unknown extension are HLSL source files instead of object files. Fixes llvm#137370
Changes the driver to assume input file with an unknown extension are HLSL source files instead of object files. Fixes llvm#137370
Changes the driver to assume input file with an unknown extension are HLSL source files instead of object files. Fixes llvm#137370
Changes the driver to assume input file with an unknown extension are HLSL source files instead of object files. Fixes llvm#137370
Changes the driver to assume input file with an unknown extension are HLSL source files instead of object files. Fixes llvm#137370
Changes the driver to assume input file with an unknown extension are
HLSL source files instead of object files.
Fixes #137370