@@ -3117,22 +3117,18 @@ findFileInfo(clang::SourceLocation const loc)
31173117
31183118 // KRYSTIAN FIXME: we really should not be calling getPresumedLoc this often,
31193119 // it's quite expensive
3120- auto const presumed = source_.getPresumedLoc (loc, false );
3120+ auto const presumed = source_.getPresumedLoc (loc);
31213121 MRDOCS_CHECK_OR (!presumed.isInvalid (), nullptr );
31223122
3123- FileEntry const * entry = source_.getFileEntryForID ( presumed.getFileID ());
3124- MRDOCS_CHECK_OR (entry, nullptr );
3125-
3123+ FileID id = presumed.getFileID ();
31263124 // Find in the cache
3127- if (auto const it = files_.find (entry ); it != files_.end ())
3125+ if (auto const it = files_.find (id ); it != files_.end ())
31283126 {
31293127 return std::addressof (it->second );
31303128 }
31313129
3132- // Build FileInfo
3133- auto const FI = buildFileInfo (entry);
3134- MRDOCS_CHECK_OR (FI, nullptr );
3135- auto [it, inserted] = files_.try_emplace (entry, std::move (*FI));
3130+ auto [it, inserted] = files_.try_emplace (
3131+ id, buildFileInfo (presumed.getFilename ()));
31363132 return std::addressof (it->second );
31373133}
31383134
@@ -3148,15 +3144,6 @@ findFileInfo(Decl const* D)
31483144 return findFileInfo (Loc);
31493145}
31503146
3151- std::optional<ASTVisitor::FileInfo>
3152- ASTVisitor::
3153- buildFileInfo (FileEntry const * entry)
3154- {
3155- std::string_view const file_path = entry->tryGetRealPathName ();
3156- MRDOCS_CHECK_OR (!file_path.empty (), std::nullopt );
3157- return buildFileInfo (file_path);
3158- }
3159-
31603147ASTVisitor::FileInfo
31613148ASTVisitor::
31623149buildFileInfo (std::string_view const file_path)
0 commit comments