[Lldb-commits] [lldb] [lldb] Remove Function null checks in Block.cpp (PR #137611)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 28 08:10:53 PDT 2025


labath wrote:

> > We can't change the signature of CalculateSymbolContextFunction as it's an abstract function (and some of its implementations can return nullptr)
> 
> By which you mean, because there are still use cases for `CalculateSymbolContextFunction` to return `nullptr`, so it must remain.

Correct. `CalculateSymbolContextFunction` is defined in the `SymbolContextScope` class, which is an interface for "things that can turn themselves into other things". So e.g. `CompileUnit::CalculateSymbolContextFunction` returns null because there's no mapping from a compile unit to a function (but there is a mapping from a function to a compile unit, so we could potentially make a non-fallible version of `Function::CalculateCompileUnit`).

https://github.com/llvm/llvm-project/pull/137611


More information about the lldb-commits mailing list