Lines Matching +full:capture +full:- +full:sd +full:- +full:lines
1 //===- ASTUnit.cpp - ASTUnit utility --------------------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 //===----------------------------------------------------------------------===//
125 Elapsed -= Start;
134 this->Output = Output.str();
155 /// Get a source buffer for \p MainFilePath, handling all file-to-file
156 /// and file-to-buffer remappings inside \p Invocation.
168 auto FileStatus = VFS->status(FilePath);
170 llvm::sys::fs::UniqueID MainFileID = FileStatus->getUniqueID();
172 // Check whether there is a file-file remapping of the main file
175 auto MPathStatus = VFS->status(MPath);
177 llvm::sys::fs::UniqueID MID = MPathStatus->getUniqueID();
180 BufferOwner = valueOrNull(VFS->getBufferForFile(RF.second, -1, true, isVolatile));
187 // Check whether there is a file-buffer remapping. It supercedes the
188 // file-file remapping.
191 auto MPathStatus = VFS->status(MPath);
193 llvm::sys::fs::UniqueID MID = MPathStatus->getUniqueID();
205 BufferOwner = valueOrNull(VFS->getBufferForFile(FilePath, -1, true, isVolatile));
214 return llvm::MemoryBuffer::getMemBufferCopy(Buffer->getBuffer(), FilePath);
253 getDiagnostics().getClient()->EndSourceFile();
263 PreprocessorOptions &PPOpts = Invocation->getPreprocessorOpts();
271 fprintf(stderr, "--- %u translation units\n", --ActiveASTUnitObjects);
275 this->PP = std::move(PP);
281 getDiagnostics().getClient()->BeginSourceFile(Ctx->getLangOpts(), PP.get());
284 /// Determine the set of code-completion contexts in which this
292 ND = ND->getUnderlyingDecl();
313 // In Objective-C, message sends can send interfaces. In Objective-C++,
318 // In Objective-C, you can only be a subclass of another Objective-C class
320 // Objective-C interfaces can be used in a class property expression.
321 if (ID->getDefinition())
331 // Part of the nested-name-specifier in C++0x.
335 if (Record->isUnion())
357 // Part of the nested-name-specifier.
379 TheSema->CodeCompletion().GatherGlobalCodeCompletions(
395 R.Declaration, Ctx->getLangOpts(), IsNestedNameSpecifier);
400 // Keep track of the type of this completion in an ASTContext-agnostic
408 = Ctx->getCanonicalType(UsageType.getUnqualifiedType());
413 // temporary, CanQualType-based hash table to find the associated value.
426 /// Handle nested-name-specifiers in C++.
427 if (TheSema->Context.getLangOpts().CPlusPlus && IsNestedNameSpecifier &&
429 // The contexts in which a nested-name-specifier can appear in C++.
451 // nested-name-specifier but isn't already an option, create a
452 // nested-name-specifier completion.
503 // Save the current top-level hash value.
566 this->HSOpts.ForceCheckCXX20ModulesInputFiles;
567 llvm::SaveAndRestore X(this->HSOpts.UserEntries);
568 llvm::SaveAndRestore Y(this->HSOpts.SystemHeaderPrefixes);
569 llvm::SaveAndRestore Z(this->HSOpts.VFSOverlayFiles);
571 this->HSOpts = HSOpts;
572 this->HSOpts.ForceCheckCXX20ModulesInputFiles =
583 this->HSOpts.UserEntries = HSOpts.UserEntries;
584 this->HSOpts.SystemHeaderPrefixes = HSOpts.SystemHeaderPrefixes;
585 this->HSOpts.VFSOverlayFiles = HSOpts.VFSOverlayFiles;
602 this->PPOpts = PPOpts;
612 this->TargetOpts = std::make_shared<TargetOptions>(TargetOpts);
614 TargetInfo::CreateTargetInfo(PP.getDiagnostics(), this->TargetOpts);
634 Target->adjust(PP.getDiagnostics(), LangOpt);
643 Context->InitBuiltinTypes(*Target);
646 Context->setPrintingPolicy(PrintingPolicy(LangOpt));
650 Context->getCommentCommandTraits().registerCommentOptions(
676 this->LangOpts = &LangOpts;
678 SourceMgr = &PP->getSourceManager();
686 /// there is no diagnostic client to capture them already.
746 StoredDiags->emplace_back(Level, Info);
747 ResultDiag = &StoredDiags->back();
756 StandaloneDiags->push_back(
768 return &WriterData->Writer;
774 return &WriterData->Writer;
781 auto Buffer = FileMgr->getBufferForFile(Filename, UserFilesAreVolatile);
795 Diags->setClient(new FilterAndStoreDiagnosticConsumer(
819 AST->LangOpts = LangOpts ? LangOpts : std::make_shared<LangOptions>();
820 AST->OnlyLocalDecls = OnlyLocalDecls;
821 AST->CaptureDiagnostics = CaptureDiagnostics;
822 AST->Diagnostics = Diags;
823 AST->FileMgr = new FileManager(FileSystemOpts, VFS);
824 AST->UserFilesAreVolatile = UserFilesAreVolatile;
825 AST->SourceMgr = new SourceManager(AST->getDiagnostics(),
826 AST->getFileManager(),
828 AST->ModuleCache = new InMemoryModuleCache;
829 AST->HSOpts = HSOpts ? HSOpts : std::make_shared<HeaderSearchOptions>();
830 AST->HSOpts->ModuleFormat = std::string(PCHContainerRdr.getFormats().front());
831 AST->HeaderInfo.reset(new HeaderSearch(AST->HSOpts,
832 AST->getSourceManager(),
833 AST->getDiagnostics(),
834 AST->getLangOpts(),
836 AST->PPOpts = std::make_shared<PreprocessorOptions>();
840 HeaderSearch &HeaderInfo = *AST->HeaderInfo;
842 AST->PP = std::make_shared<Preprocessor>(
843 AST->PPOpts, AST->getDiagnostics(), *AST->LangOpts,
844 AST->getSourceManager(), HeaderInfo, AST->ModuleLoader,
847 Preprocessor &PP = *AST->PP;
850 AST->Ctx = new ASTContext(*AST->LangOpts, AST->getSourceManager(),
853 AST->getTranslationUnitKind());
859 AST->Reader = new ASTReader(
860 PP, *AST->ModuleCache, AST->Ctx.get(), PCHContainerRdr, {},
865 AST->Reader->setListener(std::make_unique<ASTInfoCollector>(
866 *AST->PP, AST->Ctx.get(), *AST->HSOpts, *AST->PPOpts, *AST->LangOpts,
867 AST->TargetOpts, AST->Target, Counter));
873 // eagerly-deserialized declarations may use it.
874 if (AST->Ctx)
875 AST->Ctx->setExternalSource(AST->Reader);
877 switch (AST->Reader->ReadAST(Filename, serialization::MK_MainFile,
888 AST->getDiagnostics().Report(diag::err_fe_unable_to_load_pch);
892 AST->OriginalSourceFile = std::string(AST->Reader->getOriginalSourceFile());
896 Module *M = HeaderInfo.lookupModule(AST->getLangOpts().CurrentModule);
897 if (M && AST->getLangOpts().isCompilingModule() && M->isNamedModule())
898 AST->Ctx->setCurrentNamedModule(M);
902 AST->Consumer.reset(new ASTConsumer);
906 AST->TheSema.reset(new Sema(PP, *AST->Ctx, *AST->Consumer));
907 AST->TheSema->Initialize();
908 AST->Reader->InitializeSema(*AST->TheSema);
912 AST->getDiagnostics().getClient()->BeginSourceFile(PP.getLangOpts(), &PP);
917 /// Add the given macro to the hash of all top-level entities.
919 Hash = llvm::djbHash(MacroNameTok.getIdentifierInfo()->getName(), Hash);
940 /// Add the given declaration to the hash of all top-level entities.
945 DeclContext *DC = D->getDeclContext();
949 if (!(DC->isTranslationUnit() || DC->getLookupParent()->isTranslationUnit()))
955 // enter the top-level namespace.
956 if (!EnumD->isScoped()) {
957 for (const auto *EI : EnumD->enumerators()) {
958 if (EI->getIdentifier())
959 Hash = llvm::djbHash(EI->getIdentifier()->getName(), Hash);
964 if (ND->getIdentifier())
965 Hash = llvm::djbHash(ND->getIdentifier()->getName(), Hash);
966 else if (DeclarationName Name = ND->getDeclName()) {
974 if (const Module *Mod = ImportD->getImportedModule()) {
975 std::string ModName = Mod->getFullModuleName();
999 // reported as top-level declarations, even though their DeclContext
1014 for (auto *I : NSD->decls())
1078 // Invalid top-level decls may not have been serialized.
1079 if (D->isInvalidDecl())
1088 // reported as top-level declarations, even though their DeclContext
1130 for (auto &SD : StoredDiagnostics) {
1131 if (SD.getLocation().isValid()) {
1132 FullSourceLoc Loc(SD.getLocation(), SM);
1133 SD.setLocation(Loc);
1142 /// contain any translation-unit information, false otherwise.
1150 assert(VFS == &FileMgr->getVirtualFileSystem() &&
1157 Preamble->AddImplicitPreamble(*CCInvocation, VFS, OverrideMainBuffer.get());
1164 Clang->setInvocation(CCInvocation);
1182 if (VFS && FileMgr && &FileMgr->getVirtualFileSystem() == VFS)
1183 Clang->setFileManager(&*FileMgr);
1185 FileMgr = Clang->createFileManager(std::move(VFS));
1192 std::string(Clang->getFrontendOpts().Inputs[0].getFile());
1196 Clang->setDiagnostics(&getDiagnostics());
1199 if (!Clang->createTarget())
1202 assert(Clang->getFrontendOpts().Inputs.size() == 1 &&
1204 assert(Clang->getFrontendOpts().Inputs[0].getKind().getFormat() ==
1207 assert(Clang->getFrontendOpts().Inputs[0].getKind().getLanguage() !=
1212 LangOpts = Clang->getInvocation().LangOpts;
1213 FileSystemOpts = Clang->getFileSystemOpts();
1225 Clang->setSourceManager(&getSourceManager());
1248 if (!Act->BeginSourceFile(*Clang.get(), Clang->getFrontendOpts().Inputs[0]))
1257 if (llvm::Error Err = Act->Execute()) {
1264 Act->EndSourceFile();
1318 /// Attempt to build or re-use a precompiled preamble when (re-)parsing
1322 /// non-trivial preamble is found, it will precompile that preamble into a
1330 /// out-of-date.
1332 /// \param MaxLines When non-zero, the maximum number of lines that
1335 /// \returns If the precompiled preamble can be used, returns a newly-allocated
1358 if (Preamble->CanReuse(PreambleInvocationIn, *MainFileBuffer, Bounds,
1360 // Okay! We can re-use the precompiled preamble.
1384 --PreambleRebuildCountdown;
1400 std::optional<CaptureDroppedDiagnostics> Capture;
1402 Capture.emplace(CaptureDiagnostics, *Diagnostics, &NewPreambleDiags,
1455 // If the hash of top-level entities differs from the hash of the top-level
1472 serialization::ModuleFile &MF = Reader->getModuleManager().getPrimaryModule();
1476 if (Decl *D = Reader->GetLocalDecl(MF, TopLevelDecl))
1503 if (Invocation && !Invocation->getFrontendOpts().Inputs.empty()) {
1504 const FrontendInputFile &Input = Invocation->getFrontendOpts().Inputs[0];
1513 SourceMgr->getFileEntryRefForID(SourceMgr->getMainFileID()))
1514 return FE->getName();
1525 Mod = Reader->getModuleManager().getPrimaryModule();
1538 AST->Diagnostics = Diags;
1539 AST->FileSystemOpts = CI->getFileSystemOpts();
1540 AST->Invocation = std::move(CI);
1541 AST->FileMgr = new FileManager(AST->FileSystemOpts, VFS);
1542 AST->UserFilesAreVolatile = UserFilesAreVolatile;
1543 AST->SourceMgr = new SourceManager(AST->getDiagnostics(), *AST->FileMgr,
1545 AST->ModuleCache = new InMemoryModuleCache;
1572 CI->getHeaderSearchOpts().ResourceDir = std::string(ResourceFilesPath);
1574 AST->OnlyLocalDecls = OnlyLocalDecls;
1575 AST->CaptureDiagnostics = CaptureDiagnostics;
1577 AST->PreambleRebuildCountdown = PrecompilePreambleAfterNParses;
1578 AST->TUKind = Action ? Action->getTranslationUnitKind() : TU_Complete;
1579 AST->ShouldCacheCodeCompletionResults = CacheCodeCompletionResults;
1580 AST->IncludeBriefCommentsInCodeCompletion = false;
1590 CI->getPreprocessorOpts().RetainRemappedFileBuffers = true;
1591 CI->getFrontendOpts().DisableFree = false;
1592 ProcessWarningOptions(AST->getDiagnostics(), CI->getDiagnosticOpts());
1602 Clang->setInvocation(std::move(CI));
1603 AST->OriginalSourceFile =
1604 std::string(Clang->getFrontendOpts().Inputs[0].getFile());
1608 Clang->setDiagnostics(&AST->getDiagnostics());
1611 if (!Clang->createTarget())
1614 assert(Clang->getFrontendOpts().Inputs.size() == 1 &&
1616 assert(Clang->getFrontendOpts().Inputs[0].getKind().getFormat() ==
1619 assert(Clang->getFrontendOpts().Inputs[0].getKind().getLanguage() !=
1624 AST->TheSema.reset();
1625 AST->Ctx = nullptr;
1626 AST->PP = nullptr;
1627 AST->Reader = nullptr;
1630 Clang->setFileManager(&AST->getFileManager());
1633 Clang->setSourceManager(&AST->getSourceManager());
1647 if (!Act->BeginSourceFile(*Clang.get(), Clang->getFrontendOpts().Inputs[0])) {
1648 AST->transferASTDataFromCompilerInstance(*Clang);
1650 ErrAST->swap(OwnAST);
1656 Clang->getPreprocessor().addPPCallbacks(
1658 AST->getCurrentTopLevelHashValue()));
1660 if (Clang->hasASTConsumer())
1661 Consumers.push_back(Clang->takeASTConsumer());
1663 *AST, AST->getCurrentTopLevelHashValue()));
1664 Clang->setASTConsumer(
1667 if (llvm::Error Err = Act->Execute()) {
1669 AST->transferASTDataFromCompilerInstance(*Clang);
1671 ErrAST->swap(OwnAST);
1677 AST->transferASTDataFromCompilerInstance(*Clang);
1679 Act->EndSourceFile();
1697 Invocation->getPreprocessorOpts().RetainRemappedFileBuffers = true;
1698 Invocation->getFrontendOpts().DisableFree = false;
1700 ProcessWarningOptions(getDiagnostics(), Invocation->getDiagnosticOpts());
1708 ProcessWarningOptions(getDiagnostics(), Invocation->getDiagnosticOpts());
1732 AST->Diagnostics = Diags;
1733 AST->OnlyLocalDecls = OnlyLocalDecls;
1734 AST->CaptureDiagnostics = CaptureDiagnostics;
1735 AST->TUKind = TUKind;
1736 AST->ShouldCacheCodeCompletionResults = CacheCodeCompletionResults;
1737 AST->IncludeBriefCommentsInCodeCompletion
1739 AST->Invocation = std::move(CI);
1740 AST->FileSystemOpts = FileMgr->getFileSystemOpts();
1741 AST->FileMgr = FileMgr;
1742 AST->UserFilesAreVolatile = UserFilesAreVolatile;
1751 if (AST->LoadFromCompilerInvocation(std::move(PCHContainerOps),
1753 &AST->FileMgr->getVirtualFileSystem()))
1775 // If '-working-directory' was passed as an argument, 'createInvocation' will
1785 CaptureDroppedDiagnostics Capture(CaptureDiagnostics, *Diags,
1799 CI->getPreprocessorOpts().addRemappedFile(RemappedFile.first,
1802 PreprocessorOptions &PPOpts = CI->getPreprocessorOpts();
1809 CI->getHeaderSearchOpts().ResourceDir = std::string(ResourceFilesPath);
1811 CI->getFrontendOpts().SkipFunctionBodies =
1815 CI->getHeaderSearchOpts().ModuleFormat = std::string(*ModuleFormat);
1820 AST->NumStoredDiagnosticsFromDriver = StoredDiagnostics.size();
1821 AST->StoredDiagnostics.swap(StoredDiagnostics);
1823 AST->Diagnostics = Diags;
1824 AST->FileSystemOpts = CI->getFileSystemOpts();
1826 AST->FileMgr = new FileManager(AST->FileSystemOpts, VFS);
1827 AST->StorePreamblesInMemory = StorePreamblesInMemory;
1828 AST->PreambleStoragePath = PreambleStoragePath;
1829 AST->ModuleCache = new InMemoryModuleCache;
1830 AST->OnlyLocalDecls = OnlyLocalDecls;
1831 AST->CaptureDiagnostics = CaptureDiagnostics;
1832 AST->TUKind = TUKind;
1833 AST->ShouldCacheCodeCompletionResults = CacheCodeCompletionResults;
1834 AST->IncludeBriefCommentsInCodeCompletion
1836 AST->UserFilesAreVolatile = UserFilesAreVolatile;
1837 AST->Invocation = CI;
1838 AST->SkipFunctionBodies = SkipFunctionBodies;
1840 AST->WriterData.reset(new ASTWriterData(*AST->ModuleCache));
1849 if (AST->LoadFromCompilerInvocation(std::move(PCHContainerOps),
1855 AST->StoredDiagnostics.swap(AST->FailedParseDiagnostics);
1856 ErrAST->swap(AST);
1872 VFS = &FileMgr->getVirtualFileSystem();
1881 PreprocessorOptions &PPOpts = Invocation->getPreprocessorOpts();
1885 Invocation->getPreprocessorOpts().clearRemappedFiles();
1887 Invocation->getPreprocessorOpts().addRemappedFile(RemappedFile.first,
1901 ProcessWarningOptions(getDiagnostics(), Invocation->getDiagnosticOpts());
1909 // If we're caching global code-completion results, and the top-level
1910 // declarations have changed, clear out the code-completion cache.
1935 //----------------------------------------------------------------------------//
1937 //----------------------------------------------------------------------------//
1941 /// Code completion consumer that combines the cached code-completion
1942 /// results from an ASTUnit with the code-completion results provided to it,
2001 /// local code-completion results.
2064 = Results[I].Declaration->getUnderlyingDecl()->getIdentifierNamespace();
2081 DeclarationName Name = Results[I].Declaration->getDeclName();
2083 HiddenNames.insert(Identifier->getName());
2108 if ((C->ShowInContexts & InContexts) == 0)
2121 if (C->Kind != CXCursor_MacroDefinition &&
2122 HiddenNames.count(C->Completion->getTypedText()))
2126 unsigned Priority = C->Priority;
2127 CodeCompletionString *Completion = C->Completion;
2129 if (C->Kind == CXCursor_MacroDefinition) {
2130 Priority = getMacroUsagePriority(C->Completion->getTypedText(),
2132 Context.getPreferredType()->isAnyPointerType());
2133 } else if (C->Type) {
2138 if (ExpectedSTC == C->TypeClass) {
2144 if (Pos != CachedCompletionTypes.end() && Pos->second == C->Type)
2153 if (C->Kind == CXCursor_MacroDefinition &&
2155 // Create a new code-completion string that just contains the
2158 CCP_CodePattern, C->Availability);
2159 Builder.AddTypedTextChunk(C->Completion->getTypedText());
2164 AllResults.push_back(Result(Completion, Priority, C->Kind,
2165 C->Availability));
2198 FrontendOptions &FrontendOpts = CCInvocation->getFrontendOpts();
2200 PreprocessorOptions &PreprocessorOpts = CCInvocation->getPreprocessorOpts();
2210 assert(IncludeBriefComments == this->IncludeBriefCommentsInCodeCompletion);
2217 LangOpts = CCInvocation->getLangOpts();
2219 // Spell-checking and warnings are wasteful during code-completion.
2221 CCInvocation->getDiagnosticOpts().IgnoreWarnings = true;
2231 Clang->setInvocation(std::move(CCInvocation));
2233 std::string(Clang->getFrontendOpts().Inputs[0].getFile());
2236 Clang->setDiagnostics(&Diag);
2237 CaptureDroppedDiagnostics Capture(CaptureDiagsKind::All,
2238 Clang->getDiagnostics(),
2243 if (!Clang->createTarget()) {
2244 Clang->setInvocation(nullptr);
2248 assert(Clang->getFrontendOpts().Inputs.size() == 1 &&
2250 assert(Clang->getFrontendOpts().Inputs[0].getKind().getFormat() ==
2253 assert(Clang->getFrontendOpts().Inputs[0].getKind().getLanguage() !=
2258 Clang->setFileManager(&FileMgr);
2259 Clang->setSourceManager(&SourceMgr);
2270 // code-completion results.
2273 Clang->setCodeCompletionConsumer(AugmentedConsumer);
2276 [&FileMgr](StringRef Filename) -> std::optional<llvm::sys::fs::UniqueID> {
2278 return Status->getUniqueID();
2298 PCHContainerOps, Inv, &FileMgr.getVirtualFileSystem(), false, Line - 1);
2309 Preamble->AddImplicitPreamble(Clang->getInvocation(), VFS,
2313 // We use on-disk preambles instead and rely on FileMgr's VFS to ensure the
2322 if (!Clang->getLangOpts().Modules)
2328 if (Act->BeginSourceFile(*Clang.get(), Clang->getFrontendOpts().Inputs[0])) {
2329 if (llvm::Error Err = Act->Execute()) {
2332 Act->EndSourceFile();
2369 return serializeUnit(WriterData->Writer, WriterData->Buffer, getSema(), OS);
2385 // any associated source ranges, and the source ranges of associated fix-its.
2390 for (const auto &SD : Diags) {
2392 if (SD.Filename.empty())
2394 auto FE = FileMgr.getFile(SD.Filename);
2398 auto ItFileID = PreambleSrcLocCache.find(SD.Filename);
2402 PreambleSrcLocCache[SD.Filename] = FileLoc;
2404 FileLoc = ItFileID->getValue();
2409 SourceLocation L = FileLoc.getLocWithOffset(SD.LocOffset);
2413 Ranges.reserve(SD.Ranges.size());
2414 for (const auto &Range : SD.Ranges) {
2421 FixIts.reserve(SD.FixIts.size());
2422 for (const auto &FixIt : SD.FixIts) {
2431 Result.push_back(StoredDiagnostic(SD.Level, SD.ID,
2432 SD.Message, Loc, Ranges, FixIts));
2441 if (D->isFromASTFile())
2445 SourceLocation Loc = D->getLocation();
2449 // We only keep track of the file-level declarations of each file.
2450 if (!D->getLexicalDeclContext()->isFileContext())
2467 if (Decls->empty() || Decls->back().first <= Offset) {
2468 Decls->push_back(LocDecl);
2475 Decls->insert(I, LocDecl);
2483 if (SourceMgr->isLoadedFileID(File)) {
2484 assert(Ctx->getExternalSource() && "No external source!");
2485 return Ctx->getExternalSource()->FindFileRegionDecls(File, Offset, Length,
2493 LocDeclsTy &LocDecls = *I->second;
2502 --BeginIt;
2504 // If we are pointing at a top-level decl inside an objc container, we need
2508 BeginIt->second->isTopLevelDeclInObjCContainer())
2509 --BeginIt;
2518 Decls.push_back(DIt->second);
2541 PreambleID = SourceMgr->getPreambleFileID();
2547 if (SourceMgr->isInFileID(Loc, PreambleID, &Offs) && Offs < Preamble->getBounds().Size) {
2549 = SourceMgr->getLocForStartOfFile(SourceMgr->getMainFileID());
2562 PreambleID = SourceMgr->getPreambleFileID();
2568 if (SourceMgr->isInFileID(Loc, SourceMgr->getMainFileID(), &Offs) &&
2569 Offs < Preamble->getBounds().Size) {
2570 SourceLocation FileLoc = SourceMgr->getLocForStartOfFile(PreambleID);
2580 FID = SourceMgr->getPreambleFileID();
2585 return SourceMgr->isInFileID(Loc, FID);
2591 FID = SourceMgr->getMainFileID();
2596 return SourceMgr->isInFileID(Loc, FID);
2602 FID = SourceMgr->getPreambleFileID();
2607 return SourceMgr->getLocForEndOfFile(FID);
2613 FID = SourceMgr->getMainFileID();
2618 return SourceMgr->getLocForStartOfFile(FID);
2625 Mod = Reader->getModuleManager().getPrimaryModule();
2626 return Reader->getModulePreprocessedEntities(Mod);
2629 if (PreprocessingRecord *PPRec = PP->getPreprocessingRecord())
2630 return llvm::make_range(PPRec->local_begin(), PPRec->local_end());
2639 Mod = Reader->getModuleManager().getPrimaryModule();
2640 for (const auto *D : Reader->getModuleFileLevelDecls(Mod)) {
2663 Reader->getModuleManager().visit([&Mod](serialization::ModuleFile &M) {
2681 return Mod->File;
2725 bool acquired = static_cast<std::recursive_mutex *>(Mutex)->try_lock();
2730 static_cast<std::recursive_mutex *>(Mutex)->unlock();