https://github.com/lamb-j created 
https://github.com/llvm/llvm-project/pull/81777

Add missing error check. This resolves "error: variable 'Err' set but not used" 
warnings

>From b802c3456e44d5cc39ce6d5bf93fc549e38a7a12 Mon Sep 17 00:00:00 2001
From: Jacob Lambert <jacob.lamb...@amd.com>
Date: Wed, 14 Feb 2024 11:04:08 -0800
Subject: [PATCH] [clang][CodeGen] Add missing error check

---
 clang/lib/CodeGen/CodeGenAction.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/clang/lib/CodeGen/CodeGenAction.cpp 
b/clang/lib/CodeGen/CodeGenAction.cpp
index ab08a875e7e9c1..bb9aaba025fa59 100644
--- a/clang/lib/CodeGen/CodeGenAction.cpp
+++ b/clang/lib/CodeGen/CodeGenAction.cpp
@@ -291,6 +291,9 @@ bool BackendConsumer::LinkInModules(llvm::Module *M, bool 
ShouldLinkFiles) {
           });
     } else
       Err = Linker::linkModules(*M, std::move(LM.Module), LM.LinkFlags);
+
+    if (Err)
+      return true;
   }
 
   LinkModules.clear();

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to