[llvm] [CodeGen] Skip declaration in ModuleToMachineFunctionPassAdaptor (PR #84417)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 8 01:38:16 PST 2024


================
@@ -79,7 +79,7 @@ ModuleToMachineFunctionPassAdaptor::run(Module &M, ModuleAnalysisManager &AM) {
   for (Function &F : M) {
     // Do not codegen any 'available_externally' functions at all, they have
     // definitions outside the translation unit.
-    if (F.hasAvailableExternallyLinkage())
+    if (F.hasAvailableExternallyLinkage() || F.isDeclaration())
----------------
arsenm wrote:

```suggestion
    if (F.isDeclaration() || F.hasAvailableExternallyLinkage())
```

https://github.com/llvm/llvm-project/pull/84417


More information about the llvm-commits mailing list