[llvm-profgen] Use cast<> instead of dyn_cast<> to avoid dereference of nullptr
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 2 Feb 2022 13:18:10 +0000 (13:18 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 2 Feb 2022 14:12:10 +0000 (14:12 +0000)
commitc56a85fde0d6568cb12858bcf1db93c3e590f5e3
tree22047ebdefec367db0b6d58f86990931a1152abe
parent9fd9d56dc6bdeeddf8cf2af834c6c39d00cd7244
[llvm-profgen] Use cast<> instead of dyn_cast<> to avoid dereference of nullptr

The pointers are dereferenced immediately, so assert the cast is correct instead of returning nullptr
llvm/tools/llvm-profgen/ProfiledBinary.cpp