CodeGen: No need to check for isExternC if HasStrictReturn is already false

NFC intended.

Differential Revision: https://reviews.llvm.org/D107841
This commit is contained in:
Arnold Schwaighofer 2021-08-10 07:45:32 -07:00
parent c1ebefdf77
commit 9eb99d2e73
1 changed files with 1 additions and 1 deletions

View File

@ -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))