diff --git a/flang/tools/f18/f18.cpp b/flang/tools/f18/f18.cpp --- a/flang/tools/f18/f18.cpp +++ b/flang/tools/f18/f18.cpp @@ -101,8 +101,8 @@ bool debugNoSemantics{false}; bool debugModuleWriter{false}; bool measureTree{false}; - bool unparseTypedExprsToPGF90{false}; - std::vector pgf90Args; + bool unparseTypedExprsToF18_FC{false}; + std::vector F18_FCArgs; const char *prefix{nullptr}; bool getDefinition{false}; GetDefinitionArgs getDefinitionArgs{0, 0, 0}; @@ -137,8 +137,8 @@ void RunOtherCompiler(DriverOptions &driver, char *source, char *relo) { std::vector argv; - for (size_t j{0}; j < driver.pgf90Args.size(); ++j) { - argv.push_back(driver.pgf90Args[j].data()); + for (size_t j{0}; j < driver.F18_FCArgs.size(); ++j) { + argv.push_back(driver.F18_FCArgs[j].data()); } char dashC[3] = "-c", dashO[3] = "-o"; argv.push_back(dashC); @@ -342,7 +342,7 @@ options.features.IsEnabled( Fortran::common::LanguageFeature::BackslashEscapes), nullptr /* action before each statement */, - driver.unparseTypedExprsToPGF90 ? &asFortran : nullptr); + driver.unparseTypedExprsToF18_FC ? &asFortran : nullptr); } if (ParentProcess()) { @@ -371,8 +371,8 @@ void Link(std::vector &relocatables, DriverOptions &driver) { if (!ParentProcess()) { std::vector argv; - for (size_t j{0}; j < driver.pgf90Args.size(); ++j) { - argv.push_back(driver.pgf90Args[j].data()); + for (size_t j{0}; j < driver.F18_FCArgs.size(); ++j) { + argv.push_back(driver.F18_FCArgs[j].data()); } for (auto &relo : relocatables) { argv.push_back(relo.data()); @@ -391,9 +391,9 @@ atexit(CleanUpAtExit); DriverOptions driver; - const char *pgf90{getenv("F18_FC")}; - driver.pgf90Args.push_back(pgf90 ? pgf90 : "pgf90"); - bool isPGF90{driver.pgf90Args.back().rfind("pgf90") != std::string::npos}; + const char *F18_FC{getenv("F18_FC")}; + driver.F18_FCArgs.push_back(F18_FC ? F18_FC : "gfortran"); + bool isPGF90{driver.F18_FCArgs.back().rfind("pgf90") != std::string::npos}; std::list args{argList(argc, argv)}; std::string prefix{args.front()}; @@ -423,7 +423,7 @@ anyFiles = true; auto dot{arg.rfind(".")}; if (dot == std::string::npos) { - driver.pgf90Args.push_back(arg); + driver.F18_FCArgs.push_back(arg); } else { std::string suffix{arg.substr(dot + 1)}; if (suffix == "f" || suffix == "F" || suffix == "ff" || @@ -510,8 +510,8 @@ driver.dumpUnparse = true; } else if (arg == "-funparse-with-symbols") { driver.dumpUnparseWithSymbols = true; - } else if (arg == "-funparse-typed-exprs-to-pgf90") { - driver.unparseTypedExprsToPGF90 = true; + } else if (arg == "-funparse-typed-exprs-to-f18-fc") { + driver.unparseTypedExprsToF18_FC = true; } else if (arg == "-fparse-only") { driver.parseOnly = true; } else if (arg == "-c") { @@ -616,11 +616,11 @@ llvm::errs() << "\nf18 compiler (under development)\n"; return exitStatus; } else { - driver.pgf90Args.push_back(arg); + driver.F18_FCArgs.push_back(arg); if (arg == "-v") { driver.verbose = true; } else if (arg == "-I") { - driver.pgf90Args.push_back(args.front()); + driver.F18_FCArgs.push_back(args.front()); driver.searchDirectories.push_back(args.front()); args.pop_front(); } else if (arg.substr(0, 2) == "-I") { @@ -633,19 +633,19 @@ options.features.WarnOnAllNonstandard(); } if (options.features.IsEnabled(Fortran::common::LanguageFeature::OpenMP)) { - driver.pgf90Args.push_back("-mp"); + driver.F18_FCArgs.push_back("-mp"); } if (isPGF90) { if (!options.features.IsEnabled( Fortran::common::LanguageFeature::BackslashEscapes)) { - driver.pgf90Args.push_back( + driver.F18_FCArgs.push_back( "-Mbackslash"); // yes, this *disables* them in pgf90 } Fortran::parser::useHexadecimalEscapeSequences = false; } else { if (options.features.IsEnabled( Fortran::common::LanguageFeature::BackslashEscapes)) { - driver.pgf90Args.push_back("-fbackslash"); + driver.F18_FCArgs.push_back("-fbackslash"); } Fortran::parser::useHexadecimalEscapeSequences = true; }