Author: Arnold Schwaighofer Date: 2021-08-11T07:42:48-07:00 New Revision: 9eb99d2e73b5598076fbdd8abceb3549afa8f0ae
URL: https://github.com/llvm/llvm-project/commit/9eb99d2e73b5598076fbdd8abceb3549afa8f0ae DIFF: https://github.com/llvm/llvm-project/commit/9eb99d2e73b5598076fbdd8abceb3549afa8f0ae.diff LOG: CodeGen: No need to check for isExternC if HasStrictReturn is already false NFC intended. Differential Revision: https://reviews.llvm.org/D107841 Added: Modified: clang/lib/CodeGen/CGCall.cpp Removed: ################################################################################ diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index 1296dfa18b9a5..43be6755a0745 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -2241,7 +2241,7 @@ void CodeGenModule::ConstructAttributeList(StringRef Name, // 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)) _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits