aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/VirtualFileSystem.cpp
diff options
context:
space:
mode:
authorJan Svoboda <jan_svoboda@apple.com>2022-06-21 16:12:09 +0200
committerJan Svoboda <jan_svoboda@apple.com>2022-06-21 16:29:53 +0200
commit1ff5330ea358ad3401826806191011f885a2006d (patch)
treec0ee3a296dba962fa37ae253853ae9d393251220 /llvm/lib/Support/VirtualFileSystem.cpp
parentf1ee2738b3d70fea803ac1f3401c2fc9f61e514a (diff)
downloadllvm-1ff5330ea358ad3401826806191011f885a2006d.zip
llvm-1ff5330ea358ad3401826806191011f885a2006d.tar.gz
llvm-1ff5330ea358ad3401826806191011f885a2006d.tar.bz2
[llvm][vfs] NFC: Rename `InMemoryFileSystem::addHardLink()` arguments
Diffstat (limited to 'llvm/lib/Support/VirtualFileSystem.cpp')
-rw-r--r--llvm/lib/Support/VirtualFileSystem.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/llvm/lib/Support/VirtualFileSystem.cpp b/llvm/lib/Support/VirtualFileSystem.cpp
index d94554b..5267922 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<detail::InMemoryFile>(*ToNode))
+ if (!TargetNode || NewLinkNode || !isa<detail::InMemoryFile>(*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<detail::InMemoryHardLink>(
- NNI.Path.str(), *cast<detail::InMemoryFile>(*ToNode));
+ NNI.Path.str(),
+ *cast<detail::InMemoryFile>(*TargetNode));
});
}