diff options
author | Timm Baeder <tbaeder@redhat.com> | 2025-05-13 11:11:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-13 11:11:47 +0200 |
commit | 83ce8a44bb7ec52a20fea1f2eb28c7756f46786b (patch) | |
tree | 0b90c55cf9821d084d42276c96dad60a9ea23c90 /clang/lib/AST/ByteCode/Compiler.cpp | |
parent | 6456ee056ff2ddce665df2032620207281fedaf8 (diff) | |
download | llvm-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.cpp | 9 |
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()) { |