summaryrefslogtreecommitdiffstats
path: root/lib/Lex
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2019-01-16 09:55:32 +0000
committerPavel Labath <pavel@labath.sk>2019-01-16 09:55:32 +0000
commite054eb577a1f469b1a4a49fce08572c76e2dddf2 (patch)
treef3fcdba7decca7ee845a1bb3f885cb0baa1b4d83 /lib/Lex
parent2e18df9c488cbf1d1979a04e5c6f277bf31e45fb (diff)
[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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351317 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex')
-rw-r--r--lib/Lex/HeaderSearch.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Lex/HeaderSearch.cpp b/lib/Lex/HeaderSearch.cpp
index 5b827b13c0..c65fb47c0f 100644
--- a/lib/Lex/HeaderSearch.cpp
+++ b/lib/Lex/HeaderSearch.cpp
@@ -1678,9 +1678,8 @@ std::string HeaderSearch::suggestPathToFileForDiagnostics(
StringRef Dir = SearchDirs[I].getDir()->getName();
llvm::SmallString<32> DirPath(Dir.begin(), Dir.end());
if (!WorkingDir.empty() && !path::is_absolute(Dir)) {
- auto err = fs::make_absolute(WorkingDir, DirPath);
- if (!err)
- path::remove_dots(DirPath, /*remove_dot_dot=*/true);
+ fs::make_absolute(WorkingDir, DirPath);
+ path::remove_dots(DirPath, /*remove_dot_dot=*/true);
Dir = DirPath;
}
for (auto NI = path::begin(File), NE = path::end(File),