[all-commits] [llvm/llvm-project] 6a79e2: [clang] Add FileEntryRef::getNameAsRequested()

Ben Langmuir via All-commits all-commits at lists.llvm.org
Wed Aug 3 09:41:35 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6a79e2ff1989b48f4a8ebf3ac51092eb8ad29e37
      https://github.com/llvm/llvm-project/commit/6a79e2ff1989b48f4a8ebf3ac51092eb8ad29e37
  Author: Ben Langmuir <blangmuir at apple.com>
  Date:   2022-08-03 (Wed, 03 Aug 2022)

  Changed paths:
    M clang/include/clang/Basic/FileEntry.h
    M clang/lib/Basic/FileManager.cpp
    M clang/unittests/Basic/FileEntryTest.cpp
    M clang/unittests/Basic/FileManagerTest.cpp

  Log Message:
  -----------
  [clang] Add FileEntryRef::getNameAsRequested()

As progress towards having FileManager::getFileRef() return the path
as-requested by default, return a FileEntryRef that can use
getNameAsRequested() to retrieve this path, with the ultimate goal that
this should be the behaviour of getName() and clients should explicitly
request the "external" name if they need to (see comment in
FileManager::getFileRef). For now, getName() continues to return the
external path by looking through the redirects.

For now, the new function is only used in unit tests.

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




More information about the All-commits mailing list