diff options
author | Haowei Wu <haowei@google.com> | 2024-07-30 12:14:04 -0700 |
---|---|---|
committer | Haowei Wu <haowei@google.com> | 2024-07-30 12:27:58 -0700 |
commit | f86ce8675f74a6b8937f99e3562fbcae51fd1f2f (patch) | |
tree | 7007ab71a48a9bfe627ab9f41cfdb5b07f670de1 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 3cc288afedd6b9954dd0b5aa28dc6cc5fedee2c2 (diff) | |
download | llvm-f86ce8675f74a6b8937f99e3562fbcae51fd1f2f.zip llvm-f86ce8675f74a6b8937f99e3562fbcae51fd1f2f.tar.gz llvm-f86ce8675f74a6b8937f99e3562fbcae51fd1f2f.tar.bz2 |
Revert "[C++20] [Modules] Always emit the inline builtins"
This reverts commit ca8a4111f796fe8533e0af95557875b15becff06.
This patch broke clang test on Windows x64 msvc
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 5a575c5..344a0e5 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -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; @@ -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 |