[all-commits] [llvm/llvm-project] e49c15: [lldb] Dynamically generate enum names in lldbutil
Dave Lee via All-commits
all-commits at lists.llvm.org
Sun Aug 7 11:16:07 PDT 2022
Author: Dave Lee <davelee.com at gmail.com>
Date: 2022-08-07 (Sun, 07 Aug 2022)
[lldb] Dynamically generate enum names in lldbutil
Change the `<enum>_to_str` functions in lldbutil to be dynamic.
Instead of a manually maintained if/elif switch, the functions now perform
lookup in a dynamically generated dict. The names are determined by stripping
the enum's prefix, and then lowercasing the remaining suffix, ex:
eStateRunning -> "running"
Differential Revision: https://reviews.llvm.org/D131138
More information about the All-commits