Reland [ClangUserExpression][NFC] Removed unused code
authorRaphael Isemann <teemperor@gmail.com>
Thu, 6 Sep 2018 10:24:11 +0000 (10:24 +0000)
committerRaphael Isemann <teemperor@gmail.com>
Thu, 6 Sep 2018 10:24:11 +0000 (10:24 +0000)
The GetLanguageForExpr has side effects, so we can't remove this
call without breaking the completion mechanism. However, we can
keep the change that gets rid of this unnecessary variable.

llvm-svn: 341535

lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp

index 048cef0..7018a58 100644 (file)
@@ -655,9 +655,7 @@ bool ClangUserExpression::Complete(ExecutionContext &exe_ctx,
   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();
+  GetLanguageForExpr(diagnostic_manager, exe_ctx);
 
   if (log)
     log->Printf("Parsing the following code:\n%s", m_transformed_text.c_str());