forked from OSchip/llvm-project
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:
parent
c1ebefdf77
commit
9eb99d2e73
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue