================ @@ -92,16 +92,10 @@ bool Preprocessor::EnterSourceFile(FileID FID, ConstSearchDirIterator CurDir, } Lexer *TheLexer = new Lexer(FID, *InputFile, *this, IsFirstIncludeOfFile); - if (getPreprocessorOpts().DependencyDirectivesForFile && - FID != PredefinesFileID) { - if (OptionalFileEntryRef File = SourceMgr.getFileEntryRefForID(FID)) { - if (std::optional<ArrayRef<dependency_directives_scan::Directive>> - DepDirectives = - getPreprocessorOpts().DependencyDirectivesForFile(*File)) { - TheLexer->DepDirectives = *DepDirectives; - } - } - } + if (GetDependencyDirectives && FID != PredefinesFileID) + if (OptionalFileEntryRef File = SourceMgr.getFileEntryRefForID(FID)) + if (auto MaybeDepDirectives = GetDependencyDirectives(FileMgr, *File)) ---------------- jansvoboda11 wrote:
Done in the latest commit, let me know if you think it's an improvement. https://github.com/llvm/llvm-project/pull/136178 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits