[all-commits] [llvm/llvm-project] 080952: Support: Remove duplicated code in {File, clang::Mo...

Duncan P. N. Exon Smith via All-commits all-commits at lists.llvm.org
Mon Jan 25 15:09:38 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 080952a9447a4819bdd08648e4ae8787aa72e6f3
      https://github.com/llvm/llvm-project/commit/080952a9447a4819bdd08648e4ae8787aa72e6f3
  Author: Duncan P. N. Exon Smith <dexonsmith at apple.com>
  Date:   2021-01-25 (Mon, 25 Jan 2021)

  Changed paths:
    M clang/include/clang/Frontend/Utils.h
    M clang/lib/Frontend/ModuleDependencyCollector.cpp
    M llvm/include/llvm/Support/FileCollector.h
    M llvm/lib/Support/FileCollector.cpp
    M llvm/unittests/Support/FileCollectorTest.cpp

  Log Message:
  -----------
  Support: Remove duplicated code in {File,clang::ModulesDependency}Collector, NFC

Refactor the duplicated canonicalize-path logic in `FileCollector` and
`ModulesDependencyCollector` into a new utility called
`PathCanonicalizer` that's shared. This popped up when tracking down a
bug common to both in https://reviews.llvm.org/D95202.

As drive-bys, update a few names and comments to better reflect the
effect of the code, delay removal of `..`s to avoid an unnecessary extra
string copy, and leave behind a couple of FIXMEs for future
consideration.

Differential Revision: https://reviews.llvm.org/D95279




More information about the All-commits mailing list