SourceManager: Change SourceManager::isMainFile to take a FileEntry, NFC
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Thu, 15 Oct 2020 22:32:34 +0000 (18:32 -0400)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 23 Oct 2020 01:32:28 +0000 (21:32 -0400)
commit168db92465c504974274302a6a1a5d4a1580ccfe
tree5350768359d06854b577e0d3f74bdd8a5346e011
parentb6c6daa95d3aa2206d5a42b46793226f181c3e44
SourceManager: Change SourceManager::isMainFile to take a FileEntry, NFC

`SourceManager::isMainFile` does not use the filename, so it doesn't
need the full `FileEntryRef`; in fact, it's misleading to take the name
because that makes it look relevant. Simplify the API, and in the
process remove some calls to `FileEntryRef::FileEntryRef` in the unit
tests (which were blocking making that private to `SourceManager`).

Differential Revision: https://reviews.llvm.org/D89507
clang/include/clang/Basic/SourceManager.h
clang/lib/Basic/SourceManager.cpp
clang/lib/Lex/PPDirectives.cpp
clang/unittests/Basic/SourceManagerTest.cpp