Skip to content

Commit

Permalink
Revert "[C++20] [Modules] Always emit the inline builtins"
Browse files Browse the repository at this point in the history
This reverts commit ca8a411.
This patch broke clang test on Windows x64 msvc
  • Loading branch information
zeroomega committed Jul 30, 2024
1 parent 3cc288a commit f86ce86
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 39 deletions.
10 changes: 5 additions & 5 deletions clang/lib/CodeGen/CodeGenModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4022,11 +4022,6 @@ bool CodeGenModule::shouldEmitFunction(GlobalDecl GD) {
return true;

const auto *F = cast<FunctionDecl>(GD.getDecl());
// Inline builtins declaration must be emitted. They often are fortified
// functions.
if (F->isInlineBuiltinDeclaration())
return true;

if (CodeGenOpts.OptimizationLevel == 0 && !F->hasAttr<AlwaysInlineAttr>())
return false;

Expand Down Expand Up @@ -4072,6 +4067,11 @@ bool CodeGenModule::shouldEmitFunction(GlobalDecl GD) {
}
}

// Inline builtins declaration must be emitted. They often are fortified
// functions.
if (F->isInlineBuiltinDeclaration())
return true;

// PR9614. Avoid cases where the source code is lying to us. An available
// externally function should have an equivalent function somewhere else,
// but a function that calls itself through asm label/`__builtin_` trickery is
Expand Down
34 changes: 0 additions & 34 deletions clang/test/Modules/inline-builtins.cppm

This file was deleted.

0 comments on commit f86ce86

Please sign in to comment.