================ @@ -957,6 +957,32 @@ static bool parseDialectArgs(CompilerInvocation &res, llvm::opt::ArgList &args, clang::DiagnosticsEngine &diags) { unsigned numErrorsBefore = diags.getNumErrors(); + // -fd-lines-as-code + if (args.hasArg(clang::driver::options::OPT_fd_lines_as_code)) { + if (res.getFrontendOpts().fortranForm == FortranForm::FreeForm) { + const auto fdLinesAsWarning = diags.getCustomDiagID( + clang::DiagnosticsEngine::Warning, + "‘-fd-lines-as-code’ has no effect in free form."); + diags.Report(fdLinesAsWarning); + } else { + res.getFrontendOpts().features.Enable( + Fortran::common::LanguageFeature::OldDebugLines, true); + } + } + + // -fd-lines-as-comments + if (args.hasArg(clang::driver::options::OPT_fd_lines_as_comments)) { + if (res.getFrontendOpts().fortranForm == FortranForm::FreeForm) { + const auto fdLinesAsWarning = diags.getCustomDiagID( ---------------- tarunprabhu wrote:
Can we use a more concrete type here? https://github.com/llvm/llvm-project/pull/127605 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits