[clang] 83ce8a4 - [clang][bytecode] Get BuiltinID from the direct callee (#139675)
via cfe-commits
cfe-commits at lists.llvm.org
Tue May 13 02:11:50 PDT 2025
Author: Timm Baeder
Date: 2025-05-13T11:11:47+02:00
New Revision: 83ce8a44bb7ec52a20fea1f2eb28c7756f46786b
URL: https://github.com/llvm/llvm-project/commit/83ce8a44bb7ec52a20fea1f2eb28c7756f46786b
DIFF: https://github.com/llvm/llvm-project/commit/83ce8a44bb7ec52a20fea1f2eb28c7756f46786b.diff
LOG: [clang][bytecode] Get BuiltinID from the direct callee (#139675)
getBuiltinCallee() just checks the direct callee for its builtin id
anyway, so let's do this ourselves.
Added:
Modified:
clang/lib/AST/ByteCode/Compiler.cpp
Removed:
################################################################################
diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp
index 07e8712d41b64..c7fb5e8466686 100644
--- a/clang/lib/AST/ByteCode/Compiler.cpp
+++ b/clang/lib/AST/ByteCode/Compiler.cpp
@@ -4874,10 +4874,13 @@ bool Compiler<Emitter>::VisitBuiltinCallExpr(const CallExpr *E,
template <class Emitter>
bool Compiler<Emitter>::VisitCallExpr(const CallExpr *E) {
- if (unsigned BuiltinID = E->getBuiltinCallee())
- return VisitBuiltinCallExpr(E, BuiltinID);
-
const FunctionDecl *FuncDecl = E->getDirectCallee();
+
+ if (FuncDecl) {
+ if (unsigned BuiltinID = FuncDecl->getBuiltinID())
+ return VisitBuiltinCallExpr(E, BuiltinID);
+ }
+
// Calls to replaceable operator new/operator delete.
if (FuncDecl &&
FuncDecl->isUsableAsGlobalAllocationFunctionInConstantEvaluation()) {
More information about the cfe-commits
mailing list