summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp')
-rw-r--r--lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
index ebd2d5c1644..dfd3e0e6e83 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
@@ -583,15 +583,16 @@ ClangExpressionParser::ClangExpressionParser(
if (ClangModulesDeclVendor *decl_vendor =
target_sp->GetClangModulesDeclVendor()) {
- ClangPersistentVariables *clang_persistent_vars =
- llvm::cast<ClangPersistentVariables>(
+ if (auto *clang_persistent_vars = llvm::cast<ClangPersistentVariables>(
target_sp->GetPersistentExpressionStateForLanguage(
- lldb::eLanguageTypeC));
- std::unique_ptr<PPCallbacks> pp_callbacks(new LLDBPreprocessorCallbacks(
- *decl_vendor, *clang_persistent_vars, m_compiler->getSourceManager()));
- m_pp_callbacks =
- static_cast<LLDBPreprocessorCallbacks *>(pp_callbacks.get());
- m_compiler->getPreprocessor().addPPCallbacks(std::move(pp_callbacks));
+ lldb::eLanguageTypeC))) {
+ std::unique_ptr<PPCallbacks> pp_callbacks(
+ new LLDBPreprocessorCallbacks(*decl_vendor, *clang_persistent_vars,
+ m_compiler->getSourceManager()));
+ m_pp_callbacks =
+ static_cast<LLDBPreprocessorCallbacks *>(pp_callbacks.get());
+ m_compiler->getPreprocessor().addPPCallbacks(std::move(pp_callbacks));
+ }
}
// 8. Most of this we get from the CompilerInstance, but we also want to give
OpenPOWER on IntegriCloud