aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-profgen/ProfiledBinary.cpp
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2022-01-14 15:51:21 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2022-01-14 15:51:21 +0000
commitf4aa2a42edacda61563a33a355dbd9bb22644bf5 (patch)
tree039848f0c87ea1738d194eed88679f3f111b981b /llvm/tools/llvm-profgen/ProfiledBinary.cpp
parent9b72e0f9a2b92c6076262d5dfdaf33a89c7affa7 (diff)
downloadllvm-f4aa2a42edacda61563a33a355dbd9bb22644bf5.zip
llvm-f4aa2a42edacda61563a33a355dbd9bb22644bf5.tar.gz
llvm-f4aa2a42edacda61563a33a355dbd9bb22644bf5.tar.bz2
[llvm-profgen] ProfiledBinary::load - use cast<> instead of dyn_cast<> to avoid dereference of nullptr
The pointer is always dereferenced immediately, so assert the cast is correct instead of returning nullptr
Diffstat (limited to 'llvm/tools/llvm-profgen/ProfiledBinary.cpp')
-rw-r--r--llvm/tools/llvm-profgen/ProfiledBinary.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/tools/llvm-profgen/ProfiledBinary.cpp b/llvm/tools/llvm-profgen/ProfiledBinary.cpp
index aa4dd42..6dc0d260 100644
--- a/llvm/tools/llvm-profgen/ProfiledBinary.cpp
+++ b/llvm/tools/llvm-profgen/ProfiledBinary.cpp
@@ -206,7 +206,7 @@ void ProfiledBinary::load() {
decodePseudoProbe(Obj);
// Load debug info of subprograms from DWARF section.
- loadSymbolsFromDWARF(*dyn_cast<ObjectFile>(&Binary));
+ loadSymbolsFromDWARF(*cast<ObjectFile>(&Binary));
// Disassemble the text sections.
disassemble(Obj);