aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/AST/ByteCode/Compiler.cpp
diff options
context:
space:
mode:
authorTimm Baeder <tbaeder@redhat.com>2025-05-13 11:11:47 +0200
committerGitHub <noreply@github.com>2025-05-13 11:11:47 +0200
commit83ce8a44bb7ec52a20fea1f2eb28c7756f46786b (patch)
tree0b90c55cf9821d084d42276c96dad60a9ea23c90 /clang/lib/AST/ByteCode/Compiler.cpp
parent6456ee056ff2ddce665df2032620207281fedaf8 (diff)
downloadllvm-83ce8a44bb7ec52a20fea1f2eb28c7756f46786b.zip
llvm-83ce8a44bb7ec52a20fea1f2eb28c7756f46786b.tar.gz
llvm-83ce8a44bb7ec52a20fea1f2eb28c7756f46786b.tar.bz2
[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.
Diffstat (limited to 'clang/lib/AST/ByteCode/Compiler.cpp')
-rw-r--r--clang/lib/AST/ByteCode/Compiler.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp
index 07e8712..c7fb5e8 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()) {