[llvm] Add debuginfo C support for a SetType, Subrangetype, dynamic array type and replace arrays (PR #135607)

David Spickett via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 29 03:15:37 PDT 2025


DavidSpickett wrote:

Yes without any backtrace it's not great:
```
llvm-c-test: /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-bt7k7-1/llvm-project/github-pull-requests/llvm/include/llvm/Support/Casting.h:578: decltype(auto) llvm::cast(From *) [To = llvm::DIExpression, From = llvm::Metadata]: Assertion `isa<To>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
```
If you build locally you may be able to get the same error with a backtrace printed out as well. If it doesn't print out, attach a debugger to the test case and backtrace in there. You may need to add `-DLLVM_ENABLE_ASSERTIONS=ON` to your CMake config to get the assert to happen.

If you are using a debug build, then assertions are already enabled.

(https://www.llvm.org/docs/CMake.html#llvm-enable-assertions)

This assertion is to do with LLVM's own version of runtime type information, so something has tried to cast some object to type `To` when it is not that type. Of course it doesn't tell you what `To` is, but perhaps you can get that if you see how the program got to the assertion.

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


More information about the llvm-commits mailing list