aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorXiang Li <python3kgae@outlook.com>2022-04-22 22:56:15 -0700
committerXiang Li <python3kgae@outlook.com>2022-08-04 16:54:19 -0700
commit8a27a2f89f83c55d352c001b3b308c35900cbdfc (patch)
treeaa5fcd61fa8a0c198af3298735e1bfe4236b044d /clang/lib/Frontend/CompilerInvocation.cpp
parent4982d8ac7694591d541492faac0f6d9091a18540 (diff)
downloadllvm-8a27a2f89f83c55d352c001b3b308c35900cbdfc.zip
llvm-8a27a2f89f83c55d352c001b3b308c35900cbdfc.tar.gz
llvm-8a27a2f89f83c55d352c001b3b308c35900cbdfc.tar.bz2
[HLSL] Support -E option for HLSL.
-E option will set entry function for hlsl. The format is -E entry_name. To avoid conflict with existing option with name 'E', add an extra prefix '--'. A new field HLSLEntry is added to TargetOption. To share code with HLSLShaderAttr, entry function will be add HLSLShaderAttr attribute too. Reviewed By: beanz Differential Revision: https://reviews.llvm.org/D124751
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 82dcc2a..7073828 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -510,6 +510,10 @@ static bool FixupInvocation(CompilerInvocation &Invocation,
Diags.Report(diag::err_drv_argument_not_allowed_with)
<< "-fgnu89-inline" << GetInputKindName(IK);
+ if (Args.hasArg(OPT_hlsl_entrypoint) && !LangOpts.HLSL)
+ Diags.Report(diag::err_drv_argument_not_allowed_with)
+ << "-hlsl-entry" << GetInputKindName(IK);
+
if (Args.hasArg(OPT_fgpu_allow_device_init) && !LangOpts.HIP)
Diags.Report(diag::warn_ignored_hip_only_option)
<< Args.getLastArg(OPT_fgpu_allow_device_init)->getAsString(Args);