aboutsummaryrefslogtreecommitdiff
path: root/lib/Support
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Support')
-rw-r--r--lib/Support/PathV2.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Support/PathV2.cpp b/lib/Support/PathV2.cpp
index 6d2ca4eecd..335f7ff919 100644
--- a/lib/Support/PathV2.cpp
+++ b/lib/Support/PathV2.cpp
@@ -502,6 +502,13 @@ bool has_root_path(const Twine &path) {
return !root_path(p).empty();
}
+bool has_relative_path(const Twine &path) {
+ SmallString<128> path_storage;
+ StringRef p = path.toStringRef(path_storage);
+
+ return !relative_path(p).empty();
+}
+
bool has_filename(const Twine &path) {
SmallString<128> path_storage;
StringRef p = path.toStringRef(path_storage);