[flang-commits] [flang] [flang][driver] Make the -J option less restrictive so we would not have to struggle with autoconf (PR #110010)
David Spickett via flang-commits
flang-commits at lists.llvm.org
Thu Sep 26 04:31:41 PDT 2024
================
@@ -832,12 +833,15 @@ static bool parseSemaArgs(CompilerInvocation &res, llvm::opt::ArgList &args,
// -J/module-dir option
auto moduleDirList =
args.getAllArgValues(clang::driver::options::OPT_module_dir);
- // User can only specify -J/-module-dir once
+ // User can only specify one -J/-module-dir directory
// https://gcc.gnu.org/onlinedocs/gfortran/Directory-Options.html
+ std::sort(moduleDirList.begin(), moduleDirList.end());
+ moduleDirList.erase(std::unique(moduleDirList.begin(), moduleDirList.end()),
+ moduleDirList.end());
if (moduleDirList.size() > 1) {
const unsigned diagID =
diags.getCustomDiagID(clang::DiagnosticsEngine::Error,
- "Only one '-module-dir/-J' option allowed");
+ "Only one '-module-dir/-J' directory allowed");
----------------
DavidSpickett wrote:
Ofc someone will wonder why this is allowed at all, but this is not worth explaining in the error message.
https://github.com/llvm/llvm-project/pull/110010
More information about the flang-commits
mailing list