[Lldb-commits] [lldb] r341535 - Reland [ClangUserExpression][NFC] Removed unused code

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Thu Sep 6 07:05:51 PDT 2018


Might be a good idea to add a comment in the code for this explaining the desired side effects?


> On Sep 6, 2018, at 3:24 AM, Raphael Isemann via lldb-commits <lldb-commits at lists.llvm.org> wrote:
> 
> Author: teemperor
> Date: Thu Sep  6 03:24:11 2018
> New Revision: 341535
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=341535&view=rev
> Log:
> Reland [ClangUserExpression][NFC] Removed unused code
> 
> 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.
> 
> Modified:
>    lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
> 
> Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp?rev=341535&r1=341534&r2=341535&view=diff
> ==============================================================================
> --- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp (original)
> +++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp Thu Sep  6 03:24:11 2018
> @@ -655,9 +655,7 @@ bool ClangUserExpression::Complete(Execu
>   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());
> 
> 
> _______________________________________________
> lldb-commits mailing list
> lldb-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits



More information about the lldb-commits mailing list