summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2010-12-01 00:52:28 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2010-12-01 00:52:28 +0000
commit9c594095a6134e061cf7db68d1b0ca988732ac32 (patch)
tree88551fb1fdf3b2e1aaeb03d9382716093982f2ec /llvm/lib/Support
parent4915f566691e539268c2f6ea47ea9abb5a4b8401 (diff)
downloadbcm5719-llvm-9c594095a6134e061cf7db68d1b0ca988732ac32.tar.gz
bcm5719-llvm-9c594095a6134e061cf7db68d1b0ca988732ac32.zip
Support/PathV2: Add remove_filename implementation.
llvm-svn: 120513
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r--llvm/lib/Support/PathV2.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Support/PathV2.cpp b/llvm/lib/Support/PathV2.cpp
index a97f3ec711f..df401bd46ba 100644
--- a/llvm/lib/Support/PathV2.cpp
+++ b/llvm/lib/Support/PathV2.cpp
@@ -503,6 +503,14 @@ error_code parent_path(const StringRef &path, StringRef &result) {
return make_error_code(errc::success);
}
+error_code remove_filename(SmallVectorImpl<char> &path) {
+ size_t end_pos = parent_path_end(StringRef(path.begin(), path.size()));
+ if (end_pos == StringRef::npos)
+ return make_error_code(errc::success);
+ path.set_size(end_pos);
+ return make_error_code(errc::success);
+}
+
}
}
}
OpenPOWER on IntegriCloud