diff options
author | Serge Pavlov <sepavloff@gmail.com> | 2022-10-31 08:59:15 +0300 |
---|---|---|
committer | Serge Pavlov <sepavloff@gmail.com> | 2022-10-31 11:36:41 +0300 |
commit | fd3d7a9f8cbb5ad81fb96d92d5f7b1d51a4d4127 (patch) | |
tree | 085b3e47f468106d61b52a438fb1617156afd46f /flang | |
parent | 1af81ab4846f0d07d3ac3079f95d66779a4d9430 (diff) |
Handle errors in expansion of response files
Previously an error raised during an expansion of response files (including
configuration files) was ignored and only the fact of its presence was
reported to the user with generic error messages. This made it difficult to
analyze problems. For example, if a configuration file tried to read an
inexistent file, the error message said that 'configuration file cannot
be found', which is wrong and misleading.
This change enhances handling errors in the expansion so that users
could get more informative error messages.
Differential Revision: https://reviews.llvm.org/D136090
Diffstat (limited to 'flang')
-rw-r--r-- | flang/tools/flang-driver/driver.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/flang/tools/flang-driver/driver.cpp b/flang/tools/flang-driver/driver.cpp index 3ab6fc620501..28a8db2584b5 100644 --- a/flang/tools/flang-driver/driver.cpp +++ b/flang/tools/flang-driver/driver.cpp @@ -77,7 +77,9 @@ static void ExpandResponseFiles( // We're defaulting to the GNU syntax, since we don't have a CL mode. llvm::cl::TokenizerCallback tokenizer = &llvm::cl::TokenizeGNUCommandLine; llvm::cl::ExpansionContext ExpCtx(saver.getAllocator(), tokenizer); - ExpCtx.expandResponseFiles(args); + if (llvm::Error Err = ExpCtx.expandResponseFiles(args)) { + llvm::errs() << toString(std::move(Err)) << '\n'; + } } int main(int argc, const char **argv) { |