Lines Matching full:path

25   // We must normalize our path pairs that we store because if we don't then
28 // We would store a path pairs of "." and "/tmp" as raw strings. If the debug
29 // info contains "./foo/bar.c", the path will get normalized to "foo/bar.c".
30 // When PathMappingList::RemapPath() is called, it expects the path to start
31 // with the raw path pair, which doesn't work anymore because the paths have
33 // nomalized path pairs to ensure things match up.
34 std::string NormalizePath(llvm::StringRef path) { in NormalizePath() argument
35 // If we use "path" to construct a FileSpec, it will normalize the path for in NormalizePath()
37 return FileSpec(path).GetPath(); in NormalizePath()
61 void PathMappingList::Append(llvm::StringRef path, llvm::StringRef replacement, in Append() argument
64 m_pairs.emplace_back(pair(NormalizePath(path), NormalizePath(replacement))); in Append()
80 bool PathMappingList::AppendUnique(llvm::StringRef path, in AppendUnique() argument
82 auto normalized_path = NormalizePath(path); in AppendUnique()
89 Append(path, replacement, notify); in AppendUnique()
93 void PathMappingList::Insert(llvm::StringRef path, llvm::StringRef replacement, in Insert() argument
101 m_pairs.emplace(insert_iter, pair(NormalizePath(path), in Insert()
107 bool PathMappingList::Replace(llvm::StringRef path, llvm::StringRef replacement, in Replace() argument
112 m_pairs[index] = pair(NormalizePath(path), NormalizePath(replacement)); in Replace()
166 bool PathMappingList::RemapPath(ConstString path, in RemapPath() argument
168 if (std::optional<FileSpec> remapped = RemapPath(path.GetStringRef())) { in RemapPath()
175 /// Append components to path, applying style.
176 static void AppendPathComponents(FileSpec &path, llvm::StringRef components, in AppendPathComponents() argument
177 llvm::sys::path::Style style) { in AppendPathComponents()
178 auto component = llvm::sys::path::begin(components, style); in AppendPathComponents()
179 auto e = llvm::sys::path::end(components); in AppendPathComponents()
181 llvm::sys::path::is_separator(*component->data(), style)) in AppendPathComponents()
184 path.AppendPathComponent(*component); in AppendPathComponents()
197 llvm::StringRef path = mapping_path; in RemapPath() local
198 if (!path.consume_front(prefix)) { in RemapPath()
200 // only thing in the relative path so we need to work around "." in RemapPath()
204 // We need to figure out if the "path" argument is relative. If it is, in RemapPath()
208 FileSpec(path).IsRelative() ? eLazyBoolYes : eLazyBoolNo; in RemapPath()
215 llvm::sys::path::Style::native); in RemapPath()
216 AppendPathComponents(remapped, path, orig_style); in RemapPath()
225 std::string path = file.GetPath(); in ReverseRemapPath() local
226 llvm::StringRef path_ref(path); in ReverseRemapPath()
233 llvm::sys::path::Style::native); in ReverseRemapPath()
243 // We must normalize the orig_spec again using the host's path style, in FindFile()
245 // if they use different path styles. in FindFile()
253 bool PathMappingList::Replace(llvm::StringRef path, llvm::StringRef new_path, in Replace() argument
255 uint32_t idx = FindIndexForPath(path); in Replace()
266 bool PathMappingList::Remove(ConstString path, bool notify) { in Remove() argument
267 iterator pos = FindIteratorForPath(path); in Remove()
279 PathMappingList::FindIteratorForPath(ConstString path) const { in FindIteratorForPath()
285 if (pos->first == path) in FindIteratorForPath()
292 PathMappingList::FindIteratorForPath(ConstString path) { in FindIteratorForPath() argument
298 if (pos->first == path) in FindIteratorForPath()
304 bool PathMappingList::GetPathsAtIndex(uint32_t idx, ConstString &path, in GetPathsAtIndex() argument
307 path = m_pairs[idx].first; in GetPathsAtIndex()
315 const ConstString path = ConstString(NormalizePath(orig_path)); in FindIndexForPath() local
321 if (pos->first == path) in FindIndexForPath()