diff options
author | Aleksandr Bezzubikov <zuban32s@gmail.com> | 2023-08-12 19:59:08 -0700 |
---|---|---|
committer | Aleksandr Bezzubikov <zuban32s@gmail.com> | 2023-08-13 18:04:19 -0700 |
commit | a7a634aa2b5c815d18defc32fb837e079d96d1fc (patch) | |
tree | 480d15c41f18b7434ef55ebd4fd15a798957c886 /llvm/tools/llvm-objdump/llvm-objdump.cpp | |
parent | 1acbc21d46ba3f052471754bfa5860fba652e932 (diff) | |
download | llvm-a7a634aa2b5c815d18defc32fb837e079d96d1fc.zip llvm-a7a634aa2b5c815d18defc32fb837e079d96d1fc.tar.gz llvm-a7a634aa2b5c815d18defc32fb837e079d96d1fc.tar.bz2 |
[LLVM][Casting.h] Fix dyn_cast for std::unique_ptr.
Unlike isa<> and cast<>, current implementation of dyn_cast<> fails
to process a std::unique_ptr to a class supporting LLVM RTTI:
// A and B support LLVM RTTI
class A {...}
class B: public A {...}
void foo() {
...
auto V = std::make_unique<A>();
auto VB = dyn_cast<B>(std::move(V));
if (VB)
...
...
}
Reviewed By: lattner, bzcheeseman
Differential Revision: https://reviews.llvm.org/D147991
Diffstat (limited to 'llvm/tools/llvm-objdump/llvm-objdump.cpp')
0 files changed, 0 insertions, 0 deletions