LLVM 23.0.0git
Path.h
Go to the documentation of this file.
1//===- llvm/Support/Path.h - Path Operating System Concept ------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file declares the llvm::sys::path namespace. It is designed after
10// TR2/boost filesystem (v3), but modified to remove exception handling and the
11// path class.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_SUPPORT_PATH_H
16#define LLVM_SUPPORT_PATH_H
17
18#include "llvm/ADT/Twine.h"
19#include "llvm/ADT/iterator.h"
22#include <iterator>
23
24namespace llvm {
25namespace sys {
26namespace path {
27
35
36/// Check if \p S uses POSIX path rules.
37constexpr bool is_style_posix(Style S) {
38 if (S == Style::posix)
39 return true;
40 if (S != Style::native)
41 return false;
42#if defined(_WIN32)
43 return false;
44#else
45 return true;
46#endif
47}
48
49/// Check if \p S uses Windows path rules.
50constexpr bool is_style_windows(Style S) { return !is_style_posix(S); }
51
52/// @name Lexical Component Iterator
53/// @{
54
55/// Path iterator.
56///
57/// This is an input iterator that iterates over the individual components in
58/// \a path. The traversal order is as follows:
59/// * The root-name element, if present.
60/// * The root-directory element, if present.
61/// * Each successive filename element, if present.
62/// * Dot, if one or more trailing non-root slash characters are present.
63/// Traversing backwards is possible with \a reverse_iterator
64///
65/// Iteration examples. Each component is separated by ',':
66/// @code
67/// / => /
68/// /foo => /,foo
69/// foo/ => foo,.
70/// /foo/bar => /,foo,bar
71/// ../ => ..,.
72/// C:\foo\bar => C:,\,foo,bar
73/// @endcode
75 : public iterator_facade_base<const_iterator, std::input_iterator_tag,
76 const StringRef> {
77 StringRef Path; ///< The entire path.
78 StringRef Component; ///< The current component. Not necessarily in Path.
79 size_t Position = 0; ///< The iterators current position within Path.
80 Style S = Style::native; ///< The path style to use.
81
82 // An end iterator has Position = Path.size() + 1.
85
86public:
87 reference operator*() const { return Component; }
88 LLVM_ABI const_iterator &operator++(); // preincrement
89 LLVM_ABI bool operator==(const const_iterator &RHS) const;
90
91 /// Difference in bytes between this and RHS.
93};
94
95/// Reverse path iterator.
96///
97/// This is an input iterator that iterates over the individual components in
98/// \a path in reverse order. The traversal order is exactly reversed from that
99/// of \a const_iterator
101 : public iterator_facade_base<reverse_iterator, std::input_iterator_tag,
102 const StringRef> {
103 StringRef Path; ///< The entire path.
104 StringRef Component; ///< The current component. Not necessarily in Path.
105 size_t Position = 0; ///< The iterators current position within Path.
106 Style S = Style::native; ///< The path style to use.
107
110
111public:
112 reference operator*() const { return Component; }
113 LLVM_ABI reverse_iterator &operator++(); // preincrement
114 LLVM_ABI bool operator==(const reverse_iterator &RHS) const;
115
116 /// Difference in bytes between this and RHS.
118};
119
120/// Get begin iterator over \a path.
121/// @param path Input path.
122/// @returns Iterator initialized with the first component of \a path.
124 Style style = Style::native);
125
126/// Get end iterator over \a path.
127/// @param path Input path.
128/// @returns Iterator initialized to the end of \a path.
130
131/// Get reverse begin iterator over \a path.
132/// @param path Input path.
133/// @returns Iterator initialized with the first reverse component of \a path.
135 Style style = Style::native);
136
137/// Get reverse end iterator over \a path.
138/// @param path Input path.
139/// @returns Iterator initialized to the reverse end of \a path.
141
142/// @}
143/// @name Lexical Modifiers
144/// @{
145
146/// Remove the last component from \a path unless it is the root dir.
147///
148/// Similar to the POSIX "dirname" utility.
149///
150/// @code
151/// directory/filename.cpp => directory/
152/// directory/ => directory
153/// filename.cpp => <empty>
154/// / => /
155/// @endcode
156///
157/// @param path A path that is modified to not have a file component.
159 Style style = Style::native);
160
161/// Replace the file extension of \a path with \a extension.
162///
163/// @code
164/// ./filename.cpp => ./filename.extension
165/// ./filename => ./filename.extension
166/// ./ => ./.extension
167/// @endcode
168///
169/// @param path A path that has its extension replaced with \a extension.
170/// @param extension The extension to be added. It may be empty. It may also
171/// optionally start with a '.', if it does not, one will be
172/// prepended.
174 const Twine &extension,
175 Style style = Style::native);
176
177/// Replace matching path prefix with another path.
178///
179/// @code
180/// /foo, /old, /new => /foo
181/// /old, /old, /new => /new
182/// /old, /old/, /new => /old
183/// /old/foo, /old, /new => /new/foo
184/// /old/foo, /old/, /new => /new/foo
185/// /old/foo, /old/, /new/ => /new/foo
186/// /oldfoo, /old, /new => /oldfoo
187/// /foo, <empty>, /new => /new/foo
188/// /foo, <empty>, new => new/foo
189/// /old/foo, /old, <empty> => /foo
190/// @endcode
191///
192/// @param Path If \a Path starts with \a OldPrefix modify to instead
193/// start with \a NewPrefix.
194/// @param OldPrefix The path prefix to strip from \a Path.
195/// @param NewPrefix The path prefix to replace \a NewPrefix with.
196/// @param style The style used to match the prefix. Exact match using
197/// Posix style, case/separator insensitive match for Windows style.
198/// @result true if \a Path begins with OldPrefix
200 StringRef OldPrefix, StringRef NewPrefix,
201 Style style = Style::native);
202
203/// Remove redundant leading "./" pieces and consecutive separators.
204///
205/// @param path Input path.
206/// @result The cleaned-up \a path.
208 Style style = Style::native);
209
210/// Remove './' and optionally '../' components, and canonicalize separators.
211///
212/// @param path processed path.
213/// @param remove_dot_dot specify if '../' (except for leading "../") should be
214/// removed.
215/// @result True if path was changed.
217 bool remove_dot_dot = false,
218 Style style = Style::native);
219
220/// Append to path.
221///
222/// @code
223/// /foo + bar/f => /foo/bar/f
224/// /foo/ + bar/f => /foo/bar/f
225/// foo + bar/f => foo/bar/f
226/// foo + /bar/f => foo/bar/f (FIXME: will be changed to /bar/f to align
227/// with C++17 std::filesystem::path::append)
228/// @endcode
229///
230/// @param path Set to \a path + \a component.
231/// @param a The component to be appended to \a path.
233 const Twine &b = "", const Twine &c = "",
234 const Twine &d = "");
235
236LLVM_ABI void append(SmallVectorImpl<char> &path, Style style, const Twine &a,
237 const Twine &b = "", const Twine &c = "",
238 const Twine &d = "");
239
240/// Append to path.
241///
242/// @code
243/// /foo + [bar,f] => /foo/bar/f
244/// /foo/ + [bar,f] => /foo/bar/f
245/// foo + [bar,f] => foo/bar/f
246/// @endcode
247///
248/// @param path Set to \a path + [\a begin, \a end).
249/// @param begin Start of components to append.
250/// @param end One past the end of components to append.
253
254/// @}
255/// @name Transforms (or some other better name)
256/// @{
257
258/// Convert path to the native form. This is used to give paths to users and
259/// operating system calls in the platform's normal way. For example, on Windows
260/// all '/' are converted to '\'. On Unix, it converts all '\' to '/'.
261///
262/// @param path A path that is transformed to native format.
263/// @param result Holds the result of the transformation.
264LLVM_ABI void native(const Twine &path, SmallVectorImpl<char> &result,
265 Style style = Style::native);
266
267/// Convert path to the native form and return it as a std::string. This is used
268/// to give paths to users and operating system calls in the platform's normal
269/// way. For example, on Windows all '/' are converted to '\'. On Unix, it
270/// converts all '\' to '/'.
271///
272/// @param path A path that is transformed to native format.
273[[nodiscard]] LLVM_ABI std::string native(const Twine &path,
274 Style style = Style::native);
275
276/// Convert path to the native form in place. This is used to give paths to
277/// users and operating system calls in the platform's normal way. For example,
278/// on Windows all '/' are converted to '\'.
279///
280/// @param path A path that is transformed to native format.
282
283/// For Windows path styles, convert path to use the preferred path separators.
284/// For other styles, do nothing.
285///
286/// @param path A path that is transformed to preferred format.
288 Style style = Style::native) {
289 if (!is_style_windows(style))
290 return;
291 native(path, style);
292}
293
294/// Replaces backslashes with slashes if Windows.
295///
296/// @param path processed path
297/// @result The result of replacing backslashes with forward slashes if Windows.
298/// On Unix, this function is a no-op because backslashes are valid path
299/// chracters.
301 Style style = Style::native);
302
303/// @}
304/// @name Lexical Observers
305/// @{
306
307/// Get root name.
308///
309/// @code
310/// //net/hello => //net
311/// c:/hello => c: (on Windows, on other platforms nothing)
312/// /hello => <empty>
313/// @endcode
314///
315/// @param path Input path.
316/// @result The root name of \a path if it has one, otherwise "".
318 Style style = Style::native);
319
320/// Get root directory.
321///
322/// @code
323/// /goo/hello => /
324/// c:/hello => /
325/// d/file.txt => <empty>
326/// @endcode
327///
328/// @param path Input path.
329/// @result The root directory of \a path if it has one, otherwise
330/// "".
332 Style style = Style::native);
333
334/// Get root path.
335///
336/// Equivalent to root_name + root_directory.
337///
338/// @param path Input path.
339/// @result The root path of \a path if it has one, otherwise "".
341 Style style = Style::native);
342
343/// Get relative path.
344///
345/// @code
346/// C:\hello\world => hello\world
347/// foo/bar => foo/bar
348/// /foo/bar => foo/bar
349/// @endcode
350///
351/// @param path Input path.
352/// @result The path starting after root_path if one exists, otherwise "".
354 Style style = Style::native);
355
356/// Get parent path.
357///
358/// @code
359/// / => <empty>
360/// /foo => /
361/// foo/../bar => foo/..
362/// @endcode
363///
364/// @param path Input path.
365/// @result The parent path of \a path if one exists, otherwise "".
367 Style style = Style::native);
368
369/// Get filename.
370///
371/// @code
372/// /foo.txt => foo.txt
373/// . => .
374/// .. => ..
375/// / => /
376/// @endcode
377///
378/// @param path Input path.
379/// @result The filename part of \a path. This is defined as the last component
380/// of \a path. Similar to the POSIX "basename" utility.
382 Style style = Style::native);
383
384/// Get stem.
385///
386/// If filename contains a dot but not solely one or two dots, result is the
387/// substring of filename ending at (but not including) the last dot. Otherwise
388/// it is filename.
389///
390/// @code
391/// /foo/bar.txt => bar
392/// /foo/bar => bar
393/// /foo/.txt => <empty>
394/// /foo/. => .
395/// /foo/.. => ..
396/// @endcode
397///
398/// @param path Input path.
399/// @result The stem of \a path.
401 Style style = Style::native);
402
403/// Get extension.
404///
405/// If filename contains a dot but not solely one or two dots, result is the
406/// substring of filename starting at (and including) the last dot, and ending
407/// at the end of \a path. Otherwise "".
408///
409/// @code
410/// /foo/bar.txt => .txt
411/// /foo/bar => <empty>
412/// /foo/.txt => .txt
413/// @endcode
414///
415/// @param path Input path.
416/// @result The extension of \a path.
418 Style style = Style::native);
419
420/// Check whether the given char is a path separator on the host OS.
421///
422/// @param value a character
423/// @result true if \a value is a path separator character on the host OS
424LLVM_ABI bool is_separator(char value, Style style = Style::native);
425
426/// Return the preferred separator for this platform.
427///
428/// @result StringRef of the preferred separator, null-terminated.
430
431/// Get the typical temporary directory for the system, e.g.,
432/// "/var/tmp" or "C:/TEMP"
433///
434/// @param erasedOnReboot Whether to favor a path that is erased on reboot
435/// rather than one that potentially persists longer. This parameter will be
436/// ignored if the user or system has set the typical environment variable
437/// (e.g., TEMP on Windows, TMPDIR on *nix) to specify a temporary directory.
438///
439/// @param result Holds the resulting path name.
440LLVM_ABI void system_temp_directory(bool erasedOnReboot,
441 SmallVectorImpl<char> &result);
442
443/// Get the user's home directory.
444///
445/// @param result Holds the resulting path name.
446/// @result True if a home directory is set, false otherwise.
448
449/// Get the directory where packages should read user-specific configurations.
450/// e.g. $XDG_CONFIG_HOME.
451///
452/// @param result Holds the resulting path name.
453/// @result True if the appropriate path was determined, it need not exist.
455
456/// Get the directory where installed packages should put their
457/// machine-local cache, e.g. $XDG_CACHE_HOME.
458///
459/// @param result Holds the resulting path name.
460/// @result True if the appropriate path was determined, it need not exist.
462
463/// Has root name?
464///
465/// root_name != ""
466///
467/// @param path Input path.
468/// @result True if the path has a root name, false otherwise.
469LLVM_ABI bool has_root_name(const Twine &path, Style style = Style::native);
470
471/// Has root directory?
472///
473/// root_directory != ""
474///
475/// @param path Input path.
476/// @result True if the path has a root directory, false otherwise.
478 Style style = Style::native);
479
480/// Has root path?
481///
482/// root_path != ""
483///
484/// @param path Input path.
485/// @result True if the path has a root path, false otherwise.
486LLVM_ABI bool has_root_path(const Twine &path, Style style = Style::native);
487
488/// Has relative path?
489///
490/// relative_path != ""
491///
492/// @param path Input path.
493/// @result True if the path has a relative path, false otherwise.
495
496/// Has parent path?
497///
498/// parent_path != ""
499///
500/// @param path Input path.
501/// @result True if the path has a parent path, false otherwise.
503
504/// Has filename?
505///
506/// filename != ""
507///
508/// @param path Input path.
509/// @result True if the path has a filename, false otherwise.
510LLVM_ABI bool has_filename(const Twine &path, Style style = Style::native);
511
512/// Has stem?
513///
514/// stem != ""
515///
516/// @param path Input path.
517/// @result True if the path has a stem, false otherwise.
518LLVM_ABI bool has_stem(const Twine &path, Style style = Style::native);
519
520/// Has extension?
521///
522/// extension != ""
523///
524/// @param path Input path.
525/// @result True if the path has a extension, false otherwise.
526LLVM_ABI bool has_extension(const Twine &path, Style style = Style::native);
527
528/// Is path absolute?
529///
530/// According to cppreference.com, C++17 states: "An absolute path is a path
531/// that unambiguously identifies the location of a file without reference to
532/// an additional starting location."
533///
534/// In other words, the rules are:
535/// 1) POSIX style paths with nonempty root directory are absolute.
536/// 2) Windows style paths with nonempty root name and root directory are
537/// absolute.
538/// 3) No other paths are absolute.
539///
540/// \see has_root_name
541/// \see has_root_directory
542///
543/// @param path Input path.
544/// @result True if the path is absolute, false if it is not.
545LLVM_ABI bool is_absolute(const Twine &path, Style style = Style::native);
546
547/// Is path absolute using GNU rules?
548///
549/// GNU rules are:
550/// 1) Paths starting with a path separator are absolute.
551/// 2) Windows style paths are also absolute if they start with a character
552/// followed by ':'.
553/// 3) No other paths are absolute.
554///
555/// On Windows style the path "C:\Users\Default" has "C:" as root name and "\"
556/// as root directory.
557///
558/// Hence "C:" on Windows is absolute under GNU rules and not absolute under
559/// C++17 because it has no root directory. Likewise "/" and "\" on Windows are
560/// absolute under GNU and are not absolute under C++17 due to empty root name.
561///
562/// \see has_root_name
563/// \see has_root_directory
564///
565/// @param path Input path.
566/// @param style The style of \p path (e.g. Windows or POSIX). "native" style
567/// means to derive the style from the host.
568/// @result True if the path is absolute following GNU rules, false if it is
569/// not.
571
572/// Is path relative?
573///
574/// @param path Input path.
575/// @result True if the path is relative, false if it is not.
576LLVM_ABI bool is_relative(const Twine &path, Style style = Style::native);
577
578/// Make \a path an absolute path.
579///
580/// Makes \a path absolute using the \a current_directory if it is not already.
581/// An empty \a path will result in the \a current_directory.
582///
583/// /absolute/path => /absolute/path
584/// relative/../path => <current-directory>/relative/../path
585///
586/// @param path A path that is modified to be an absolute path.
587LLVM_ABI void make_absolute(const Twine &current_directory,
589
590} // end namespace path
591} // end namespace sys
592} // end namespace llvm
593
594#endif
#define LLVM_ABI
Definition Compiler.h:213
#define LLVM_LIFETIME_BOUND
Definition Compiler.h:435
Value * RHS
StringRef - Represent a constant reference to a string, i.e.
Definition StringRef.h:55
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition Twine.h:82
CRTP base class which implements the entire standard iterator facade in terms of a minimal subset of ...
Definition iterator.h:80
LLVM_ABI const_iterator & operator++()
Definition Path.cpp:243
LLVM_ABI friend const_iterator begin(StringRef path, Style style)
Get begin iterator over path.
Definition Path.cpp:227
LLVM_ABI friend const_iterator end(StringRef path)
Get end iterator over path.
Definition Path.cpp:236
LLVM_ABI bool operator==(const const_iterator &RHS) const
Definition Path.cpp:290
LLVM_ABI ptrdiff_t operator-(const const_iterator &RHS) const
Difference in bytes between this and RHS.
Definition Path.cpp:294
reference operator*() const
Definition Path.h:87
Reverse path iterator.
Definition Path.h:102
LLVM_ABI friend reverse_iterator rend(StringRef path)
Get reverse end iterator over path.
LLVM_ABI bool operator==(const reverse_iterator &RHS) const
Definition Path.cpp:340
LLVM_ABI ptrdiff_t operator-(const reverse_iterator &RHS) const
Difference in bytes between this and RHS.
Definition Path.cpp:345
LLVM_ABI reverse_iterator & operator++()
Definition Path.cpp:315
LLVM_ABI friend reverse_iterator rbegin(StringRef path, Style style)
Get reverse begin iterator over path.
reference operator*() const
Definition Path.h:112
LLVM_ABI StringRef get_separator(Style style=Style::native)
Return the preferred separator for this platform.
Definition Path.cpp:616
LLVM_ABI StringRef root_path(StringRef path LLVM_LIFETIME_BOUND, Style style=Style::native)
Get root path.
Definition Path.cpp:349
LLVM_ABI void remove_filename(SmallVectorImpl< char > &path, Style style=Style::native)
Remove the last component from path unless it is the root dir.
Definition Path.cpp:475
LLVM_ABI bool has_relative_path(const Twine &path, Style style=Style::native)
Has relative path?
Definition Path.cpp:643
LLVM_ABI StringRef stem(StringRef path LLVM_LIFETIME_BOUND, Style style=Style::native)
Get stem.
Definition Path.cpp:586
LLVM_ABI bool has_root_name(const Twine &path, Style style=Style::native)
Has root name?
Definition Path.cpp:622
LLVM_ABI void replace_extension(SmallVectorImpl< char > &path, const Twine &extension, Style style=Style::native)
Replace the file extension of path with extension.
Definition Path.cpp:481
LLVM_ABI bool cache_directory(SmallVectorImpl< char > &result)
Get the directory where installed packages should put their machine-local cache, e....
LLVM_ABI const_iterator begin(StringRef path LLVM_LIFETIME_BOUND, Style style=Style::native)
Get begin iterator over path.
Definition Path.cpp:227
LLVM_ABI bool user_config_directory(SmallVectorImpl< char > &result)
Get the directory where packages should read user-specific configurations.
LLVM_ABI bool remove_dots(SmallVectorImpl< char > &path, bool remove_dot_dot=false, Style style=Style::native)
Remove '.
Definition Path.cpp:769
LLVM_ABI bool has_root_path(const Twine &path, Style style=Style::native)
Has root path?
Definition Path.cpp:636
constexpr bool is_style_posix(Style S)
Check if S uses POSIX path rules.
Definition Path.h:37
LLVM_ABI StringRef parent_path(StringRef path LLVM_LIFETIME_BOUND, Style style=Style::native)
Get parent path.
Definition Path.cpp:468
LLVM_ABI bool has_parent_path(const Twine &path, Style style=Style::native)
Has parent path?
Definition Path.cpp:657
void make_preferred(SmallVectorImpl< char > &path, Style style=Style::native)
For Windows path styles, convert path to use the preferred path separators.
Definition Path.h:287
LLVM_ABI bool is_relative(const Twine &path, Style style=Style::native)
Is path relative?
Definition Path.cpp:706
LLVM_ABI void system_temp_directory(bool erasedOnReboot, SmallVectorImpl< char > &result)
Get the typical temporary directory for the system, e.g., "/var/tmp" or "C:/TEMP".
LLVM_ABI bool has_extension(const Twine &path, Style style=Style::native)
Has extension?
Definition Path.cpp:671
LLVM_ABI void make_absolute(const Twine &current_directory, SmallVectorImpl< char > &path)
Make path an absolute path.
Definition Path.cpp:710
LLVM_ABI bool is_absolute_gnu(const Twine &path, Style style=Style::native)
Is path absolute using GNU rules?
Definition Path.cpp:688
LLVM_ABI StringRef filename(StringRef path LLVM_LIFETIME_BOUND, Style style=Style::native)
Get filename.
Definition Path.cpp:584
LLVM_ABI StringRef remove_leading_dotslash(StringRef path LLVM_LIFETIME_BOUND, Style style=Style::native)
Remove redundant leading "./" pieces and consecutive separators.
LLVM_ABI std::string convert_to_slash(StringRef path, Style style=Style::native)
Replaces backslashes with slashes if Windows.
Definition Path.cpp:575
LLVM_ABI void native(const Twine &path, SmallVectorImpl< char > &result, Style style=Style::native)
Convert path to the native form.
Definition Path.cpp:541
LLVM_ABI bool is_absolute(const Twine &path, Style style=Style::native)
Is path absolute?
Definition Path.cpp:678
LLVM_ABI bool has_stem(const Twine &path, Style style=Style::native)
Has stem?
Definition Path.cpp:664
constexpr bool is_style_windows(Style S)
Check if S uses Windows path rules.
Definition Path.h:50
LLVM_ABI StringRef root_name(StringRef path LLVM_LIFETIME_BOUND, Style style=Style::native)
Get root name.
Definition Path.cpp:374
LLVM_ABI StringRef root_directory(StringRef path LLVM_LIFETIME_BOUND, Style style=Style::native)
Get root directory.
Definition Path.cpp:391
LLVM_ABI bool replace_path_prefix(SmallVectorImpl< char > &Path, StringRef OldPrefix, StringRef NewPrefix, Style style=Style::native)
Replace matching path prefix with another path.
Definition Path.cpp:519
LLVM_ABI void append(SmallVectorImpl< char > &path, const Twine &a, const Twine &b="", const Twine &c="", const Twine &d="")
Append to path.
Definition Path.cpp:457
LLVM_ABI StringRef extension(StringRef path LLVM_LIFETIME_BOUND, Style style=Style::native)
Get extension.
Definition Path.cpp:597
LLVM_ABI reverse_iterator rend(StringRef path LLVM_LIFETIME_BOUND)
Get reverse end iterator over path.
LLVM_ABI reverse_iterator rbegin(StringRef path LLVM_LIFETIME_BOUND, Style style=Style::native)
Get reverse begin iterator over path.
LLVM_ABI bool has_filename(const Twine &path, Style style=Style::native)
Has filename?
Definition Path.cpp:650
LLVM_ABI const_iterator end(StringRef path LLVM_LIFETIME_BOUND)
Get end iterator over path.
Definition Path.cpp:236
LLVM_ABI bool home_directory(SmallVectorImpl< char > &result)
Get the user's home directory.
LLVM_ABI bool is_separator(char value, Style style=Style::native)
Check whether the given char is a path separator on the host OS.
Definition Path.cpp:608
LLVM_ABI StringRef relative_path(StringRef path LLVM_LIFETIME_BOUND, Style style=Style::native)
Get relative path.
Definition Path.cpp:414
LLVM_ABI bool has_root_directory(const Twine &path, Style style=Style::native)
Has root directory?
Definition Path.cpp:629
This is an optimization pass for GlobalISel generic memory operations.