Skip to content

Commit

Permalink
[clang] NFCI: Use FileEntryRef::getName() in clangIndexSerialization
Browse files Browse the repository at this point in the history
The clangIndexSerialization target seems to be unused, so it didn't build when I ran `check-all` before landing d1f86c3. This should resolve the deprecation warning that caused some build bots to fail.
  • Loading branch information
jansvoboda11 committed Dec 6, 2023
1 parent 2f62037 commit f1c08ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class SerializablePathCollection {

/// Stores path to \p FE if it hasn't been stored yet.
/// \returns index to array exposed by getPathsBuffer().
size_t tryStoreFilePath(const clang::FileEntry &FE);
size_t tryStoreFilePath(FileEntryRef FE);

private:
/// Stores \p Path if it is non-empty.
Expand Down
6 changes: 3 additions & 3 deletions clang/lib/IndexSerialization/SerializablePathCollection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@ SerializablePathCollection::SerializablePathCollection(
SysRootPath(Paths.addDirPath(SysRoot)),
OutputFilePath(Paths.addDirPath(OutputFile)) {}

size_t SerializablePathCollection::tryStoreFilePath(const FileEntry &FE) {
auto FileIt = UniqueFiles.find(&FE);
size_t SerializablePathCollection::tryStoreFilePath(FileEntryRef FE) {
auto FileIt = UniqueFiles.find(FE);
if (FileIt != UniqueFiles.end())
return FileIt->second;

const auto Dir = tryStoreDirPath(sys::path::parent_path(FE.getName()));
const auto FileIdx =
Paths.addFilePath(Dir.Root, Dir.Path, sys::path::filename(FE.getName()));

UniqueFiles.try_emplace(&FE, FileIdx);
UniqueFiles.try_emplace(FE, FileIdx);
return FileIdx;
}

Expand Down

0 comments on commit f1c08ee

Please sign in to comment.