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 {
29  native,
30  posix,
33  windows = windows_backslash, // deprecated
34 };
35 
36 /// Check if \p S uses POSIX path rules.
37 constexpr 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.
50 constexpr 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.
83  friend const_iterator begin(StringRef path, Style style);
84  friend const_iterator end(StringRef path);
85 
86 public:
87  reference operator*() const { return Component; }
88  const_iterator &operator++(); // preincrement
89  bool operator==(const const_iterator &RHS) const;
90 
91  /// Difference in bytes between this and RHS.
92  ptrdiff_t operator-(const const_iterator &RHS) const;
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 
108  friend reverse_iterator rbegin(StringRef path, Style style);
109  friend reverse_iterator rend(StringRef path);
110 
111 public:
112  reference operator*() const { return Component; }
113  reverse_iterator &operator++(); // preincrement
114  bool operator==(const reverse_iterator &RHS) const;
115 
116  /// Difference in bytes between this and RHS.
117  ptrdiff_t operator-(const reverse_iterator &RHS) const;
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 
125 /// Get end iterator over \a path.
126 /// @param path Input path.
127 /// @returns Iterator initialized to the end of \a path.
129 
130 /// Get reverse begin iterator over \a path.
131 /// @param path Input path.
132 /// @returns Iterator initialized with the first reverse component of \a path.
133 reverse_iterator rbegin(StringRef path, Style style = Style::native);
134 
135 /// Get reverse end iterator over \a path.
136 /// @param path Input path.
137 /// @returns Iterator initialized to the reverse end of \a path.
138 reverse_iterator rend(StringRef path);
139 
140 /// @}
141 /// @name Lexical Modifiers
142 /// @{
143 
144 /// Remove the last component from \a path unless it is the root dir.
145 ///
146 /// Similar to the POSIX "dirname" utility.
147 ///
148 /// @code
149 /// directory/filename.cpp => directory/
150 /// directory/ => directory
151 /// filename.cpp => <empty>
152 /// / => /
153 /// @endcode
154 ///
155 /// @param path A path that is modified to not have a file component.
157 
158 /// Replace the file extension of \a path with \a extension.
159 ///
160 /// @code
161 /// ./filename.cpp => ./filename.extension
162 /// ./filename => ./filename.extension
163 /// ./ => ./.extension
164 /// @endcode
165 ///
166 /// @param path A path that has its extension replaced with \a extension.
167 /// @param extension The extension to be added. It may be empty. It may also
168 /// optionally start with a '.', if it does not, one will be
169 /// prepended.
171  Style style = Style::native);
172 
173 /// Replace matching path prefix with another path.
174 ///
175 /// @code
176 /// /foo, /old, /new => /foo
177 /// /old, /old, /new => /new
178 /// /old, /old/, /new => /old
179 /// /old/foo, /old, /new => /new/foo
180 /// /old/foo, /old/, /new => /new/foo
181 /// /old/foo, /old/, /new/ => /new/foo
182 /// /oldfoo, /old, /new => /oldfoo
183 /// /foo, <empty>, /new => /new/foo
184 /// /foo, <empty>, new => new/foo
185 /// /old/foo, /old, <empty> => /foo
186 /// @endcode
187 ///
188 /// @param Path If \a Path starts with \a OldPrefix modify to instead
189 /// start with \a NewPrefix.
190 /// @param OldPrefix The path prefix to strip from \a Path.
191 /// @param NewPrefix The path prefix to replace \a NewPrefix with.
192 /// @param style The style used to match the prefix. Exact match using
193 /// Posix style, case/separator insensitive match for Windows style.
194 /// @result true if \a Path begins with OldPrefix
196  StringRef NewPrefix,
197  Style style = Style::native);
198 
199 /// Remove redundant leading "./" pieces and consecutive separators.
200 ///
201 /// @param path Input path.
202 /// @result The cleaned-up \a path.
204 
205 /// In-place remove any './' and optionally '../' components from a path.
206 ///
207 /// @param path processed path
208 /// @param remove_dot_dot specify if '../' (except for leading "../") should be
209 /// removed
210 /// @result True if path was changed
211 bool remove_dots(SmallVectorImpl<char> &path, bool remove_dot_dot = false,
212  Style style = Style::native);
213 
214 /// Append to path.
215 ///
216 /// @code
217 /// /foo + bar/f => /foo/bar/f
218 /// /foo/ + bar/f => /foo/bar/f
219 /// foo + bar/f => foo/bar/f
220 /// @endcode
221 ///
222 /// @param path Set to \a path + \a component.
223 /// @param a The component to be appended to \a path.
224 void append(SmallVectorImpl<char> &path, const Twine &a,
225  const Twine &b = "",
226  const Twine &c = "",
227  const Twine &d = "");
228 
229 void append(SmallVectorImpl<char> &path, Style style, const Twine &a,
230  const Twine &b = "", const Twine &c = "", const Twine &d = "");
231 
232 /// Append to path.
233 ///
234 /// @code
235 /// /foo + [bar,f] => /foo/bar/f
236 /// /foo/ + [bar,f] => /foo/bar/f
237 /// foo + [bar,f] => foo/bar/f
238 /// @endcode
239 ///
240 /// @param path Set to \a path + [\a begin, \a end).
241 /// @param begin Start of components to append.
242 /// @param end One past the end of components to append.
245 
246 /// @}
247 /// @name Transforms (or some other better name)
248 /// @{
249 
250 /// Convert path to the native form. This is used to give paths to users and
251 /// operating system calls in the platform's normal way. For example, on Windows
252 /// all '/' are converted to '\'. On Unix, it converts all '\' to '/'.
253 ///
254 /// @param path A path that is transformed to native format.
255 /// @param result Holds the result of the transformation.
256 void native(const Twine &path, SmallVectorImpl<char> &result,
257  Style style = Style::native);
258 
259 /// Convert path to the native form in place. This is used to give paths to
260 /// users and operating system calls in the platform's normal way. For example,
261 /// on Windows all '/' are converted to '\'.
262 ///
263 /// @param path A path that is transformed to native format.
264 void native(SmallVectorImpl<char> &path, Style style = Style::native);
265 
266 /// For Windows path styles, convert path to use the preferred path separators.
267 /// For other styles, do nothing.
268 ///
269 /// @param path A path that is transformed to preferred format.
271  Style style = Style::native) {
272  if (!is_style_windows(style))
273  return;
274  native(path, style);
275 }
276 
277 /// Replaces backslashes with slashes if Windows.
278 ///
279 /// @param path processed path
280 /// @result The result of replacing backslashes with forward slashes if Windows.
281 /// On Unix, this function is a no-op because backslashes are valid path
282 /// chracters.
283 std::string convert_to_slash(StringRef path, Style style = Style::native);
284 
285 /// @}
286 /// @name Lexical Observers
287 /// @{
288 
289 /// Get root name.
290 ///
291 /// @code
292 /// //net/hello => //net
293 /// c:/hello => c: (on Windows, on other platforms nothing)
294 /// /hello => <empty>
295 /// @endcode
296 ///
297 /// @param path Input path.
298 /// @result The root name of \a path if it has one, otherwise "".
300 
301 /// Get root directory.
302 ///
303 /// @code
304 /// /goo/hello => /
305 /// c:/hello => /
306 /// d/file.txt => <empty>
307 /// @endcode
308 ///
309 /// @param path Input path.
310 /// @result The root directory of \a path if it has one, otherwise
311 /// "".
313 
314 /// Get root path.
315 ///
316 /// Equivalent to root_name + root_directory.
317 ///
318 /// @param path Input path.
319 /// @result The root path of \a path if it has one, otherwise "".
321 
322 /// Get relative path.
323 ///
324 /// @code
325 /// C:\hello\world => hello\world
326 /// foo/bar => foo/bar
327 /// /foo/bar => foo/bar
328 /// @endcode
329 ///
330 /// @param path Input path.
331 /// @result The path starting after root_path if one exists, otherwise "".
333 
334 /// Get parent path.
335 ///
336 /// @code
337 /// / => <empty>
338 /// /foo => /
339 /// foo/../bar => foo/..
340 /// @endcode
341 ///
342 /// @param path Input path.
343 /// @result The parent path of \a path if one exists, otherwise "".
345 
346 /// Get filename.
347 ///
348 /// @code
349 /// /foo.txt => foo.txt
350 /// . => .
351 /// .. => ..
352 /// / => /
353 /// @endcode
354 ///
355 /// @param path Input path.
356 /// @result The filename part of \a path. This is defined as the last component
357 /// of \a path. Similar to the POSIX "basename" utility.
359 
360 /// Get stem.
361 ///
362 /// If filename contains a dot but not solely one or two dots, result is the
363 /// substring of filename ending at (but not including) the last dot. Otherwise
364 /// it is filename.
365 ///
366 /// @code
367 /// /foo/bar.txt => bar
368 /// /foo/bar => bar
369 /// /foo/.txt => <empty>
370 /// /foo/. => .
371 /// /foo/.. => ..
372 /// @endcode
373 ///
374 /// @param path Input path.
375 /// @result The stem of \a path.
377 
378 /// Get extension.
379 ///
380 /// If filename contains a dot but not solely one or two dots, result is the
381 /// substring of filename starting at (and including) the last dot, and ending
382 /// at the end of \a path. Otherwise "".
383 ///
384 /// @code
385 /// /foo/bar.txt => .txt
386 /// /foo/bar => <empty>
387 /// /foo/.txt => .txt
388 /// @endcode
389 ///
390 /// @param path Input path.
391 /// @result The extension of \a path.
393 
394 /// Check whether the given char is a path separator on the host OS.
395 ///
396 /// @param value a character
397 /// @result true if \a value is a path separator character on the host OS
398 bool is_separator(char value, Style style = Style::native);
399 
400 /// Return the preferred separator for this platform.
401 ///
402 /// @result StringRef of the preferred separator, null-terminated.
404 
405 /// Get the typical temporary directory for the system, e.g.,
406 /// "/var/tmp" or "C:/TEMP"
407 ///
408 /// @param erasedOnReboot Whether to favor a path that is erased on reboot
409 /// rather than one that potentially persists longer. This parameter will be
410 /// ignored if the user or system has set the typical environment variable
411 /// (e.g., TEMP on Windows, TMPDIR on *nix) to specify a temporary directory.
412 ///
413 /// @param result Holds the resulting path name.
414 void system_temp_directory(bool erasedOnReboot, SmallVectorImpl<char> &result);
415 
416 /// Get the user's home directory.
417 ///
418 /// @param result Holds the resulting path name.
419 /// @result True if a home directory is set, false otherwise.
421 
422 /// Get the directory where packages should read user-specific configurations.
423 /// e.g. $XDG_CONFIG_HOME.
424 ///
425 /// @param result Holds the resulting path name.
426 /// @result True if the appropriate path was determined, it need not exist.
428 
429 /// Get the directory where installed packages should put their
430 /// machine-local cache, e.g. $XDG_CACHE_HOME.
431 ///
432 /// @param result Holds the resulting path name.
433 /// @result True if the appropriate path was determined, it need not exist.
435 
436 /// Has root name?
437 ///
438 /// root_name != ""
439 ///
440 /// @param path Input path.
441 /// @result True if the path has a root name, false otherwise.
442 bool has_root_name(const Twine &path, Style style = Style::native);
443 
444 /// Has root directory?
445 ///
446 /// root_directory != ""
447 ///
448 /// @param path Input path.
449 /// @result True if the path has a root directory, false otherwise.
450 bool has_root_directory(const Twine &path, Style style = Style::native);
451 
452 /// Has root path?
453 ///
454 /// root_path != ""
455 ///
456 /// @param path Input path.
457 /// @result True if the path has a root path, false otherwise.
458 bool has_root_path(const Twine &path, Style style = Style::native);
459 
460 /// Has relative path?
461 ///
462 /// relative_path != ""
463 ///
464 /// @param path Input path.
465 /// @result True if the path has a relative path, false otherwise.
466 bool has_relative_path(const Twine &path, Style style = Style::native);
467 
468 /// Has parent path?
469 ///
470 /// parent_path != ""
471 ///
472 /// @param path Input path.
473 /// @result True if the path has a parent path, false otherwise.
474 bool has_parent_path(const Twine &path, Style style = Style::native);
475 
476 /// Has filename?
477 ///
478 /// filename != ""
479 ///
480 /// @param path Input path.
481 /// @result True if the path has a filename, false otherwise.
482 bool has_filename(const Twine &path, Style style = Style::native);
483 
484 /// Has stem?
485 ///
486 /// stem != ""
487 ///
488 /// @param path Input path.
489 /// @result True if the path has a stem, false otherwise.
490 bool has_stem(const Twine &path, Style style = Style::native);
491 
492 /// Has extension?
493 ///
494 /// extension != ""
495 ///
496 /// @param path Input path.
497 /// @result True if the path has a extension, false otherwise.
498 bool has_extension(const Twine &path, Style style = Style::native);
499 
500 /// Is path absolute?
501 ///
502 /// According to cppreference.com, C++17 states: "An absolute path is a path
503 /// that unambiguously identifies the location of a file without reference to
504 /// an additional starting location."
505 ///
506 /// In other words, the rules are:
507 /// 1) POSIX style paths with nonempty root directory are absolute.
508 /// 2) Windows style paths with nonempty root name and root directory are
509 /// absolute.
510 /// 3) No other paths are absolute.
511 ///
512 /// \see has_root_name
513 /// \see has_root_directory
514 ///
515 /// @param path Input path.
516 /// @result True if the path is absolute, false if it is not.
517 bool is_absolute(const Twine &path, Style style = Style::native);
518 
519 /// Is path absolute using GNU rules?
520 ///
521 /// GNU rules are:
522 /// 1) Paths starting with a path separator are absolute.
523 /// 2) Windows style paths are also absolute if they start with a character
524 /// followed by ':'.
525 /// 3) No other paths are absolute.
526 ///
527 /// On Windows style the path "C:\Users\Default" has "C:" as root name and "\"
528 /// as root directory.
529 ///
530 /// Hence "C:" on Windows is absolute under GNU rules and not absolute under
531 /// C++17 because it has no root directory. Likewise "/" and "\" on Windows are
532 /// absolute under GNU and are not absolute under C++17 due to empty root name.
533 ///
534 /// \see has_root_name
535 /// \see has_root_directory
536 ///
537 /// @param path Input path.
538 /// @param style The style of \p path (e.g. Windows or POSIX). "native" style
539 /// means to derive the style from the host.
540 /// @result True if the path is absolute following GNU rules, false if it is
541 /// not.
542 bool is_absolute_gnu(const Twine &path, Style style = Style::native);
543 
544 /// Is path relative?
545 ///
546 /// @param path Input path.
547 /// @result True if the path is relative, false if it is not.
548 bool is_relative(const Twine &path, Style style = Style::native);
549 
550 } // end namespace path
551 } // end namespace sys
552 } // end namespace llvm
553 
554 #endif
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:22
llvm::sys::path::const_iterator::end
friend const_iterator end(StringRef path)
Get end iterator over path.
Definition: Path.cpp:236
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:519
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:591
llvm::sys::path::reverse_iterator::operator-
ptrdiff_t operator-(const reverse_iterator &RHS) const
Difference in bytes between this and RHS.
Definition: Path.cpp:345
llvm::sys::path::rbegin
reverse_iterator rbegin(StringRef path, Style style=Style::native)
Get reverse begin iterator over path.
Definition: Path.cpp:298
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:704
llvm::sys::path::is_absolute
bool is_absolute(const Twine &path, Style style=Style::native)
Is path absolute?
Definition: Path.cpp:672
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:569
llvm::sys::path::reverse_iterator
Reverse path iterator.
Definition: Path.h:100
llvm::sys::path::reverse_iterator::operator*
reference operator*() const
Definition: Path.h:112
llvm::sys::path::end
const_iterator end(StringRef path)
Get end iterator over path.
Definition: Path.cpp:236
llvm::sys::path::begin
const_iterator begin(StringRef path, Style style=Style::native)
Get begin iterator over path.
Definition: Path.cpp:227
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:541
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::Style::windows_backslash
@ windows_backslash
RHS
Value * RHS
Definition: X86PartialReduction.cpp:74
llvm::sys::path::const_iterator::operator-
ptrdiff_t operator-(const const_iterator &RHS) const
Difference in bytes between this and RHS.
Definition: Path.cpp:294
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:457
llvm::sys::path::make_preferred
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:270
ptrdiff_t
llvm::sys::path::has_extension
bool has_extension(const Twine &path, Style style=Style::native)
Has extension?
Definition: Path.cpp:665
llvm::sys::path::has_parent_path
bool has_parent_path(const Twine &path, Style style=Style::native)
Has parent path?
Definition: Path.cpp:651
Twine.h
llvm::sys::path::root_path
StringRef root_path(StringRef path, Style style=Style::native)
Get root path.
Definition: Path.cpp:349
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:658
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:87
llvm::sys::path::is_style_posix
constexpr bool is_style_posix(Style S)
Check if S uses POSIX path rules.
Definition: Path.h:37
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:716
llvm::sys::path::reverse_iterator::operator==
bool operator==(const reverse_iterator &RHS) const
Definition: Path.cpp:340
llvm::sys::path::get_separator
StringRef get_separator(Style style=Style::native)
Return the preferred separator for this platform.
Definition: Path.cpp:610
llvm::sys::path::root_directory
StringRef root_directory(StringRef path, Style style=Style::native)
Get root directory.
Definition: Path.cpp:391
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:481
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:80
llvm::sys::path::reverse_iterator::rend
friend reverse_iterator rend(StringRef path)
Get reverse end iterator over path.
Definition: Path.cpp:307
llvm::sys::path::const_iterator::operator==
bool operator==(const const_iterator &RHS) const
Definition: Path.cpp:290
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:227
llvm::sys::path::parent_path
StringRef parent_path(StringRef path, Style style=Style::native)
Get parent path.
Definition: Path.cpp:468
llvm::sys::path::reverse_iterator::operator++
reverse_iterator & operator++()
Definition: Path.cpp:315
llvm::sys::path::has_filename
bool has_filename(const Twine &path, Style style=Style::native)
Has filename?
Definition: Path.cpp:644
llvm::sys::path::has_relative_path
bool has_relative_path(const Twine &path, Style style=Style::native)
Has relative path?
Definition: Path.cpp:637
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
const_iterator
S
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Definition: README.txt:210
llvm::sys::path::reverse_iterator::rbegin
friend reverse_iterator rbegin(StringRef path, Style style)
Get reverse begin iterator over path.
Definition: Path.cpp:298
llvm::sys::path::const_iterator
Path iterator.
Definition: Path.h:74
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:374
llvm::sys::path::has_root_name
bool has_root_name(const Twine &path, Style style=Style::native)
Has root name?
Definition: Path.cpp:616
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:630
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:682
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:602
llvm::sys::path::const_iterator::operator++
const_iterator & operator++()
Definition: Path.cpp:243
llvm::sys::path::filename
StringRef filename(StringRef path, Style style=Style::native)
Get filename.
Definition: Path.cpp:578
llvm::sys::path::is_style_windows
constexpr bool is_style_windows(Style S)
Check if S uses Windows path rules.
Definition: Path.h:50
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:475
llvm::sys::path::Style::windows_slash
@ windows_slash
llvm::SmallVectorImpl< char >
llvm::sys::path::rend
reverse_iterator rend(StringRef path)
Get reverse end iterator over path.
Definition: Path.cpp:307
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:623
llvm::sys::path::relative_path
StringRef relative_path(StringRef path, Style style=Style::native)
Get relative path.
Definition: Path.cpp:414
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:700
llvm::sys::path::stem
StringRef stem(StringRef path, Style style=Style::native)
Get stem.
Definition: Path.cpp:580