[clang] [clang][RISCV] Fix clang dwarf info generation for unprtototyped function (PR #150022)

Georgiy Samoylov via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 29 02:47:06 PDT 2025


https://github.com/sga-sc updated https://github.com/llvm/llvm-project/pull/150022

>From 765d83695bb45f501a06a83eaa13d048880dff5b Mon Sep 17 00:00:00 2001
From: Georgiy Samoylov <g.samoylov at syntacore.com>
Date: Tue, 29 Jul 2025 12:46:31 +0300
Subject: [PATCH] [DebugInfo] Changed way for getting callee function

---
 clang/lib/CodeGen/CGDebugInfo.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index a371b6755f74d..a266afc6d669d 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -4805,7 +4805,7 @@ void CGDebugInfo::EmitFuncDeclForCallSite(llvm::CallBase *CallOrInvoke,
                                           const FunctionDecl *CalleeDecl) {
   if (!CallOrInvoke)
     return;
-  auto *Func = CallOrInvoke->getCalledFunction();
+  auto *Func = dyn_cast_or_null<Function>(CallOrInvoke->getCalledOperand());
   if (!Func)
     return;
   if (Func->getSubprogram())



More information about the cfe-commits mailing list