[Lldb-commits] [PATCH] D121967: [LLDB][NativePDB] Create inline function decls
Zequan Wu via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Mar 22 15:40:44 PDT 2022
zequanwu added a comment.
> I'd consider writing the live test case in c++ (with judicious use of always_inline, noinline, etc. attributes)
I think it's better to just add live test case on compiled `inline_sites.s` so the test result is not influenced by optimization change.
================
Comment at: lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp:1059
if (parent->isRecord()) {
- clang::QualType parent_qt = llvm::cast<clang::TypeDecl>(parent)
+ clang::QualType parent_qt = llvm::dyn_cast<clang::TypeDecl>(parent)
->getTypeForDecl()
----------------
labath wrote:
> What's the reason for this change? The only difference between cast and dyn_cast is that the former asserts in case of a bad cast, while the latter returns a nullptr. But here you're dereferencing the returned value anyway, and an assertion failure produces a better error message than a segfault.
Done. Probably modified accidentally.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D121967/new/
https://reviews.llvm.org/D121967
More information about the lldb-commits
mailing list