[lldb] Deduplicate copy-pasted TypeSystemMap::GetTypeSystemForLanguage
authorRaphael Isemann <teemperor@gmail.com>
Fri, 14 Aug 2020 09:48:14 +0000 (11:48 +0200)
committerRaphael Isemann <teemperor@gmail.com>
Fri, 14 Aug 2020 09:58:54 +0000 (11:58 +0200)
commitf974d64b372c5554783369bab901de8f4dee5e02
tree4b328184edafaef148912fe686404d17f5b17a4c
parent397b3cc9e5aa949fcaaff7743a76e889d29b723c
[lldb] Deduplicate copy-pasted TypeSystemMap::GetTypeSystemForLanguage

There are two implementations for `TypeSystemMap::GetTypeSystemForLanguage`
which are both identical beside one taking a `Module` and one taking a `Target`
(and then passing that argument to the `TypeSystem::CreateInstance` function).

This merges both implementations into one function with a lambda that wraps the
different calls to `TypeSystem::CreateInstance`.

Reviewed By: #lldb, JDevlieghere

Differential Revision: https://reviews.llvm.org/D82537
lldb/include/lldb/Symbol/TypeSystem.h
lldb/source/Symbol/TypeSystem.cpp