[clang] f18dd9e - Reapply "[Clang][Interp] `__builtin_os_log_format_buffer_size` should be an unevaluated builtin (#99895)"
Timm Bäder via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 23 02:57:59 PDT 2024
Author: Timm Bäder
Date: 2024-07-23T11:57:40+02:00
New Revision: f18dd9edec9c2135a8906d795258a8c5a24f74f3
URL: https://github.com/llvm/llvm-project/commit/f18dd9edec9c2135a8906d795258a8c5a24f74f3
DIFF: https://github.com/llvm/llvm-project/commit/f18dd9edec9c2135a8906d795258a8c5a24f74f3.diff
LOG: Reapply "[Clang][Interp] `__builtin_os_log_format_buffer_size` should be an unevaluated builtin (#99895)"
This reverts commit 5f05d5ec8f9bb15c0ac29fce843a2c73165ac414.
Reapply the original commit without the test. The memory leak is caused
by a well known problem in the new constant interpreter.
Added:
Modified:
clang/lib/AST/Interp/ByteCodeEmitter.cpp
Removed:
################################################################################
diff --git a/clang/lib/AST/Interp/ByteCodeEmitter.cpp b/clang/lib/AST/Interp/ByteCodeEmitter.cpp
index a3d4c7d7392da..fee4432a8f661 100644
--- a/clang/lib/AST/Interp/ByteCodeEmitter.cpp
+++ b/clang/lib/AST/Interp/ByteCodeEmitter.cpp
@@ -27,7 +27,8 @@ using namespace clang::interp;
/// Similar information is available via ASTContext::BuiltinInfo,
/// but that is not correct for our use cases.
static bool isUnevaluatedBuiltin(unsigned BuiltinID) {
- return BuiltinID == Builtin::BI__builtin_classify_type;
+ return BuiltinID == Builtin::BI__builtin_classify_type ||
+ BuiltinID == Builtin::BI__builtin_os_log_format_buffer_size;
}
Function *ByteCodeEmitter::compileFunc(const FunctionDecl *FuncDecl) {
More information about the cfe-commits
mailing list