Lines Matching refs:path

46   return llvm::sys::path::is_style_posix(style);  in PathStyleIsPosix()
50 return llvm::sys::path::get_separator(style).data(); in GetPathSeparators()
57 void Denormalize(llvm::SmallVectorImpl<char> &path, FileSpec::Style style) { in Denormalize() argument
61 std::replace(path.begin(), path.end(), '/', '\\'); in Denormalize()
69 FileSpec::FileSpec(llvm::StringRef path, Style style) : m_style(style) { in FileSpec() argument
70 SetFile(path, style); in FileSpec()
73 FileSpec::FileSpec(llvm::StringRef path, const llvm::Triple &triple) in FileSpec() argument
74 : FileSpec{path, triple.isOSWindows() ? Style::windows : Style::posix} {} in FileSpec()
88 inline char safeCharAtIndex(const llvm::StringRef &path, size_t i) { in safeCharAtIndex() argument
89 if (i < path.size()) in safeCharAtIndex()
90 return path[i]; in safeCharAtIndex()
111 bool needsNormalization(const llvm::StringRef &path) { in needsNormalization() argument
112 if (path.empty()) in needsNormalization()
115 if (path[0] == '.') in needsNormalization()
117 for (auto i = path.find_first_of("\\/"); i != llvm::StringRef::npos; in needsNormalization()
118 i = path.find_first_of("\\/", i + 1)) { in needsNormalization()
119 const auto next = safeCharAtIndex(path, i+1); in needsNormalization()
135 const auto next_next = safeCharAtIndex(path, i+2); in needsNormalization()
143 const auto next_next_next = safeCharAtIndex(path, i+3); in needsNormalization()
185 llvm::sys::path::remove_dots(resolved, true, m_style); in SetFile()
201 llvm::StringRef filename = llvm::sys::path::filename(resolved, m_style); in SetFile()
205 llvm::StringRef directory = llvm::sys::path::parent_path(resolved, m_style); in SetFile()
210 void FileSpec::SetFile(llvm::StringRef path, const llvm::Triple &triple) { in SetFile() argument
211 return SetFile(path, triple.isOSWindows() ? Style::windows : Style::posix); in SetFile()
324 std::string path{GetPath(true)}; in Dump() local
325 s << path; in Dump()
327 if (!m_filename && !path.empty() && path.back() != path_separator) in Dump()
347 size_t FileSpec::GetPath(char *path, size_t path_max_len, in GetPath() argument
349 if (!path) in GetPath()
353 ::snprintf(path, path_max_len, "%s", result.c_str()); in GetPath()
367 void FileSpec::GetPath(llvm::SmallVectorImpl<char> &path, in GetPath() argument
369 path.append(m_directory.GetStringRef().begin(), in GetPath()
376 path.insert(path.end(), '/'); in GetPath()
377 path.append(m_filename.GetStringRef().begin(), in GetPath()
379 if (denormalize && !path.empty()) in GetPath()
380 Denormalize(path, m_style); in GetPath()
385 llvm::sys::path::extension(m_filename.GetStringRef(), m_style)); in GetFileNameExtension()
389 return ConstString(llvm::sys::path::stem(m_filename.GetStringRef(), m_style)); in GetFileNameStrippingExtension()
408 if (llvm::sys::path::has_parent_path(current_path, m_style)) in CopyByRemovingLastPathComponent()
409 return FileSpec(llvm::sys::path::parent_path(current_path, m_style), in CopyByRemovingLastPathComponent()
417 return ConstString(llvm::sys::path::filename(current_path, m_style)); in GetLastPathComponent()
424 llvm::sys::path::append(new_path, in PrependPathComponent()
425 llvm::sys::path::begin(current_path, m_style), in PrependPathComponent()
426 llvm::sys::path::end(current_path), m_style); in PrependPathComponent()
437 llvm::sys::path::append(current_path, m_style, component); in AppendPathComponent()
448 if (llvm::sys::path::has_parent_path(current_path, m_style)) { in RemoveLastPathComponent()
449 SetFile(llvm::sys::path::parent_path(current_path, m_style)); in RemoveLastPathComponent()
490 return llvm::sys::path::is_absolute(current_path, m_style); in IsAbsolute()