From 6d4b7e7e83e1b1ef8cd9222c6325301ca30f4214 Mon Sep 17 00:00:00 2001 From: "Michael J. Spencer" Date: Mon, 20 Dec 2010 13:30:28 +0000 Subject: [PATCH] Support/PathV2: Add missing has_relative_path impl. llvm-svn: 122243 --- llvm/lib/Support/PathV2.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/llvm/lib/Support/PathV2.cpp b/llvm/lib/Support/PathV2.cpp index 6d2ca4eecd06..335f7ff91944 100644 --- a/llvm/lib/Support/PathV2.cpp +++ b/llvm/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);