Skip to content

Commit 1d68e95

Browse files
committed
Refactor function reference marking in SemaExpr to consolidate Windows and COFF target checks under a single conditional
1 parent c704000 commit 1d68e95

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

clang/lib/Sema/SemaExpr.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19180,9 +19180,9 @@ void Sema::MarkFunctionReferenced(SourceLocation Loc, FunctionDecl *Func,
1918019180
UndefinedButUsed.insert(std::make_pair(Func->getCanonicalDecl(), Loc));
1918119181
else if (Func->getMostRecentDecl()->isInlined() && !LangOpts.GNUInline &&
1918219182
!Func->getMostRecentDecl()->hasAttr<GNUInlineAttr>()) {
19183-
#ifdef _WIN32
19184-
Func->getMostRecentDecl()->setImplicitlyInline(false);
19185-
#endif
19183+
const llvm::Triple &Triple = Context.getTargetInfo().getTriple();
19184+
if (Triple.isOSWindows() || Triple.isOSBinFormatCOFF())
19185+
Func->getMostRecentDecl()->setImplicitlyInline(false);
1918619186
UndefinedButUsed.insert(std::make_pair(Func->getCanonicalDecl(), Loc));
1918719187
}
1918819188
else if (isExternalWithNoLinkageType(Func))

0 commit comments

Comments
 (0)