Support/PathV2: Add filename implementation.

llvm-svn: 120546
This commit is contained in:
Michael J. Spencer 2010-12-01 03:18:17 +00:00
parent 6ab610ce57
commit 142692006b
2 changed files with 8 additions and 0 deletions

View File

@ -553,6 +553,11 @@ error_code native(const Twine &path, SmallVectorImpl<char> &result) {
return make_error_code(errc::success);
}
error_code filename(const StringRef &path, StringRef &result) {
result = *(--end(path));
return make_error_code(errc::success);
}
}
}
}

View File

@ -94,6 +94,9 @@ TEST(Support, Path) {
if (error_code ec = sys::path::parent_path(*i, res))
ASSERT_FALSE(ec.message().c_str());
outs() << " parent_path: " << res << '\n';
if (error_code ec = sys::path::filename(*i, res))
ASSERT_FALSE(ec.message().c_str());
outs() << " filename: " << res << '\n';
temp_store = *i;
if (error_code ec = sys::path::make_absolute(temp_store))