diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp @@ -1073,8 +1073,8 @@ if (file.Write(expr_text, bytes_written).Success()) { if (bytes_written == expr_text_len) { file.Close(); - if (auto fileEntry = - m_compiler->getFileManager().getFile(result_path)) { + if (auto fileEntry = m_compiler->getFileManager().getOptionalFileRef( + result_path)) { source_mgr.setMainFileID(source_mgr.createFileID( *fileEntry, SourceLocation(), SrcMgr::C_User));