mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 22:24:07 +00:00
Support/PathV2: Add filename implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120546 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -553,6 +553,11 @@ error_code native(const Twine &path, SmallVectorImpl<char> &result) {
|
|||||||
return make_error_code(errc::success);
|
return make_error_code(errc::success);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
error_code filename(const StringRef &path, StringRef &result) {
|
||||||
|
result = *(--end(path));
|
||||||
|
return make_error_code(errc::success);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -94,6 +94,9 @@ TEST(Support, Path) {
|
|||||||
if (error_code ec = sys::path::parent_path(*i, res))
|
if (error_code ec = sys::path::parent_path(*i, res))
|
||||||
ASSERT_FALSE(ec.message().c_str());
|
ASSERT_FALSE(ec.message().c_str());
|
||||||
outs() << " parent_path: " << res << '\n';
|
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;
|
temp_store = *i;
|
||||||
if (error_code ec = sys::path::make_absolute(temp_store))
|
if (error_code ec = sys::path::make_absolute(temp_store))
|
||||||
|
Reference in New Issue
Block a user