================
@@ -1577,15 +1577,28 @@ void CodeGenModule::Release() {
     } else if (getTriple().isMIPS()) {
       for (auto &I : MustTailCallUndefinedGlobals) {
         const FunctionDecl *FD = I.first;
-        const FunctionDecl *Definition = FD->getDefinition();
-        if (!Definition) {
-          getDiags().Report(I.second, diag::err_mips_impossible_musttail) << 1;
+        StringRef MangledName = getMangledName(GlobalDecl(FD));
+        llvm::GlobalValue *Entry = GetGlobalValue(MangledName);
+
+        if (!Entry) {
+          Visibility Vis = FD->getVisibility();
+          if (Vis == DefaultVisibility)
+            getDiags().Report(I.second, diag::err_mips_impossible_musttail)
+                << 1;
           continue;
         }
-        llvm::GlobalValue::LinkageTypes Linkage =
-            getFunctionLinkage(GlobalDecl(Definition));
-        if (!llvm::GlobalValue::isLocalLinkage(Linkage) &&
-            Definition->isExternallyVisible())
+
+        bool CalleeIsLocal;
+        if (Entry->isDeclarationForLinker()) {
+          bool HasLocalLinkage = Entry->hasLocalLinkage();
----------------
efriedma-quic wrote:

How can a declaration have local linkage?  If you try to declare something with 
local linkage without defining it, that should independently be an error.

https://github.com/llvm/llvm-project/pull/161860
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to