From 1ad53ca2b0114004a3bbaf9fbfe23f51aec0ee67 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Wed, 16 Jan 2019 09:55:32 +0000 Subject: [Support] Remove error return value from one overload of fs::make_absolute Summary: The version of make_absolute which accepted a specific directory to use as the "base" for the computation could never fail, even though it returned a std::error_code. The reason for that seems to be historical -- the CWD flavour (which can fail due to failure to retrieve CWD) was there first, and the new version was implemented by extending that. This removes the error return value from the non-CWD overload and reimplements the CWD version on top of that. This enables us to remove some dead code where people were pessimistically trying to handle the errors returned from this function. Reviewers: zturner, sammccall Subscribers: hiraditya, kristina, llvm-commits Differential Revision: https://reviews.llvm.org/D56599 llvm-svn: 351317 --- llvm/lib/Support/VirtualFileSystem.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Support/VirtualFileSystem.cpp') diff --git a/llvm/lib/Support/VirtualFileSystem.cpp b/llvm/lib/Support/VirtualFileSystem.cpp index 2973027..f2a8a1b 100644 --- a/llvm/lib/Support/VirtualFileSystem.cpp +++ b/llvm/lib/Support/VirtualFileSystem.cpp @@ -128,7 +128,8 @@ std::error_code FileSystem::makeAbsolute(SmallVectorImpl &Path) const { if (!WorkingDir) return WorkingDir.getError(); - return llvm::sys::fs::make_absolute(WorkingDir.get(), Path); + llvm::sys::fs::make_absolute(WorkingDir.get(), Path); + return {}; } std::error_code FileSystem::getRealPath(const Twine &Path, -- cgit v1.1