From 1ff5330ea358ad3401826806191011f885a2006d Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Tue, 21 Jun 2022 16:12:09 +0200 Subject: [llvm][vfs] NFC: Rename `InMemoryFileSystem::addHardLink()` arguments --- llvm/lib/Support/VirtualFileSystem.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'llvm/lib/Support/VirtualFileSystem.cpp') diff --git a/llvm/lib/Support/VirtualFileSystem.cpp b/llvm/lib/Support/VirtualFileSystem.cpp index d94554bc1be9..526792281aa7 100644 --- a/llvm/lib/Support/VirtualFileSystem.cpp +++ b/llvm/lib/Support/VirtualFileSystem.cpp @@ -941,18 +941,19 @@ lookupInMemoryNode(const InMemoryFileSystem &FS, detail::InMemoryDirectory *Dir, } } -bool InMemoryFileSystem::addHardLink(const Twine &FromPath, - const Twine &ToPath) { - auto FromNode = lookupInMemoryNode(*this, Root.get(), FromPath); - auto ToNode = lookupInMemoryNode(*this, Root.get(), ToPath); +bool InMemoryFileSystem::addHardLink(const Twine &NewLink, + const Twine &Target) { + auto NewLinkNode = lookupInMemoryNode(*this, Root.get(), NewLink); + auto TargetNode = lookupInMemoryNode(*this, Root.get(), Target); // FromPath must not have been added before. ToPath must have been added // before. Resolved ToPath must be a File. - if (!ToNode || FromNode || !isa(*ToNode)) + if (!TargetNode || NewLinkNode || !isa(*TargetNode)) return false; - return addFile(FromPath, 0, nullptr, None, None, None, None, + return addFile(NewLink, 0, nullptr, None, None, None, None, [&](detail::NewInMemoryNodeInfo NNI) { return std::make_unique( - NNI.Path.str(), *cast(*ToNode)); + NNI.Path.str(), + *cast(*TargetNode)); }); } -- cgit v1.2.3