[LLVM-C] Use dyn_cast instead of unwrap in LLVMGetDebugLoc functions
authorwhitequark <whitequark@whitequark.org>
Wed, 24 Apr 2019 13:30:03 +0000 (13:30 +0000)
committerwhitequark <whitequark@whitequark.org>
Wed, 24 Apr 2019 13:30:03 +0000 (13:30 +0000)
commit50392a3b1b84beea67bb294f6855d5fb1facd35e
tree92674af471cec2be760785175af827a21927be40
parentf96b6d927088db90286844a472d45a5ac9d3f3d6
[LLVM-C] Use dyn_cast instead of unwrap in LLVMGetDebugLoc functions

Summary:
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`.

Reviewers: whitequark, abdulras, hiraditya, compnerd

Reviewed By: whitequark

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D60473

llvm-svn: 359093
llvm/lib/IR/Core.cpp