[Lldb-commits] [PATCH] D97586: [mlir][lldb] Fix several gcc warnings in mlir and lldb
Raphael Isemann via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Mon Mar 1 01:24:33 PST 2021
teemperor added inline comments.
================
Comment at: lldb/source/Commands/CommandObjectTrace.cpp:119
lldb::TraceSP trace_sp = traceOrErr.get();
- if (m_options.m_verbose)
+ if (m_options.m_verbose && trace_sp)
result.AppendMessageWithFormat("loading trace with plugin %s\n",
----------------
Do you still have that GCC warning around (or the GCC version that produced that warning)? I'm kinda curious what GCC is assuming here. The interface never returns a "null" shared_ptr, the shared_ptr either contains a valid object or llvm::Error is returned. IIRC the Expected<ptr> return is the "new" version of how the Plugin interface should work (the old was just a ptr with `nullptr` being an error), so if some GCC version doesn't understand the Expected<ptr> pattern then we should maybe have some more centralized workaround instead of adding all the unnecessary nullptr checks.
But that shouldn't block this patch, so feel free to land.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D97586/new/
https://reviews.llvm.org/D97586
More information about the lldb-commits
mailing list