================
@@ -743,6 +743,20 @@ bool Sema::checkMustTailAttr(const Stmt *St, const Attr 
&MTA) {
     CallerType.Func = CallerDecl->getType()->getAs<FunctionProtoType>();
   }
 
+  if (Context.getTargetInfo().getTriple().isPPC()) {
+    if (Context.getTargetInfo().getTriple().isOSAIX())
+      return Diag(St->getBeginLoc(), diag::err_aix_musttail_unsupported);
+    else if (!Context.getTargetInfo().hasFeature("pcrelative-memops")) {
+      if (Context.getTargetInfo().hasFeature("longcall"))
+        return Diag(St->getBeginLoc(), diag::err_ppc_impossible_musttail) << 0;
+      else if (!CE->getDirectCallee())
+        return Diag(St->getBeginLoc(), diag::err_ppc_impossible_musttail) << 1;
+      else if (isa_and_nonnull<FunctionDecl>(CE->getCalleeDecl()) &&
----------------
efriedma-quic wrote:

For the weak definitions, you can look at GVALinkage or something like that, 
yes.

For the ordering issue, you probably need to do the analysis at the end of the 
translation unit, or something like that.

https://github.com/llvm/llvm-project/pull/93267
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to