[PATCH] D107841: CodeGen: No need to check for isExternC if HasStrictReturn is already false

Arnold Schwaighofer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 11 07:44:28 PDT 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG9eb99d2e73b5: CodeGen: No need to check for isExternC if HasStrictReturn is already false (authored by aschwaighofer).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107841/new/

https://reviews.llvm.org/D107841

Files:
  clang/lib/CodeGen/CGCall.cpp


Index: clang/lib/CodeGen/CGCall.cpp
===================================================================
--- clang/lib/CodeGen/CGCall.cpp
+++ clang/lib/CodeGen/CGCall.cpp
@@ -2241,7 +2241,7 @@
   // C++ explicitly makes returning undefined values UB. C's rule only applies
   // to used values, so we never mark them noundef for now.
   bool HasStrictReturn = getLangOpts().CPlusPlus;
-  if (TargetDecl) {
+  if (TargetDecl && HasStrictReturn) {
     if (const FunctionDecl *FDecl = dyn_cast<FunctionDecl>(TargetDecl))
       HasStrictReturn &= !FDecl->isExternC();
     else if (const VarDecl *VDecl = dyn_cast<VarDecl>(TargetDecl))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107841.365758.patch
Type: text/x-patch
Size: 633 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210811/dd7e13ea/attachment.bin>


More information about the cfe-commits mailing list