OSDN Git Service

Support/PathV2: Add missing has_relative_path impl.
authorMichael J. Spencer <bigcheesegs@gmail.com>
Mon, 20 Dec 2010 13:30:28 +0000 (13:30 +0000)
committerMichael J. Spencer <bigcheesegs@gmail.com>
Mon, 20 Dec 2010 13:30:28 +0000 (13:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122243 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/PathV2.cpp

index 6d2ca4e..335f7ff 100644 (file)
@@ -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);