[lldb/Interpreter] Fix language detection for the REPL InitFile
authorMed Ismail Bennani <medismail.bennani@gmail.com>
Thu, 3 Sep 2020 08:05:51 +0000 (10:05 +0200)
committerMed Ismail Bennani <medismail.bennani@gmail.com>
Thu, 3 Sep 2020 08:57:56 +0000 (10:57 +0200)
commitbf8f6e89c8d6fbac3e91ab37de7431d8e7c8aab4
treea3847cfaefd8ac5ad4f2c5e4c7779e54fb282621
parent5b354d204d0952a6dd39e41fb41b51414bff5f0b
[lldb/Interpreter] Fix language detection for the REPL InitFile

Previously, before loading the REPL language-specific init file, lldb
checked the selected target language in which case it returned an unknown
language type with the REPL target.

Instead, the patch calls `Language::GetLanguagesSupportingREPLs` and
look for the first element of that set. In case lldb was not configured
with a REPL language, then, it will just stop sourcing the REPL init
file and fallback to the original logic (continuing with the default
init file).

rdar://65836048

Differential Revision: https://reviews.llvm.org/D87076

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
lldb/source/Interpreter/CommandInterpreter.cpp