This is an archive of the discontinued LLVM Phabricator instance.

SourceManager: getFileEntryRefForID => getNonBuiltinFilenameForID, NFC
ClosedPublic

Authored by dexonsmith on Oct 15 2020, 4:00 PM.

Details

Summary

SourceManager::getFileEntryRefForID's remaining callers just want the
filename component, which is coming from the FileInfo. Replace the API
with getNonBuiltinFilenameForID, which also removes another use of
FileEntryRef::FileEntryRef outside of FileManager.

Both callers are collecting file dependencies, and one of them relied on
this API to filter out built-ins (as exposed by
clang/test/ClangScanDeps/modules-full.cpp). It seems nice to continue
providing that service.

Diff Detail

Event Timeline

dexonsmith created this revision.Oct 15 2020, 4:00 PM
dexonsmith added inline comments.Oct 15 2020, 4:14 PM
clang/lib/Basic/SourceManager.cpp
729–730

These ifs need to stay behind to detect whether the file is built-in.

JDevlieghere accepted this revision.Oct 21 2020, 10:50 PM
This revision is now accepted and ready to land.Oct 21 2020, 10:50 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 22 2020, 7:21 PM