aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 574514b..9ac522a 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -4107,6 +4107,14 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args,
if (const Arg *A = Args.getLastArg(OPT_frandomize_layout_seed_EQ))
Opts.RandstructSeed = A->getValue(0);
+ // Validate options for HLSL
+ if (Opts.HLSL) {
+ bool SupportedTarget = T.getArch() == llvm::Triple::dxil &&
+ T.getOS() == llvm::Triple::ShaderModel;
+ if (!SupportedTarget)
+ Diags.Report(diag::err_drv_hlsl_unsupported_target) << T.str();
+ }
+
return Diags.getNumErrors() == NumErrorsBefore;
}