summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ExpressionParser
diff options
context:
space:
mode:
authorEwan Crawford <ewan@codeplay.com>2016-03-10 12:38:55 +0000
committerEwan Crawford <ewan@codeplay.com>2016-03-10 12:38:55 +0000
commit7648dd375fd8dfc9f4468b2bf29ebc784837078d (patch)
tree3a32f496bd2502240db95cf88f90be8a4f1b7981 /lldb/source/Plugins/ExpressionParser
parent721447c8732c0ffb986c95731f8b17cfacf59682 (diff)
downloadbcm5719-llvm-7648dd375fd8dfc9f4468b2bf29ebc784837078d.tar.gz
bcm5719-llvm-7648dd375fd8dfc9f4468b2bf29ebc784837078d.zip
Revert "Track expression language from one place in ClangExpressionParser"
r263099 seems to have broken some OSX tests llvm-svn: 263107
Diffstat (limited to 'lldb/source/Plugins/ExpressionParser')
-rw-r--r--lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp16
-rw-r--r--lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h2
2 files changed, 9 insertions, 9 deletions
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
index c84b825126c..d91fb7a443b 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
@@ -157,7 +157,7 @@ ClangExpressionParser::ClangExpressionParser (ExecutionContextScope *exe_scope,
// 1. Create a new compiler instance.
m_compiler.reset(new CompilerInstance());
- m_language = expr.Language(); // defaults to lldb::eLanguageTypeUnknown
+ lldb::LanguageType frame_lang = 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 @@ ClangExpressionParser::ClangExpressionParser (ExecutionContextScope *exe_scope,
// Make sure the user hasn't provided a preferred execution language
// with `expression --language X -- ...`
- if (frame && m_language == lldb::eLanguageTypeUnknown)
- m_language = frame->GetLanguage();
+ if (frame && frame_lang == lldb::eLanguageTypeUnknown)
+ frame_lang = frame->GetLanguage();
- if (m_language != lldb::eLanguageTypeUnknown)
+ if (frame_lang != lldb::eLanguageTypeUnknown)
{
- lang_rt = exe_scope->CalculateProcess()->GetLanguageRuntime(m_language);
+ lang_rt = exe_scope->CalculateProcess()->GetLanguageRuntime(frame_lang);
if (log)
- log->Printf("Frame has language of type %s", Language::GetNameForLanguageType(m_language));
+ log->Printf("Frame has language of type %s", Language::GetNameForLanguageType(frame_lang));
}
// 2. Configure the compiler with a set of default options that are appropriate
@@ -263,7 +263,9 @@ ClangExpressionParser::ClangExpressionParser (ExecutionContextScope *exe_scope,
assert (m_compiler->hasTarget());
// 5. Set language options.
- switch (m_language)
+ lldb::LanguageType language = expr.Language();
+
+ switch (language)
{
case lldb::eLanguageTypeC:
case lldb::eLanguageTypeC89:
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h
index 288be8df470..3c055380b83 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h
@@ -129,8 +129,6 @@ private:
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.
};
}
OpenPOWER on IntegriCloud