Differential D79752 Diff 266389 lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
Changeset View
Changeset View
Standalone View
Standalone View
lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
Show First 20 Lines • Show All 609 Lines • ▼ Show 20 Lines | ClangExpressionParser::ClangExpressionParser( | ||||
m_compiler->getDiagnostics().setClient(diag_mgr); | m_compiler->getDiagnostics().setClient(diag_mgr); | ||||
// 7. Set up the source management objects inside the compiler | // 7. Set up the source management objects inside the compiler | ||||
m_compiler->createFileManager(); | m_compiler->createFileManager(); | ||||
if (!m_compiler->hasSourceManager()) | if (!m_compiler->hasSourceManager()) | ||||
m_compiler->createSourceManager(m_compiler->getFileManager()); | m_compiler->createSourceManager(m_compiler->getFileManager()); | ||||
m_compiler->createPreprocessor(TU_Complete); | m_compiler->createPreprocessor(TU_Complete); | ||||
if (ClangModulesDeclVendor *decl_vendor = | |||||
target_sp->GetClangModulesDeclVendor()) { | |||||
if (auto *clang_persistent_vars = llvm::cast<ClangPersistentVariables>( | if (auto *clang_persistent_vars = llvm::cast<ClangPersistentVariables>( | ||||
target_sp->GetPersistentExpressionStateForLanguage( | target_sp->GetPersistentExpressionStateForLanguage( | ||||
lldb::eLanguageTypeC))) { | lldb::eLanguageTypeC))) { | ||||
if (std::shared_ptr<ClangModulesDeclVendor> decl_vendor = | |||||
clang_persistent_vars->GetClangModulesDeclVendor()) { | |||||
std::unique_ptr<PPCallbacks> pp_callbacks( | std::unique_ptr<PPCallbacks> pp_callbacks( | ||||
new LLDBPreprocessorCallbacks(*decl_vendor, *clang_persistent_vars, | new LLDBPreprocessorCallbacks(*decl_vendor, *clang_persistent_vars, | ||||
m_compiler->getSourceManager())); | m_compiler->getSourceManager())); | ||||
m_pp_callbacks = | m_pp_callbacks = | ||||
static_cast<LLDBPreprocessorCallbacks *>(pp_callbacks.get()); | static_cast<LLDBPreprocessorCallbacks *>(pp_callbacks.get()); | ||||
m_compiler->getPreprocessor().addPPCallbacks(std::move(pp_callbacks)); | m_compiler->getPreprocessor().addPPCallbacks(std::move(pp_callbacks)); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 794 Lines • Show Last 20 Lines |