diff options
| author | Michael J. Spencer <bigcheesegs@gmail.com> | 2010-12-20 13:30:28 +0000 |
|---|---|---|
| committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2010-12-20 13:30:28 +0000 |
| commit | 6d4b7e7e83e1b1ef8cd9222c6325301ca30f4214 (patch) | |
| tree | 8f3ccf1058e2473c8c3120d06788d18e9472f633 /llvm/lib/Support/PathV2.cpp | |
| parent | 70db5e7cb20e180b9c9973f56bc174778d16863b (diff) | |
| download | llvm-6d4b7e7e83e1b1ef8cd9222c6325301ca30f4214.zip llvm-6d4b7e7e83e1b1ef8cd9222c6325301ca30f4214.tar.gz llvm-6d4b7e7e83e1b1ef8cd9222c6325301ca30f4214.tar.bz2 | |
Support/PathV2: Add missing has_relative_path impl.
llvm-svn: 122243
Diffstat (limited to 'llvm/lib/Support/PathV2.cpp')
| -rw-r--r-- | llvm/lib/Support/PathV2.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Support/PathV2.cpp b/llvm/lib/Support/PathV2.cpp index 6d2ca4e..335f7ff 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); |
