diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2017-08-09 22:06:32 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2017-08-09 22:06:32 +0000 |
commit | 324d96b83aa5cd3a828fd8d243f71d9862246211 (patch) | |
tree | cbdaa70615553fea131be3ab549f0aa2b753e3cf /llvm/lib/Support/Path.cpp | |
parent | 7377525fce08d0035b8b6e73796ffc4bee1f661d (diff) | |
download | bcm5719-llvm-324d96b83aa5cd3a828fd8d243f71d9862246211.tar.gz bcm5719-llvm-324d96b83aa5cd3a828fd8d243f71d9862246211.zip |
[Path] Sink predicate computations to their uses. NFCI.
llvm-svn: 310531
Diffstat (limited to 'llvm/lib/Support/Path.cpp')
-rw-r--r-- | llvm/lib/Support/Path.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Support/Path.cpp b/llvm/lib/Support/Path.cpp index ea59ba62d7b..f30e8a8b0cb 100644 --- a/llvm/lib/Support/Path.cpp +++ b/llvm/lib/Support/Path.cpp @@ -439,10 +439,6 @@ void append(SmallVectorImpl<char> &path, Style style, const Twine &a, for (auto &component : components) { bool path_has_sep = !path.empty() && is_separator(path[path.size() - 1], style); - bool component_has_sep = - !component.empty() && is_separator(component[0], style); - bool is_root_name = has_root_name(component, style); - if (path_has_sep) { // Strip separators from beginning of component. size_t loc = component.find_first_not_of(separators(style)); @@ -453,7 +449,10 @@ void append(SmallVectorImpl<char> &path, Style style, const Twine &a, continue; } - if (!component_has_sep && !(path.empty() || is_root_name)) { + bool component_has_sep = + !component.empty() && is_separator(component[0], style); + if (!component_has_sep && + !(path.empty() || has_root_name(component, style))) { // Add a separator. path.push_back(preferred_separator(style)); } |