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

Georgiy Samoylov via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 30 02:16:28 PDT 2025


sga-sc wrote:

Declaration with `!dbg` is emitted in case when we want to compile with optimizations and in some other cases: https://github.com/llvm/llvm-project/blob/0a8ddd396546bec7eaa4c3b7ef2f495e52bca0b8/clang/lib/CodeGen/CGDebugInfo.cpp#L6364-L6384 We call getCallSiteRelatedAttrs() function inside EmitFuncDeclForCallSite() https://github.com/llvm/llvm-project/blob/0a8ddd396546bec7eaa4c3b7ef2f495e52bca0b8/clang/lib/CodeGen/CGDebugInfo.cpp#L4817
So in this test I  sort through these options and check that necessary declarations exist. Also there is a difference between the declaration of `foo` for C and C++ and little a difference between RISCV64 and RISCV32. In that way we get 12 RUN commands.

https://github.com/llvm/llvm-project/pull/150022


More information about the cfe-commits mailing list