LLVM  14.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"
20 #include "llvm/Support/DataTypes.h"
21 #include <iterator>
22 #include <system_error>
23 
24 namespace llvm {
25 namespace sys {
26 namespace path {
27 
28 enum class Style { windows, posix, native };
29 
30 /// @name Lexical Component Iterator
31 /// @{
32 
33 /// Path iterator.
34 ///
35 /// This is an input iterator that iterates over the individual components in
36 /// \a path. The traversal order is as follows:
37 /// * The root-name element, if present.
38 /// * The root-directory element, if present.
39 /// * Each successive filename element, if present.
40 /// * Dot, if one or more trailing non-root slash characters are present.
41 /// Traversing backwards is possible with \a reverse_iterator
42 ///
43 /// Iteration examples. Each component is separated by ',':
44 /// @code
45 /// / => /
46 /// /foo => /,foo
47 /// foo/ => foo,.
48 /// /foo/bar => /,foo,bar
49 /// ../ => ..,.
50 /// C:\foo\bar => C:,\,foo,bar
51 /// @endcode
53  : public iterator_facade_base<const_iterator, std::input_iterator_tag,
54  const StringRef> {
55  StringRef Path; ///< The entire path.
56  StringRef Component; ///< The current component. Not necessarily in Path.
57  size_t Position = 0; ///< The iterators current position within Path.
58  Style S = Style::native; ///< The path style to use.
59 
60  // An end iterator has Position = Path.size() + 1.
61  friend const_iterator begin(StringRef path, Style style);
62  friend const_iterator end(StringRef path);
63 
64 public:
65  reference operator*() const { return Component; }
66  const_iterator &operator++(); // preincrement
67  bool operator==(const const_iterator &RHS) const;
68 
69  /// Difference in bytes between this and RHS.
70  ptrdiff_t operator-(const const_iterator &RHS) const;
71 };
72 
73 /// Reverse path iterator.
74 ///
75 /// This is an input iterator that iterates over the individual components in
76 /// \a path in reverse order. The traversal order is exactly reversed from that
77 /// of \a const_iterator
79  : public iterator_facade_base<reverse_iterator, std::input_iterator_tag,
80  const StringRef> {
81  StringRef Path; ///< The entire path.
82  StringRef Component; ///< The current component. Not necessarily in Path.
83  size_t Position = 0; ///< The iterators current position within Path.
84  Style S = Style::native; ///< The path style to use.
85 
86  friend reverse_iterator rbegin(StringRef path, Style style);
87  friend reverse_iterator rend(StringRef path);
88 
89 public:
90  reference operator*() const { return Component; }
91  reverse_iterator &operator++(); // preincrement
92  bool operator==(const reverse_iterator &RHS) const;
93 
94  /// Difference in bytes between this and RHS.
95  ptrdiff_t operator-(const reverse_iterator &RHS) const;
96 };
97 
98 /// Get begin iterator over \a path.
99 /// @param path Input path.
100 /// @returns Iterator initialized with the first component of \a path.
102 
103 /// Get end iterator over \a path.
104 /// @param path Input path.
105 /// @returns Iterator initialized to the end of \a path.
107 
108 /// Get reverse begin iterator over \a path.
109 /// @param path Input path.
110 /// @returns Iterator initialized with the first reverse component of \a path.
111 reverse_iterator rbegin(StringRef path, Style style = Style::native);
112 
113 /// Get reverse end iterator over \a path.
114 /// @param path Input path.
115 /// @returns Iterator initialized to the reverse end of \a path.
116 reverse_iterator rend(StringRef path);
117 
118 /// @}
119 /// @name Lexical Modifiers
120 /// @{
121 
122 /// Remove the last component from \a path unless it is the root dir.
123 ///
124 /// Similar to the POSIX "dirname" utility.
125 ///
126 /// @code
127 /// directory/filename.cpp => directory/
128 /// directory/ => directory
129 /// filename.cpp => <empty>
130 /// / => /
131 /// @endcode
132 ///
133 /// @param path A path that is modified to not have a file component.
135 
136 /// Replace the file extension of \a path with \a extension.
137 ///
138 /// @code
139 /// ./filename.cpp => ./filename.extension
140 /// ./filename => ./filename.extension
141 /// ./ => ./.extension
142 /// @endcode
143 ///
144 /// @param path A path that has its extension replaced with \a extension.
145 /// @param extension The extension to be added. It may be empty. It may also
146 /// optionally start with a '.', if it does not, one will be
147 /// prepended.
149  Style style = Style::native);
150 
151 /// Replace matching path prefix with another path.
152 ///
153 /// @code
154 /// /foo, /old, /new => /foo
155 /// /old, /old, /new => /new
156 /// /old, /old/, /new => /old
157 /// /old/foo, /old, /new => /new/foo
158 /// /old/foo, /old/, /new => /new/foo
159 /// /old/foo, /old/, /new/ => /new/foo
160 /// /oldfoo, /old, /new => /oldfoo
161 /// /foo, <empty>, /new => /new/foo
162 /// /foo, <empty>, new => new/foo
163 /// /old/foo, /old, <empty> => /foo
164 /// @endcode
165 ///
166 /// @param Path If \a Path starts with \a OldPrefix modify to instead
167 /// start with \a NewPrefix.
168 /// @param OldPrefix The path prefix to strip from \a Path.
169 /// @param NewPrefix The path prefix to replace \a NewPrefix with.
170 /// @param style The style used to match the prefix. Exact match using
171 /// Posix style, case/separator insensitive match for Windows style.
172 /// @result true if \a Path begins with OldPrefix
174  StringRef NewPrefix,
175  Style style = Style::native);
176 
177 /// Remove redundant leading "./" pieces and consecutive separators.
178 ///
179 /// @param path Input path.
180 /// @result The cleaned-up \a path.
182 
183 /// In-place remove any './' and optionally '../' components from a path.
184 ///
185 /// @param path processed path
186 /// @param remove_dot_dot specify if '../' (except for leading "../") should be
187 /// removed
188 /// @result True if path was changed
189 bool remove_dots(SmallVectorImpl<char> &path, bool remove_dot_dot = false,
190  Style style = Style::native);
191 
192 /// Append to path.
193 ///
194 /// @code
195 /// /foo + bar/f => /foo/bar/f
196 /// /foo/ + bar/f => /foo/bar/f
197 /// foo + bar/f => foo/bar/f
198 /// @endcode
199 ///
200 /// @param path Set to \a path + \a component.
201 /// @param a The component to be appended to \a path.
202 void append(SmallVectorImpl<char> &path, const Twine &a,
203  const Twine &b = "",
204  const Twine &c = "",
205  const Twine &d = "");
206 
207 void append(SmallVectorImpl<char> &path, Style style, const Twine &a,
208  const Twine &b = "", const Twine &c = "", const Twine &d = "");
209 
210 /// Append to path.
211 ///
212 /// @code
213 /// /foo + [bar,f] => /foo/bar/f
214 /// /foo/ + [bar,f] => /foo/bar/f
215 /// foo + [bar,f] => foo/bar/f
216 /// @endcode
217 ///
218 /// @param path Set to \a path + [\a begin, \a end).
219 /// @param begin Start of components to append.
220 /// @param end One past the end of components to append.
223 
224 /// @}
225 /// @name Transforms (or some other better name)
226 /// @{
227 
228 /// Convert path to the native form. This is used to give paths to users and
229 /// operating system calls in the platform's normal way. For example, on Windows
230 /// all '/' are converted to '\'. On Unix, it converts all '\' to '/'.
231 ///
232 /// @param path A path that is transformed to native format.
233 /// @param result Holds the result of the transformation.
234 void native(const Twine &path, SmallVectorImpl<char> &result,
235  Style style = Style::native);
236 
237 /// Convert path to the native form in place. This is used to give paths to
238 /// users and operating system calls in the platform's normal way. For example,
239 /// on Windows all '/' are converted to '\'.
240 ///
241 /// @param path A path that is transformed to native format.
242 void native(SmallVectorImpl<char> &path, Style style = Style::native);
243 
244 /// Replaces backslashes with slashes if Windows.
245 ///
246 /// @param path processed path
247 /// @result The result of replacing backslashes with forward slashes if Windows.
248 /// On Unix, this function is a no-op because backslashes are valid path
249 /// chracters.
250 std::string convert_to_slash(StringRef path, Style style = Style::native);
251 
252 /// @}
253 /// @name Lexical Observers
254 /// @{
255 
256 /// Get root name.
257 ///
258 /// @code
259 /// //net/hello => //net
260 /// c:/hello => c: (on Windows, on other platforms nothing)
261 /// /hello => <empty>
262 /// @endcode
263 ///
264 /// @param path Input path.
265 /// @result The root name of \a path if it has one, otherwise "".
267 
268 /// Get root directory.
269 ///
270 /// @code
271 /// /goo/hello => /
272 /// c:/hello => /
273 /// d/file.txt => <empty>
274 /// @endcode
275 ///
276 /// @param path Input path.
277 /// @result The root directory of \a path if it has one, otherwise
278 /// "".
280 
281 /// Get root path.
282 ///
283 /// Equivalent to root_name + root_directory.
284 ///
285 /// @param path Input path.
286 /// @result The root path of \a path if it has one, otherwise "".
288 
289 /// Get relative path.
290 ///
291 /// @code
292 /// C:\hello\world => hello\world
293 /// foo/bar => foo/bar
294 /// /foo/bar => foo/bar
295 /// @endcode
296 ///
297 /// @param path Input path.
298 /// @result The path starting after root_path if one exists, otherwise "".
300 
301 /// Get parent path.
302 ///
303 /// @code
304 /// / => <empty>
305 /// /foo => /
306 /// foo/../bar => foo/..
307 /// @endcode
308 ///
309 /// @param path Input path.
310 /// @result The parent path of \a path if one exists, otherwise "".
312 
313 /// Get filename.
314 ///
315 /// @code
316 /// /foo.txt => foo.txt
317 /// . => .
318 /// .. => ..
319 /// / => /
320 /// @endcode
321 ///
322 /// @param path Input path.
323 /// @result The filename part of \a path. This is defined as the last component
324 /// of \a path. Similar to the POSIX "basename" utility.
326 
327 /// Get stem.
328 ///
329 /// If filename contains a dot but not solely one or two dots, result is the
330 /// substring of filename ending at (but not including) the last dot. Otherwise
331 /// it is filename.
332 ///
333 /// @code
334 /// /foo/bar.txt => bar
335 /// /foo/bar => bar
336 /// /foo/.txt => <empty>
337 /// /foo/. => .
338 /// /foo/.. => ..
339 /// @endcode
340 ///
341 /// @param path Input path.
342 /// @result The stem of \a path.
344 
345 /// Get extension.
346 ///
347 /// If filename contains a dot but not solely one or two dots, result is the
348 /// substring of filename starting at (and including) the last dot, and ending
349 /// at the end of \a path. Otherwise "".
350 ///
351 /// @code
352 /// /foo/bar.txt => .txt
353 /// /foo/bar => <empty>
354 /// /foo/.txt => .txt
355 /// @endcode
356 ///
357 /// @param path Input path.
358 /// @result The extension of \a path.
360 
361 /// Check whether the given char is a path separator on the host OS.
362 ///
363 /// @param value a character
364 /// @result true if \a value is a path separator character on the host OS
365 bool is_separator(char value, Style style = Style::native);
366 
367 /// Return the preferred separator for this platform.
368 ///
369 /// @result StringRef of the preferred separator, null-terminated.
371 
372 /// Get the typical temporary directory for the system, e.g.,
373 /// "/var/tmp" or "C:/TEMP"
374 ///
375 /// @param erasedOnReboot Whether to favor a path that is erased on reboot
376 /// rather than one that potentially persists longer. This parameter will be
377 /// ignored if the user or system has set the typical environment variable
378 /// (e.g., TEMP on Windows, TMPDIR on *nix) to specify a temporary directory.
379 ///
380 /// @param result Holds the resulting path name.
381 void system_temp_directory(bool erasedOnReboot, SmallVectorImpl<char> &result);
382 
383 /// Get the user's home directory.
384 ///
385 /// @param result Holds the resulting path name.
386 /// @result True if a home directory is set, false otherwise.
388 
389 /// Get the directory where packages should read user-specific configurations.
390 /// e.g. $XDG_CONFIG_HOME.
391 ///
392 /// @param result Holds the resulting path name.
393 /// @result True if the appropriate path was determined, it need not exist.
395 
396 /// Get the directory where installed packages should put their
397 /// machine-local cache, e.g. $XDG_CACHE_HOME.
398 ///
399 /// @param result Holds the resulting path name.
400 /// @result True if the appropriate path was determined, it need not exist.
402 
403 /// Has root name?
404 ///
405 /// root_name != ""
406 ///
407 /// @param path Input path.
408 /// @result True if the path has a root name, false otherwise.
409 bool has_root_name(const Twine &path, Style style = Style::native);
410 
411 /// Has root directory?
412 ///
413 /// root_directory != ""
414 ///
415 /// @param path Input path.
416 /// @result True if the path has a root directory, false otherwise.
417 bool has_root_directory(const Twine &path, Style style = Style::native);
418 
419 /// Has root path?
420 ///
421 /// root_path != ""
422 ///
423 /// @param path Input path.
424 /// @result True if the path has a root path, false otherwise.
425 bool has_root_path(const Twine &path, Style style = Style::native);
426 
427 /// Has relative path?
428 ///
429 /// relative_path != ""
430 ///
431 /// @param path Input path.
432 /// @result True if the path has a relative path, false otherwise.
433 bool has_relative_path(const Twine &path, Style style = Style::native);
434 
435 /// Has parent path?
436 ///
437 /// parent_path != ""
438 ///
439 /// @param path Input path.
440 /// @result True if the path has a parent path, false otherwise.
441 bool has_parent_path(const Twine &path, Style style = Style::native);
442 
443 /// Has filename?
444 ///
445 /// filename != ""
446 ///
447 /// @param path Input path.
448 /// @result True if the path has a filename, false otherwise.
449 bool has_filename(const Twine &path, Style style = Style::native);
450 
451 /// Has stem?
452 ///
453 /// stem != ""
454 ///
455 /// @param path Input path.
456 /// @result True if the path has a stem, false otherwise.
457 bool has_stem(const Twine &path, Style style = Style::native);
458 
459 /// Has extension?
460 ///
461 /// extension != ""
462 ///
463 /// @param path Input path.
464 /// @result True if the path has a extension, false otherwise.
465 bool has_extension(const Twine &path, Style style = Style::native);
466 
467 /// Is path absolute?
468 ///
469 /// According to cppreference.com, C++17 states: "An absolute path is a path
470 /// that unambiguously identifies the location of a file without reference to
471 /// an additional starting location."
472 ///
473 /// In other words, the rules are:
474 /// 1) POSIX style paths with nonempty root directory are absolute.
475 /// 2) Windows style paths with nonempty root name and root directory are
476 /// absolute.
477 /// 3) No other paths are absolute.
478 ///
479 /// \see has_root_name
480 /// \see has_root_directory
481 ///
482 /// @param path Input path.
483 /// @result True if the path is absolute, false if it is not.
484 bool is_absolute(const Twine &path, Style style = Style::native);
485 
486 /// Is path absolute using GNU rules?
487 ///
488 /// GNU rules are:
489 /// 1) Paths starting with a path separator are absolute.
490 /// 2) Windows style paths are also absolute if they start with a character
491 /// followed by ':'.
492 /// 3) No other paths are absolute.
493 ///
494 /// On Windows style the path "C:\Users\Default" has "C:" as root name and "\"
495 /// as root directory.
496 ///
497 /// Hence "C:" on Windows is absolute under GNU rules and not absolute under
498 /// C++17 because it has no root directory. Likewise "/" and "\" on Windows are
499 /// absolute under GNU and are not absolute under C++17 due to empty root name.
500 ///
501 /// \see has_root_name
502 /// \see has_root_directory
503 ///
504 /// @param path Input path.
505 /// @param style The style of \p path (e.g. Windows or POSIX). "native" style
506 /// means to derive the style from the host.
507 /// @result True if the path is absolute following GNU rules, false if it is
508 /// not.
509 bool is_absolute_gnu(const Twine &path, Style style = Style::native);
510 
511 /// Is path relative?
512 ///
513 /// @param path Input path.
514 /// @result True if the path is relative, false if it is not.
515 bool is_relative(const Twine &path, Style style = Style::native);
516 
517 } // end namespace path
518 } // end namespace sys
519 } // end namespace llvm
520 
521 #endif
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
llvm::sys::path::const_iterator::end
friend const_iterator end(StringRef path)
Get end iterator over path.
Definition: Path.cpp:233
llvm::sys::path::replace_path_prefix
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:516
llvm::sys::path::home_directory
bool home_directory(SmallVectorImpl< char > &result)
Get the user's home directory.
llvm::sys::path::extension
StringRef extension(StringRef path, Style style=Style::native)
Get extension.
Definition: Path.cpp:586
llvm::sys::path::reverse_iterator::operator-
ptrdiff_t operator-(const reverse_iterator &RHS) const
Difference in bytes between this and RHS.
Definition: Path.cpp:342
llvm::sys::path::rbegin
reverse_iterator rbegin(StringRef path, Style style=Style::native)
Get reverse begin iterator over path.
Definition: Path.cpp:295
llvm::sys::path::Style::posix
@ posix
llvm::sys::path::remove_leading_dotslash
StringRef remove_leading_dotslash(StringRef path, Style style=Style::native)
Remove redundant leading "./" pieces and consecutive separators.
Definition: Path.cpp:700
llvm::sys::path::is_absolute
bool is_absolute(const Twine &path, Style style=Style::native)
Is path absolute?
Definition: Path.cpp:667
llvm::sys::path::convert_to_slash
std::string convert_to_slash(StringRef path, Style style=Style::native)
Replaces backslashes with slashes if Windows.
Definition: Path.cpp:564
llvm::sys::path::reverse_iterator
Reverse path iterator.
Definition: Path.h:78
llvm::sys::path::reverse_iterator::operator*
reference operator*() const
Definition: Path.h:90
llvm::sys::path::end
const_iterator end(StringRef path)
Get end iterator over path.
Definition: Path.cpp:233
llvm::sys::path::begin
const_iterator begin(StringRef path, Style style=Style::native)
Get begin iterator over path.
Definition: Path.cpp:224
llvm::sys::path::native
void native(const Twine &path, SmallVectorImpl< char > &result, Style style=Style::native)
Convert path to the native form.
Definition: Path.cpp:538
llvm::sys::path::user_config_directory
bool user_config_directory(SmallVectorImpl< char > &result)
Get the directory where packages should read user-specific configurations.
llvm::sys::path::const_iterator::operator-
ptrdiff_t operator-(const const_iterator &RHS) const
Difference in bytes between this and RHS.
Definition: Path.cpp:291
llvm::sys::path::cache_directory
bool cache_directory(SmallVectorImpl< char > &result)
Get the directory where installed packages should put their machine-local cache, e....
a
=0.0 ? 0.0 :(a > 0.0 ? 1.0 :-1.0) a
Definition: README.txt:489
result
It looks like we only need to define PPCfmarto for these because according to these instructions perform RTO on fma s result
Definition: README_P9.txt:256
llvm::sys::path::append
void append(SmallVectorImpl< char > &path, const Twine &a, const Twine &b="", const Twine &c="", const Twine &d="")
Append to path.
Definition: Path.cpp:454
ptrdiff_t
llvm::sys::path::has_extension
bool has_extension(const Twine &path, Style style=Style::native)
Has extension?
Definition: Path.cpp:660
llvm::sys::path::has_parent_path
bool has_parent_path(const Twine &path, Style style=Style::native)
Has parent path?
Definition: Path.cpp:646
Twine.h
llvm::sys::path::root_path
StringRef root_path(StringRef path, Style style=Style::native)
Get root path.
Definition: Path.cpp:346
b
the resulting code requires compare and branches when and if the revised code is with conditional branches instead of More there is a byte word extend before each where there should be only and the condition codes are not remembered when the same two values are compared twice More LSR enhancements i8 and i32 load store addressing modes are identical int b
Definition: README.txt:418
llvm::sys::path::has_stem
bool has_stem(const Twine &path, Style style=Style::native)
Has stem?
Definition: Path.cpp:653
llvm::sys::path::Style
Style
Definition: Path.h:28
c
the resulting code requires compare and branches when and if the revised code is with conditional branches instead of More there is a byte word extend before each where there should be only and the condition codes are not remembered when the same two values are compared twice More LSR enhancements i8 and i32 load store addressing modes are identical int int c
Definition: README.txt:418
llvm::sys::path::Style::windows
@ windows
llvm::sys::path::const_iterator::operator*
reference operator*() const
Definition: Path.h:65
llvm::sys::path::remove_dots
bool remove_dots(SmallVectorImpl< char > &path, bool remove_dot_dot=false, Style style=Style::native)
In-place remove any '.
Definition: Path.cpp:712
llvm::sys::path::reverse_iterator::operator==
bool operator==(const reverse_iterator &RHS) const
Definition: Path.cpp:337
llvm::sys::path::get_separator
StringRef get_separator(Style style=Style::native)
Return the preferred separator for this platform.
Definition: Path.cpp:605
llvm::sys::path::root_directory
StringRef root_directory(StringRef path, Style style=Style::native)
Get root directory.
Definition: Path.cpp:388
llvm::sys::path::replace_extension
void replace_extension(SmallVectorImpl< char > &path, const Twine &extension, Style style=Style::native)
Replace the file extension of path with extension.
Definition: Path.cpp:478
iterator.h
llvm::iterator_facade_base
CRTP base class which implements the entire standard iterator facade in terms of a minimal subset of ...
Definition: iterator.h:66
llvm::sys::path::reverse_iterator::rend
friend reverse_iterator rend(StringRef path)
Get reverse end iterator over path.
Definition: Path.cpp:304
llvm::sys::path::const_iterator::operator==
bool operator==(const const_iterator &RHS) const
Definition: Path.cpp:287
llvm::sys::path::Style::native
@ native
llvm::sys::path::const_iterator::begin
friend const_iterator begin(StringRef path, Style style)
Get begin iterator over path.
Definition: Path.cpp:224
llvm::sys::path::parent_path
StringRef parent_path(StringRef path, Style style=Style::native)
Get parent path.
Definition: Path.cpp:465
llvm::sys::path::reverse_iterator::operator++
reverse_iterator & operator++()
Definition: Path.cpp:312
llvm::sys::path::has_filename
bool has_filename(const Twine &path, Style style=Style::native)
Has filename?
Definition: Path.cpp:639
llvm::sys::path::has_relative_path
bool has_relative_path(const Twine &path, Style style=Style::native)
Has relative path?
Definition: Path.cpp:632
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
const_iterator
llvm::sys::path::reverse_iterator::rbegin
friend reverse_iterator rbegin(StringRef path, Style style)
Get reverse begin iterator over path.
Definition: Path.cpp:295
llvm::sys::path::const_iterator
Path iterator.
Definition: Path.h:52
llvm::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:83
llvm::sys::path::root_name
StringRef root_name(StringRef path, Style style=Style::native)
Get root name.
Definition: Path.cpp:371
llvm::sys::path::has_root_name
bool has_root_name(const Twine &path, Style style=Style::native)
Has root name?
Definition: Path.cpp:611
llvm::sys::path::system_temp_directory
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::sys::path::has_root_path
bool has_root_path(const Twine &path, Style style=Style::native)
Has root path?
Definition: Path.cpp:625
llvm::sys::path::is_absolute_gnu
bool is_absolute_gnu(const Twine &path, Style style=Style::native)
Is path absolute using GNU rules?
Definition: Path.cpp:678
llvm::sys::path::is_separator
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:597
llvm::sys::path::const_iterator::operator++
const_iterator & operator++()
Definition: Path.cpp:240
llvm::sys::path::filename
StringRef filename(StringRef path, Style style=Style::native)
Get filename.
Definition: Path.cpp:573
llvm::sys::path::remove_filename
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:472
llvm::SmallVectorImpl< char >
llvm::sys::path::rend
reverse_iterator rend(StringRef path)
Get reverse end iterator over path.
Definition: Path.cpp:304
DataTypes.h
llvm::sys::path::has_root_directory
bool has_root_directory(const Twine &path, Style style=Style::native)
Has root directory?
Definition: Path.cpp:618
llvm::sys::path::relative_path
StringRef relative_path(StringRef path, Style style=Style::native)
Get relative path.
Definition: Path.cpp:411
d
the resulting code requires compare and branches when and if the revised code is with conditional branches instead of More there is a byte word extend before each where there should be only and the condition codes are not remembered when the same two values are compared twice More LSR enhancements i8 and i32 load store addressing modes are identical int int int d
Definition: README.txt:418
llvm::sys::path::is_relative
bool is_relative(const Twine &path, Style style=Style::native)
Is path relative?
Definition: Path.cpp:696
llvm::sys::path::stem
StringRef stem(StringRef path, Style style=Style::native)
Get stem.
Definition: Path.cpp:575