Lines Matching refs:Path
128 std::error_code FileSystem::makeAbsolute(SmallVectorImpl<char> &Path) const { in makeAbsolute()
129 if (llvm::sys::path::is_absolute(Path)) in makeAbsolute()
136 llvm::sys::fs::make_absolute(WorkingDir.get(), Path); in makeAbsolute()
140 std::error_code FileSystem::getRealPath(const Twine &Path, in getRealPath() argument
145 std::error_code FileSystem::isLocal(const Twine &Path, bool &Result) { in isLocal() argument
149 bool FileSystem::exists(const Twine &Path) { in exists() argument
150 auto Status = status(Path); in exists()
163 static bool pathHasTraversal(StringRef Path) { in pathHasTraversal() argument
166 for (StringRef Comp : llvm::make_range(path::begin(Path), path::end(Path))) in pathHasTraversal()
204 void setPath(const Twine &Path) override;
240 void RealFile::setPath(const Twine &Path) { in setPath() argument
241 RealName = Path.str(); in setPath()
243 S = Status.get().copyWithNewName(Status.get(), Path); in setPath()
270 ErrorOr<Status> status(const Twine &Path) override;
271 ErrorOr<std::unique_ptr<File>> openFileForRead(const Twine &Path) override;
275 std::error_code setCurrentWorkingDirectory(const Twine &Path) override;
276 std::error_code isLocal(const Twine &Path, bool &Result) override;
277 std::error_code getRealPath(const Twine &Path,
287 Twine adjustPath(const Twine &Path, SmallVectorImpl<char> &Storage) const { in adjustPath() argument
289 return Path; in adjustPath()
290 Path.toVector(Storage); in adjustPath()
306 ErrorOr<Status> RealFileSystem::status(const Twine &Path) { in status() argument
310 sys::fs::status(adjustPath(Path, Storage), RealStatus)) in status()
312 return Status::copyWithNewName(RealStatus, Path); in status()
338 std::error_code RealFileSystem::setCurrentWorkingDirectory(const Twine &Path) { in setCurrentWorkingDirectory() argument
340 return llvm::sys::fs::set_current_path(Path); in setCurrentWorkingDirectory()
343 adjustPath(Path, Storage).toVector(Absolute); in setCurrentWorkingDirectory()
355 std::error_code RealFileSystem::isLocal(const Twine &Path, bool &Result) { in isLocal() argument
357 return llvm::sys::fs::is_local(adjustPath(Path, Storage), Result); in isLocal()
361 RealFileSystem::getRealPath(const Twine &Path, in getRealPath() argument
364 return llvm::sys::fs::real_path(adjustPath(Path, Storage), Output); in getRealPath()
393 RealFSDirIter(const Twine &Path, std::error_code &EC) : Iter(Path, EC) { in RealFSDirIter() argument
432 ErrorOr<Status> OverlayFileSystem::status(const Twine &Path) { in status() argument
435 ErrorOr<Status> Status = (*I)->status(Path); in status()
443 OverlayFileSystem::openFileForRead(const llvm::Twine &Path) { in openFileForRead() argument
446 auto Result = (*I)->openFileForRead(Path); in openFileForRead()
460 OverlayFileSystem::setCurrentWorkingDirectory(const Twine &Path) { in setCurrentWorkingDirectory() argument
462 if (std::error_code EC = FS->setCurrentWorkingDirectory(Path)) in setCurrentWorkingDirectory()
467 std::error_code OverlayFileSystem::isLocal(const Twine &Path, bool &Result) { in isLocal() argument
469 if (FS->exists(Path)) in isLocal()
470 return FS->isLocal(Path, Result); in isLocal()
475 OverlayFileSystem::getRealPath(const Twine &Path, in getRealPath() argument
478 if (FS->exists(Path)) in getRealPath()
479 return FS->getRealPath(Path, Output); in getRealPath()
654 InMemoryHardLink(StringRef Path, const InMemoryFile &ResolvedFile) in InMemoryHardLink() argument
655 : InMemoryNode(Path, IME_HardLink), ResolvedFile(ResolvedFile) {} in InMemoryHardLink()
677 InMemorySymbolicLink(StringRef Path, StringRef TargetPath, Status Stat) in InMemorySymbolicLink() argument
678 : InMemoryNode(Path, IME_SymbolicLink), TargetPath(std::move(TargetPath)), in InMemorySymbolicLink()
723 void setPath(const Twine &Path) override { RequestedName = Path.str(); } in setPath() argument
798 return Status(Path, UID, llvm::sys::toTimePoint(ModificationTime), User, in makeStatus()
823 SmallString<128> Path; in addFile() local
824 P.toVector(Path); in addFile()
827 std::error_code EC = makeAbsolute(Path); in addFile()
832 llvm::sys::path::remove_dots(Path, /*remove_dot_dot=*/true); in addFile()
834 if (Path.empty()) in addFile()
838 auto I = llvm::sys::path::begin(Path), E = sys::path::end(Path); in addFile()
854 Name, MakeNode({Dir->getUniqueID(), Path, Name, ModificationTime, in addFile()
862 StringRef(Path.str().begin(), Name.end() - Path.str().begin()), in addFile()
932 SmallString<128> Path; in lookupNode() local
933 P.toVector(Path); in lookupNode()
936 std::error_code EC = makeAbsolute(Path); in lookupNode()
941 llvm::sys::path::remove_dots(Path, /*remove_dot_dot=*/true); in lookupNode()
944 if (Path.empty()) in lookupNode()
945 return detail::NamedNodeOrError(Path, Dir); in lookupNode()
947 auto I = llvm::sys::path::begin(Path), E = llvm::sys::path::end(Path); in lookupNode()
958 return detail::NamedNodeOrError(Path, Symlink); in lookupNode()
987 return detail::NamedNodeOrError(Path, File); in lookupNode()
994 return detail::NamedNodeOrError(Path, &File->getResolvedFile()); in lookupNode()
1000 return detail::NamedNodeOrError(Path, Dir); in lookupNode()
1018 NNI.Path.str(), in addHardLink()
1043 llvm::ErrorOr<Status> InMemoryFileSystem::status(const Twine &Path) { in status() argument
1044 auto Node = lookupNode(Path, /*FollowFinalSymlink=*/true); in status()
1046 return (*Node)->getStatus(Path); in status()
1051 InMemoryFileSystem::openFileForRead(const Twine &Path) { in openFileForRead() argument
1052 auto Node = lookupNode(Path,/*FollowFinalSymlink=*/true); in openFileForRead()
1060 new detail::InMemoryFileAdaptor(*F, Path.str())); in openFileForRead()
1075 SmallString<256> Path(RequestedDirName); in setCurrentEntry() local
1076 llvm::sys::path::append(Path, I->second->getFileName()); in setCurrentEntry()
1088 FS->lookupNode(Path, /*FollowFinalSymlink=*/true)) { in setCurrentEntry()
1089 Path = SymlinkTarget.getName(); in setCurrentEntry()
1090 Type = (*SymlinkTarget)->getStatus(Path).getType(); in setCurrentEntry()
1094 CurrentEntry = directory_entry(std::string(Path), Type); in setCurrentEntry()
1137 SmallString<128> Path; in setCurrentWorkingDirectory() local
1138 P.toVector(Path); in setCurrentWorkingDirectory()
1141 std::error_code EC = makeAbsolute(Path); in setCurrentWorkingDirectory()
1146 llvm::sys::path::remove_dots(Path, /*remove_dot_dot=*/true); in setCurrentWorkingDirectory()
1148 if (!Path.empty()) in setCurrentWorkingDirectory()
1149 WorkingDirectory = std::string(Path); in setCurrentWorkingDirectory()
1154 InMemoryFileSystem::getRealPath(const Twine &Path, in getRealPath() argument
1159 Path.toVector(Output); in getRealPath()
1166 std::error_code InMemoryFileSystem::isLocal(const Twine &Path, bool &Result) { in isLocal() argument
1186 static llvm::sys::path::Style getExistingStyle(llvm::StringRef Path) { in getExistingStyle() argument
1189 const size_t n = Path.find_first_of("/\\"); in getExistingStyle()
1192 style = (Path[n] == '/') ? llvm::sys::path::Style::posix in getExistingStyle()
1198 static llvm::SmallString<256> canonicalize(llvm::StringRef Path) { in canonicalize() argument
1200 llvm::sys::path::Style style = getExistingStyle(Path); in canonicalize()
1205 llvm::sys::path::remove_leading_dotslash(Path, style); in canonicalize()
1264 const Twine &Path, RedirectingFileSystem::DirectoryEntry::iterator Begin, in RedirectingFSDirIterImpl() argument
1266 : Dir(Path.str()), Current(Begin), End(End) { in RedirectingFSDirIterImpl()
1322 RedirectingFileSystem::setCurrentWorkingDirectory(const Twine &Path) { in setCurrentWorkingDirectory() argument
1324 if (!exists(Path)) in setCurrentWorkingDirectory()
1328 Path.toVector(AbsolutePath); in setCurrentWorkingDirectory()
1337 SmallString<256> Path; in isLocal() local
1338 Path_.toVector(Path); in isLocal()
1340 if (makeCanonical(Path)) in isLocal()
1343 return ExternalFS->isLocal(Path, Result); in isLocal()
1346 std::error_code RedirectingFileSystem::makeAbsolute(SmallVectorImpl<char> &Path) const { in makeAbsolute()
1348 if (llvm::sys::path::is_absolute(Path, llvm::sys::path::Style::posix) || in makeAbsolute()
1349 llvm::sys::path::is_absolute(Path, in makeAbsolute()
1360 return makeAbsolute(WorkingDir.get(), Path); in makeAbsolute()
1365 SmallVectorImpl<char> &Path) const { in makeAbsolute()
1396 Result.append(Path.data(), Path.size()); in makeAbsolute()
1397 Path.assign(Result.begin(), Result.end()); in makeAbsolute()
1404 SmallString<256> Path; in dir_begin() local
1405 Dir.toVector(Path); in dir_begin()
1407 EC = makeCanonical(Path); in dir_begin()
1411 ErrorOr<RedirectingFileSystem::LookupResult> Result = lookupPath(Path); in dir_begin()
1415 return ExternalFS->dir_begin(Path, EC); in dir_begin()
1422 ErrorOr<Status> S = status(Path, Dir, *Result); in dir_begin()
1449 std::string(Path), RedirectIter)); in dir_begin()
1455 Path, DE->contents_begin(), DE->contents_end(), RedirectEC)); in dir_begin()
1472 directory_iterator ExternalIter = ExternalFS->dir_begin(Path, ExternalEC); in dir_begin()
2251 RedirectingFileSystem::makeCanonical(SmallVectorImpl<char> &Path) const { in makeCanonical()
2252 if (std::error_code EC = makeAbsolute(Path)) in makeCanonical()
2256 canonicalize(StringRef(Path.data(), Path.size())); in makeCanonical()
2260 Path.assign(CanonicalPath.begin(), CanonicalPath.end()); in makeCanonical()
2265 RedirectingFileSystem::lookupPath(StringRef Path) const { in lookupPath()
2266 sys::path::const_iterator Start = sys::path::begin(Path); in lookupPath()
2267 sys::path::const_iterator End = sys::path::end(Path); in lookupPath()
2434 void setPath(const Twine &Path) override { S = S.copyWithNewName(S, Path); } in setPath() argument
2580 SmallVectorImpl<StringRef> &Path, in getVFSEntries() argument
2588 Path.push_back(SubEntry->getName()); in getVFSEntries()
2589 getVFSEntries(SubEntry.get(), Path, Entries); in getVFSEntries()
2590 Path.pop_back(); in getVFSEntries()
2599 for (auto &Comp : Path) in getVFSEntries()
2610 for (auto &Comp : Path) in getVFSEntries()
2668 bool containedIn(StringRef Parent, StringRef Path);
2669 StringRef containedPart(StringRef Parent, StringRef Path);
2670 void startDirectory(StringRef Path);
2685 bool JSONWriter::containedIn(StringRef Parent, StringRef Path) { in containedIn() argument
2690 for (auto IChild = path::begin(Path), EChild = path::end(Path); in containedIn()
2699 StringRef JSONWriter::containedPart(StringRef Parent, StringRef Path) { in containedPart() argument
2701 assert(containedIn(Parent, Path)); in containedPart()
2702 return Path.slice(Parent.size() + 1, StringRef::npos); in containedPart()
2705 void JSONWriter::startDirectory(StringRef Path) { in startDirectory() argument
2707 DirStack.empty() ? Path : containedPart(DirStack.back(), Path); in startDirectory()
2708 DirStack.push_back(Path); in startDirectory()
2832 FileSystem &FS_, const Twine &Path, std::error_code &EC) in recursive_directory_iterator() argument
2834 directory_iterator I = FS->dir_begin(Path, EC); in recursive_directory_iterator()