[all-commits] [llvm/llvm-project] 168db9: SourceManager: Change SourceManager::isMainFile to...

Duncan P. N. Exon Smith via All-commits all-commits at lists.llvm.org
Thu Oct 22 18:36:59 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 168db92465c504974274302a6a1a5d4a1580ccfe
      https://github.com/llvm/llvm-project/commit/168db92465c504974274302a6a1a5d4a1580ccfe
  Author: Duncan P. N. Exon Smith <dexonsmith at apple.com>
  Date:   2020-10-22 (Thu, 22 Oct 2020)

  Changed paths:
    M clang/include/clang/Basic/SourceManager.h
    M clang/lib/Basic/SourceManager.cpp
    M clang/lib/Lex/PPDirectives.cpp
    M clang/unittests/Basic/SourceManagerTest.cpp

  Log Message:
  -----------
  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




More information about the All-commits mailing list