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()
173 static bool pathHasTraversal(StringRef Path) { in pathHasTraversal() argument
176 for (StringRef Comp : llvm::make_range(path::begin(Path), path::end(Path))) in pathHasTraversal()
214 void setPath(const Twine &Path) override;
250 void RealFile::setPath(const Twine &Path) { in setPath() argument
251 RealName = Path.str(); in setPath()
253 S = Status.get().copyWithNewName(Status.get(), Path); in setPath()
280 ErrorOr<Status> status(const Twine &Path) override;
281 ErrorOr<std::unique_ptr<File>> openFileForRead(const Twine &Path) override;
285 std::error_code setCurrentWorkingDirectory(const Twine &Path) override;
286 std::error_code isLocal(const Twine &Path, bool &Result) override;
287 std::error_code getRealPath(const Twine &Path,
297 Twine adjustPath(const Twine &Path, SmallVectorImpl<char> &Storage) const { in adjustPath() argument
299 return Path; in adjustPath()
300 Path.toVector(Storage); in adjustPath()
316 ErrorOr<Status> RealFileSystem::status(const Twine &Path) { in status() argument
320 sys::fs::status(adjustPath(Path, Storage), RealStatus)) in status()
322 return Status::copyWithNewName(RealStatus, Path); in status()
348 std::error_code RealFileSystem::setCurrentWorkingDirectory(const Twine &Path) { in setCurrentWorkingDirectory() argument
350 return llvm::sys::fs::set_current_path(Path); in setCurrentWorkingDirectory()
353 adjustPath(Path, Storage).toVector(Absolute); in setCurrentWorkingDirectory()
365 std::error_code RealFileSystem::isLocal(const Twine &Path, bool &Result) { in isLocal() argument
367 return llvm::sys::fs::is_local(adjustPath(Path, Storage), Result); in isLocal()
370 std::error_code RealFileSystem::getRealPath(const Twine &Path, in getRealPath() argument
373 return llvm::sys::fs::real_path(adjustPath(Path, Storage), Output); in getRealPath()
402 RealFSDirIter(const Twine &Path, std::error_code &EC) : Iter(Path, EC) { in RealFSDirIter() argument
441 ErrorOr<Status> OverlayFileSystem::status(const Twine &Path) { in status() argument
444 ErrorOr<Status> Status = (*I)->status(Path); in status()
451 bool OverlayFileSystem::exists(const Twine &Path) { in exists() argument
454 if ((*I)->exists(Path)) in exists()
461 OverlayFileSystem::openFileForRead(const llvm::Twine &Path) { in openFileForRead() argument
464 auto Result = (*I)->openFileForRead(Path); in openFileForRead()
478 OverlayFileSystem::setCurrentWorkingDirectory(const Twine &Path) { in setCurrentWorkingDirectory() argument
480 if (std::error_code EC = FS->setCurrentWorkingDirectory(Path)) in setCurrentWorkingDirectory()
485 std::error_code OverlayFileSystem::isLocal(const Twine &Path, bool &Result) { in isLocal() argument
487 if (FS->exists(Path)) in isLocal()
488 return FS->isLocal(Path, Result); in isLocal()
492 std::error_code OverlayFileSystem::getRealPath(const Twine &Path, in getRealPath() argument
495 if (FS->exists(Path)) in getRealPath()
496 return FS->getRealPath(Path, Output); in getRealPath()
678 InMemoryHardLink(StringRef Path, const InMemoryFile &ResolvedFile) in InMemoryHardLink() argument
679 : InMemoryNode(Path, IME_HardLink), ResolvedFile(ResolvedFile) {} in InMemoryHardLink()
701 InMemorySymbolicLink(StringRef Path, StringRef TargetPath, Status Stat) in InMemorySymbolicLink() argument
702 : InMemoryNode(Path, IME_SymbolicLink), TargetPath(std::move(TargetPath)), in InMemorySymbolicLink()
747 void setPath(const Twine &Path) override { RequestedName = Path.str(); } in setPath() argument
822 return Status(Path, UID, llvm::sys::toTimePoint(ModificationTime), User, in makeStatus()
847 SmallString<128> Path; in addFile() local
848 P.toVector(Path); in addFile()
851 std::error_code EC = makeAbsolute(Path); in addFile()
856 llvm::sys::path::remove_dots(Path, /*remove_dot_dot=*/true); in addFile()
858 if (Path.empty()) in addFile()
862 auto I = llvm::sys::path::begin(Path), E = sys::path::end(Path); in addFile()
881 StringRef(Path.str().begin(), Name.end() - Path.str().begin()), in addFile()
897 MakeNode({Dir->getUniqueID(), Path, Name, ModificationTime, in addFile()
957 SmallString<128> Path; in lookupNode() local
958 P.toVector(Path); in lookupNode()
961 std::error_code EC = makeAbsolute(Path); in lookupNode()
966 llvm::sys::path::remove_dots(Path, /*remove_dot_dot=*/true); in lookupNode()
969 if (Path.empty()) in lookupNode()
970 return detail::NamedNodeOrError(Path, Dir); in lookupNode()
972 auto I = llvm::sys::path::begin(Path), E = llvm::sys::path::end(Path); in lookupNode()
983 return detail::NamedNodeOrError(Path, Symlink); in lookupNode()
1012 return detail::NamedNodeOrError(Path, File); in lookupNode()
1019 return detail::NamedNodeOrError(Path, &File->getResolvedFile()); in lookupNode()
1025 return detail::NamedNodeOrError(Path, Dir); in lookupNode()
1043 NNI.Path.str(), in addHardLink()
1068 llvm::ErrorOr<Status> InMemoryFileSystem::status(const Twine &Path) { in status() argument
1069 auto Node = lookupNode(Path, /*FollowFinalSymlink=*/true); in status()
1071 return (*Node)->getStatus(Path); in status()
1076 InMemoryFileSystem::openFileForRead(const Twine &Path) { in openFileForRead() argument
1077 auto Node = lookupNode(Path,/*FollowFinalSymlink=*/true); in openFileForRead()
1085 new detail::InMemoryFileAdaptor(*F, Path.str())); in openFileForRead()
1100 SmallString<256> Path(RequestedDirName); in setCurrentEntry() local
1101 llvm::sys::path::append(Path, I->second->getFileName()); in setCurrentEntry()
1113 FS->lookupNode(Path, /*FollowFinalSymlink=*/true)) { in setCurrentEntry()
1114 Path = SymlinkTarget.getName(); in setCurrentEntry()
1115 Type = (*SymlinkTarget)->getStatus(Path).getType(); in setCurrentEntry()
1119 CurrentEntry = directory_entry(std::string(Path), Type); in setCurrentEntry()
1162 SmallString<128> Path; in setCurrentWorkingDirectory() local
1163 P.toVector(Path); in setCurrentWorkingDirectory()
1166 std::error_code EC = makeAbsolute(Path); in setCurrentWorkingDirectory()
1171 llvm::sys::path::remove_dots(Path, /*remove_dot_dot=*/true); in setCurrentWorkingDirectory()
1173 if (!Path.empty()) in setCurrentWorkingDirectory()
1174 WorkingDirectory = std::string(Path); in setCurrentWorkingDirectory()
1178 std::error_code InMemoryFileSystem::getRealPath(const Twine &Path, in getRealPath() argument
1183 Path.toVector(Output); in getRealPath()
1190 std::error_code InMemoryFileSystem::isLocal(const Twine &Path, bool &Result) { in isLocal() argument
1210 static llvm::sys::path::Style getExistingStyle(llvm::StringRef Path) { in getExistingStyle() argument
1213 const size_t n = Path.find_first_of("/\\"); in getExistingStyle()
1216 style = (Path[n] == '/') ? llvm::sys::path::Style::posix in getExistingStyle()
1222 static llvm::SmallString<256> canonicalize(llvm::StringRef Path) { in canonicalize() argument
1224 llvm::sys::path::Style style = getExistingStyle(Path); in canonicalize()
1229 llvm::sys::path::remove_leading_dotslash(Path, style); in canonicalize()
1288 const Twine &Path, RedirectingFileSystem::DirectoryEntry::iterator Begin, in RedirectingFSDirIterImpl() argument
1290 : Dir(Path.str()), Current(Begin), End(End) { in RedirectingFSDirIterImpl()
1346 RedirectingFileSystem::setCurrentWorkingDirectory(const Twine &Path) { in setCurrentWorkingDirectory() argument
1348 if (!exists(Path)) in setCurrentWorkingDirectory()
1352 Path.toVector(AbsolutePath); in setCurrentWorkingDirectory()
1361 SmallString<256> Path; in isLocal() local
1362 Path_.toVector(Path); in isLocal()
1364 if (makeAbsolute(Path)) in isLocal()
1367 return ExternalFS->isLocal(Path, Result); in isLocal()
1370 std::error_code RedirectingFileSystem::makeAbsolute(SmallVectorImpl<char> &Path) const { in makeAbsolute()
1372 if (llvm::sys::path::is_absolute(Path, llvm::sys::path::Style::posix) || in makeAbsolute()
1373 llvm::sys::path::is_absolute(Path, in makeAbsolute()
1384 return makeAbsolute(WorkingDir.get(), Path); in makeAbsolute()
1389 SmallVectorImpl<char> &Path) const { in makeAbsolute()
1420 Result.append(Path.data(), Path.size()); in makeAbsolute()
1421 Path.assign(Result.begin(), Result.end()); in makeAbsolute()
1428 SmallString<256> Path; in dir_begin() local
1429 Dir.toVector(Path); in dir_begin()
1431 EC = makeAbsolute(Path); in dir_begin()
1435 ErrorOr<RedirectingFileSystem::LookupResult> Result = lookupPath(Path); in dir_begin()
1439 return ExternalFS->dir_begin(Path, EC); in dir_begin()
1446 ErrorOr<Status> S = status(Path, Dir, *Result); in dir_begin()
1473 std::string(Path), RedirectIter)); in dir_begin()
1479 Path, DE->contents_begin(), DE->contents_end(), RedirectEC)); in dir_begin()
1496 directory_iterator ExternalIter = ExternalFS->dir_begin(Path, ExternalEC); in dir_begin()
2282 SmallVectorImpl<char> &Path) const { in makeCanonicalForLookup()
2283 if (std::error_code EC = makeAbsolute(Path)) in makeCanonicalForLookup()
2287 canonicalize(StringRef(Path.data(), Path.size())); in makeCanonicalForLookup()
2291 Path.assign(CanonicalPath.begin(), CanonicalPath.end()); in makeCanonicalForLookup()
2296 RedirectingFileSystem::lookupPath(StringRef Path) const { in lookupPath()
2297 llvm::SmallString<128> CanonicalPath(Path); in lookupPath()
2415 SmallString<256> Path; in status() local
2416 OriginalPath.toVector(Path); in status()
2418 if (std::error_code EC = makeAbsolute(Path)) in status()
2424 ErrorOr<Status> S = getExternalStatus(Path, OriginalPath); in status()
2429 ErrorOr<RedirectingFileSystem::LookupResult> Result = lookupPath(Path); in status()
2435 return getExternalStatus(Path, OriginalPath); in status()
2439 ErrorOr<Status> S = status(Path, OriginalPath, *Result); in status()
2445 return getExternalStatus(Path, OriginalPath); in status()
2452 SmallString<256> Path; in exists() local
2453 OriginalPath.toVector(Path); in exists()
2455 if (makeAbsolute(Path)) in exists()
2461 if (ExternalFS->exists(Path)) in exists()
2465 ErrorOr<RedirectingFileSystem::LookupResult> Result = lookupPath(Path); in exists()
2471 return ExternalFS->exists(Path); in exists()
2492 return ExternalFS->exists(Path); in exists()
2520 void setPath(const Twine &Path) override { S = S.copyWithNewName(S, Path); } in setPath() argument
2541 SmallString<256> Path; in openFileForRead() local
2542 OriginalPath.toVector(Path); in openFileForRead()
2544 if (std::error_code EC = makeAbsolute(Path)) in openFileForRead()
2550 auto F = File::getWithPath(ExternalFS->openFileForRead(Path), OriginalPath); in openFileForRead()
2555 ErrorOr<RedirectingFileSystem::LookupResult> Result = lookupPath(Path); in openFileForRead()
2561 return File::getWithPath(ExternalFS->openFileForRead(Path), OriginalPath); in openFileForRead()
2583 return File::getWithPath(ExternalFS->openFileForRead(Path), OriginalPath); in openFileForRead()
2603 SmallString<256> Path; in getRealPath() local
2604 OriginalPath.toVector(Path); in getRealPath()
2606 if (std::error_code EC = makeAbsolute(Path)) in getRealPath()
2612 std::error_code EC = ExternalFS->getRealPath(Path, Output); in getRealPath()
2617 ErrorOr<RedirectingFileSystem::LookupResult> Result = lookupPath(Path); in getRealPath()
2623 return ExternalFS->getRealPath(Path, Output); in getRealPath()
2636 return ExternalFS->getRealPath(Path, Output); in getRealPath()
2661 SmallVectorImpl<StringRef> &Path, in getVFSEntries() argument
2669 Path.push_back(SubEntry->getName()); in getVFSEntries()
2670 getVFSEntries(SubEntry.get(), Path, Entries); in getVFSEntries()
2671 Path.pop_back(); in getVFSEntries()
2680 for (auto &Comp : Path) in getVFSEntries()
2691 for (auto &Comp : Path) in getVFSEntries()
2749 bool containedIn(StringRef Parent, StringRef Path);
2750 StringRef containedPart(StringRef Parent, StringRef Path);
2751 void startDirectory(StringRef Path);
2766 bool JSONWriter::containedIn(StringRef Parent, StringRef Path) { in containedIn() argument
2771 for (auto IChild = path::begin(Path), EChild = path::end(Path); in containedIn()
2780 StringRef JSONWriter::containedPart(StringRef Parent, StringRef Path) { in containedPart() argument
2782 assert(containedIn(Parent, Path)); in containedPart()
2783 return Path.slice(Parent.size() + 1, StringRef::npos); in containedPart()
2786 void JSONWriter::startDirectory(StringRef Path) { in startDirectory() argument
2788 DirStack.empty() ? Path : containedPart(DirStack.back(), Path); in startDirectory()
2789 DirStack.push_back(Path); in startDirectory()
2911 FileSystem &FS_, const Twine &Path, std::error_code &EC) in recursive_directory_iterator() argument
2913 directory_iterator I = FS->dir_begin(Path, EC); in recursive_directory_iterator()