mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-01 12:24:24 +00:00
Improve sys::Path::makeAbsolute on Win32.
- Patch by Viktor Kutuzov! - Minor tweak by me to add llvm_unreachable calls on FIXMEd error paths. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75424 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -109,6 +109,19 @@ Path::isAbsolute() const {
|
||||
return false;
|
||||
return path[0] == '/';
|
||||
}
|
||||
|
||||
void Path::makeAbsolute() {
|
||||
if (isAbsolute())
|
||||
return;
|
||||
|
||||
Path CWD = Path::GetCurrentDirectory();
|
||||
assert(CWD.isAbsolute() && "GetCurrentDirectory returned relative path!");
|
||||
|
||||
CWD.appendComponent(path);
|
||||
|
||||
path = CWD.toString();
|
||||
}
|
||||
|
||||
Path
|
||||
Path::GetRootDirectory() {
|
||||
Path result;
|
||||
|
Reference in New Issue
Block a user