The change looks good with some future refactoring comment inline.
Unrelated to this change; it seems this should really be a callback into the Language plugin and not hardcoded in LLDB.
This is not a bad idea after all. Let me see if I can cook something reasonable without getting burned.
Ideally -- if we're able to make this a callback in the language plugins, we don't need this patch at all.
Not relevant anymore.