llvm-project/lldb/source
Konrad Kleine c671639af6 [lldb] NFC: refactor CompileUnit::ResolveSymbolContext
Summary:
I found the above named method hard to read because it had

a) many nested blocks,
b) one return statement at the end with some logic involved,
c) a duplicated while-loop with just small differences in it.

I decided to refactor this function by employing an early exit strategy.
In order to capture the logic in the return statement and to not have it
repeated more than once I chose to implement a very small lamda function
that captures all the variables it needs.
I also replaced the two while-loops with just one.

This is a non-functional change (NFC).

Reviewers: jdoerfert, teemperor

Reviewed By: teemperor

Subscribers: labath, teemperor, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D70774
2019-11-28 21:37:31 +01:00
..
API [lldb] NFC: refactor CompileUnit::ResolveSymbolContext 2019-11-28 21:37:31 +01:00
Breakpoint Modernize the rest of the Find.* API (NFC) 2019-10-17 19:56:40 +00:00
Commands [LLDB] Fix wrong argument in CommandObjectThreadStepWithTypeAndScope 2019-11-28 14:00:56 -05:00
Core [lldb] NFC: refactor CompileUnit::ResolveSymbolContext 2019-11-28 21:37:31 +01:00
DataFormatters Simplify condition (NFC) 2019-10-01 17:08:38 +00:00
Expression [lldb] remove unsigned Stream::operator<< overloads 2019-11-26 14:24:28 +01:00
Host [-gmodules] Let LLDB log a warning if the Clang module hash mismatches. 2019-11-15 11:52:13 -08:00
Initialization [Reproducer] Use ::rtrim() to remove trailing control characters. 2019-10-18 17:11:48 +00:00
Interpreter [lldb][NFC] Give some parameters in CommandInterpreter more descriptive names 2019-11-05 09:21:10 +01:00
Plugins [lldb][NFC] Remove unused variable in ClangASTSource::CompleteType 2019-11-28 15:32:56 +01:00
Symbol [lldb] NFC: refactor CompileUnit::ResolveSymbolContext 2019-11-28 21:37:31 +01:00
Target [lldb][NFC] Allow range-based for-loops on VariableList 2019-11-25 15:03:46 +01:00
Utility [LLDB] On Windows, force error message formatting to English 2019-11-28 14:15:13 -05:00
CMakeLists.txt [CMake] Remove Apple-specific version logic. 2019-04-17 18:23:22 +00:00
lldb.cpp [CMake] Remove Apple-specific version logic. 2019-04-17 18:23:22 +00:00