Skip to content

Commit f86ce86

Browse files
committed
Revert "[C++20] [Modules] Always emit the inline builtins"
This reverts commit ca8a411. This patch broke clang test on Windows x64 msvc
1 parent 3cc288a commit f86ce86

File tree

2 files changed

+5
-39
lines changed

2 files changed

+5
-39
lines changed

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4022,11 +4022,6 @@ bool CodeGenModule::shouldEmitFunction(GlobalDecl GD) {
40224022
return true;
40234023

40244024
const auto *F = cast<FunctionDecl>(GD.getDecl());
4025-
// Inline builtins declaration must be emitted. They often are fortified
4026-
// functions.
4027-
if (F->isInlineBuiltinDeclaration())
4028-
return true;
4029-
40304025
if (CodeGenOpts.OptimizationLevel == 0 && !F->hasAttr<AlwaysInlineAttr>())
40314026
return false;
40324027

@@ -4072,6 +4067,11 @@ bool CodeGenModule::shouldEmitFunction(GlobalDecl GD) {
40724067
}
40734068
}
40744069

4070+
// Inline builtins declaration must be emitted. They often are fortified
4071+
// functions.
4072+
if (F->isInlineBuiltinDeclaration())
4073+
return true;
4074+
40754075
// PR9614. Avoid cases where the source code is lying to us. An available
40764076
// externally function should have an equivalent function somewhere else,
40774077
// but a function that calls itself through asm label/`__builtin_` trickery is

clang/test/Modules/inline-builtins.cppm

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)