diff options
author | Chen Zheng <czhengsz@cn.ibm.com> | 2024-07-08 09:30:01 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-08 09:30:01 +0800 |
commit | afd0e6d06ba05cf3cd8b0bb91b6506242de78a4d (patch) | |
tree | 57a519d8b87a25239c3fa135fcdf0d7da2c823f4 /clang/include | |
parent | cc5ba739f27ab2f28d4a0f2e295d1e426aa836a7 (diff) | |
download | llvm-afd0e6d06ba05cf3cd8b0bb91b6506242de78a4d.zip llvm-afd0e6d06ba05cf3cd8b0bb91b6506242de78a4d.tar.gz llvm-afd0e6d06ba05cf3cd8b0bb91b6506242de78a4d.tar.bz2 |
[PowerPC] Diagnose musttail instead of crash inside backend (#93267)
musttail is not often possible to be generated on PPC targets as when
calling to a function defined in another module, PPC needs to restore
the TOC pointer. To restore the TOC pointer, compiler needs to emit a
nop after the call to let linker generate codes to restore TOC pointer.
Tail call cannot generate expected call sequence for this case.
To avoid the crash inside the compiler backend, a diagnosis is added in
the frontend.
Fixes #63214
Diffstat (limited to 'clang/include')
-rw-r--r-- | clang/include/clang/Basic/DiagnosticCommonKinds.td | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/include/clang/Basic/DiagnosticCommonKinds.td b/clang/include/clang/Basic/DiagnosticCommonKinds.td index de758cb..33b1d58 100644 --- a/clang/include/clang/Basic/DiagnosticCommonKinds.td +++ b/clang/include/clang/Basic/DiagnosticCommonKinds.td @@ -367,6 +367,15 @@ def warn_target_unrecognized_env : Warning< def err_target_unsupported_abi_with_fpu : Error< "'%0' ABI is not supported with FPU">; +def err_ppc_impossible_musttail: Error< + "'musttail' attribute for this call is impossible because %select{" + "long calls can not be tail called on PPC|" + "indirect calls can not be tail called on PPC|" + "external calls can not be tail called on PPC}0" + >; +def err_aix_musttail_unsupported: Error< + "'musttail' attribute is not supported on AIX">; + // Source manager def err_cannot_open_file : Error<"cannot open file '%0': %1">, DefaultFatal; def err_file_modified : Error< |