summaryrefslogtreecommitdiffstats
path: root/src/dyndep_parser.cc
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-06-03 21:19:05 (GMT)
committerBrad King <brad.king@kitware.com>2021-06-04 15:17:52 (GMT)
commit91706b323fcb2da9a87656d00ebbaf939ed8dad7 (patch)
treedfea64debf9d986d2f1ec14d525809b03e92c535 /src/dyndep_parser.cc
parentf2f62e295ad1254b7e3cdd5d78fa8afb0e86f1ce (diff)
downloadNinja-91706b323fcb2da9a87656d00ebbaf939ed8dad7.zip
Ninja-91706b323fcb2da9a87656d00ebbaf939ed8dad7.tar.gz
Ninja-91706b323fcb2da9a87656d00ebbaf939ed8dad7.tar.bz2
util: Remove unnecessary CanonicalizePath error handling
Since commit 86f606fe (Remove path component limit from input of CanonicalizePath in windows, 2017-08-30, v1.8.0^2~2^2), the only failure case in the `CanonicalizePath` implementation is the "empty path" error. All call sites have been updated to ensure `CanonicalizePath` is never called with an empty path. Remove error handling from the signature to simplify call sites.
Diffstat (limited to 'src/dyndep_parser.cc')
-rw-r--r--src/dyndep_parser.cc11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/dyndep_parser.cc b/src/dyndep_parser.cc
index 45d1c31..1b4dddd 100644
--- a/src/dyndep_parser.cc
+++ b/src/dyndep_parser.cc
@@ -117,10 +117,8 @@ bool DyndepParser::ParseEdge(string* err) {
string path = out0.Evaluate(&env_);
if (path.empty())
return lexer_.Error("empty path", err);
- string path_err;
uint64_t slash_bits;
- if (!CanonicalizePath(&path, &slash_bits, &path_err))
- return lexer_.Error(path_err, err);
+ CanonicalizePath(&path, &slash_bits);
Node* node = state_->LookupNode(path);
if (!node || !node->in_edge())
return lexer_.Error("no build statement exists for '" + path + "'", err);
@@ -206,10 +204,8 @@ bool DyndepParser::ParseEdge(string* err) {
string path = i->Evaluate(&env_);
if (path.empty())
return lexer_.Error("empty path", err);
- string path_err;
uint64_t slash_bits;
- if (!CanonicalizePath(&path, &slash_bits, &path_err))
- return lexer_.Error(path_err, err);
+ CanonicalizePath(&path, &slash_bits);
Node* n = state_->GetNode(path, slash_bits);
dyndeps->implicit_inputs_.push_back(n);
}
@@ -221,8 +217,7 @@ bool DyndepParser::ParseEdge(string* err) {
return lexer_.Error("empty path", err);
string path_err;
uint64_t slash_bits;
- if (!CanonicalizePath(&path, &slash_bits, &path_err))
- return lexer_.Error(path_err, err);
+ CanonicalizePath(&path, &slash_bits);
Node* n = state_->GetNode(path, slash_bits);
dyndeps->implicit_outputs_.push_back(n);
}