Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[clang][CodeGen] Add missing error check #81777

Merged
merged 1 commit into from
Feb 14, 2024
Merged

Conversation

lamb-j
Copy link
Contributor

@lamb-j lamb-j commented Feb 14, 2024

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

@llvmbot llvmbot added clang Clang issues not falling into any other category clang:codegen labels Feb 14, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Feb 14, 2024

@llvm/pr-subscribers-clang

@llvm/pr-subscribers-clang-codegen

Author: Jacob Lambert (lamb-j)

Changes

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


Full diff: https://github.com/llvm/llvm-project/pull/81777.diff

1 Files Affected:

  • (modified) clang/lib/CodeGen/CodeGenAction.cpp (+3)
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();

Copy link
Contributor

@jroelofs jroelofs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lamb-j lamb-j merged commit 7d28f19 into llvm:main Feb 14, 2024
6 of 7 checks passed
@lamb-j lamb-j deleted the relink-quick-fix branch February 14, 2024 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:codegen clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants