summaryrefslogtreecommitdiff
path: root/lib/Support/PathV2.cpp
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2010-12-20 13:30:28 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2010-12-20 13:30:28 +0000
commit2d484eb88d82aa53db509fca14f36ebe8f108706 (patch)
treeb27df2c0bf63a6fdebf1c5ad194351946ba45748 /lib/Support/PathV2.cpp
parent0d7ce5ffa4aa853b75e1015c62e27bd9f23ef73b (diff)
downloadllvm-2d484eb88d82aa53db509fca14f36ebe8f108706.tar.gz
llvm-2d484eb88d82aa53db509fca14f36ebe8f108706.tar.bz2
llvm-2d484eb88d82aa53db509fca14f36ebe8f108706.tar.xz
Support/PathV2: Add missing has_relative_path impl.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122243 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/PathV2.cpp')
-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);