The unwrap<Type> calls can assert with:
Assertion failed: (isa<X>(Val) && "cast<Ty>() argument of incompatible type!"), function cast
so replace them with dyn_cast.
Differential D60473
[LLVM-C] Use dyn_cast instead of unwrap in LLVMGetDebugLoc functions jberdine on Apr 9 2019, 10:38 AM. Authored by
Details The unwrap<Type> calls can assert with: Assertion failed: (isa<X>(Val) && "cast<Ty>() argument of incompatible type!"), function cast so replace them with dyn_cast.
Diff Detail
Event TimelineComment Actions So, these are going to be deprecated in D60484, but I see no harm in merging this patch, as it's a straightforward bugfix. Comment Actions @whitequark at least while D52239 and D60902 are up in the air, could I ask you to commit this fix for the existing functions? |