[Lldb-commits] [PATCH] D17719: Track expression language from one place in ClangExpressionParser
Ewan Crawford via lldb-commits
lldb-commits at lists.llvm.org
Thu Mar 10 02:36:06 PST 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL263099: Track expression language from one place in ClangExpressionParser (authored by EwanCrawford).
Changed prior to commit:
http://reviews.llvm.org/D17719?vs=49531&id=50253#toc
Repository:
rL LLVM
http://reviews.llvm.org/D17719
Files:
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h
Index: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h
===================================================================
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h
@@ -129,6 +129,8 @@
class LLDBPreprocessorCallbacks;
LLDBPreprocessorCallbacks *m_pp_callbacks; ///< Called when the preprocessor encounters module imports
std::unique_ptr<ClangASTContext> m_ast_context;
+ lldb::LanguageType m_language; ///< The the source language of the expression
+ /// which may be explicitly set or inferred.
};
}
Index: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
===================================================================
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
@@ -157,7 +157,7 @@
// 1. Create a new compiler instance.
m_compiler.reset(new CompilerInstance());
- lldb::LanguageType frame_lang = expr.Language(); // defaults to lldb::eLanguageTypeUnknown
+ m_language = expr.Language(); // defaults to lldb::eLanguageTypeUnknown
bool overridden_target_opts = false;
lldb_private::LanguageRuntime *lang_rt = nullptr;
lldb::TargetSP target_sp;
@@ -176,14 +176,14 @@
// 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 && m_language == lldb::eLanguageTypeUnknown)
+ m_language = frame->GetLanguage();
- if (frame_lang != lldb::eLanguageTypeUnknown)
+ if (m_language != lldb::eLanguageTypeUnknown)
{
- lang_rt = exe_scope->CalculateProcess()->GetLanguageRuntime(frame_lang);
+ lang_rt = exe_scope->CalculateProcess()->GetLanguageRuntime(m_language);
if (log)
- log->Printf("Frame has language of type %s", Language::GetNameForLanguageType(frame_lang));
+ log->Printf("Frame has language of type %s", Language::GetNameForLanguageType(m_language));
}
// 2. Configure the compiler with a set of default options that are appropriate
@@ -263,9 +263,7 @@
assert (m_compiler->hasTarget());
// 5. Set language options.
- lldb::LanguageType language = expr.Language();
-
- switch (language)
+ switch (m_language)
{
case lldb::eLanguageTypeC:
case lldb::eLanguageTypeC89:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17719.50253.patch
Type: text/x-patch
Size: 2733 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160310/37678006/attachment-0001.bin>
More information about the lldb-commits
mailing list