Revert "[ClangUserExpression][NFC] Removed unused code"
GetLanguageForExpr has side effects, so this actually breaks
the completion. Should fix TestExprCompletion.
llvm-svn: 341532
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
index 77fd681..048cef0 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
@@ -655,6 +655,10 @@
if (!PrepareForParsing(diagnostic_manager, exe_ctx))
return false;
+ lldb::LanguageType lang_type = lldb::LanguageType::eLanguageTypeUnknown;
+ if (auto new_lang = GetLanguageForExpr(diagnostic_manager, exe_ctx))
+ lang_type = new_lang.getValue();
+
if (log)
log->Printf("Parsing the following code:\n%s", m_transformed_text.c_str());