[Lldb-commits] [PATCH] D15527: Add ability to override JIT expr compiler options.
Luke Drummond via lldb-commits
lldb-commits at lists.llvm.org
Thu Dec 24 13:03:36 PST 2015
ldrumm removed rL LLVM as the repository for this revision.
ldrumm updated this revision to Diff 43616.
ldrumm added a comment.
Updated implementation as per comment on manually set user language: http://reviews.llvm.org/D15527#inline-127860 . This patch adds checking for non eLanguageTypeUnknow expression language before falling back to the language of the current stack frame.
http://reviews.llvm.org/D15527
Files:
source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
Index: source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
===================================================================
--- source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
+++ source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
@@ -172,7 +172,7 @@
// 1. Create a new compiler instance.
m_compiler.reset(new CompilerInstance());
- lldb::LanguageType frame_lang = lldb::eLanguageTypeUnknown;
+ lldb::LanguageType frame_lang = expr.Language(); // defaults to lldb::eLanguageTypeUnknown
lldb_private::LanguageRuntime::OverrideExprOptions *target_opts_override = nullptr;
lldb_private::LanguageRuntime *lang_rt = nullptr;
lldb::TargetSP target_sp;
@@ -182,7 +182,10 @@
// If the expression is being evaluated in the context of an existing
// stack frame, we introspect to see if the language runtime is available.
auto frame = exe_scope->CalculateStackFrame();
- if (frame)
+
+ // Make sure the user hasn't provided a preferred execution language
+ // with `expression --language X -- ...`
+ if (frame && frame_lang == lldb::eLanguageTypeUnknown)
frame_lang = frame->GetLanguage();
if (frame_lang != lldb::eLanguageTypeUnknown)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15527.43616.patch
Type: text/x-patch
Size: 1246 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20151224/5f709a06/attachment.bin>
More information about the lldb-commits
mailing list