Lines Matching full:driver
21 // scaffolding compiler driver that can test some semantic passes of the
119 void RunOtherCompiler(DriverOptions &driver, char *source, char *relo) { in RunOtherCompiler() argument
121 for (size_t j{0}; j < driver.fcArgs.size(); ++j) { in RunOtherCompiler()
122 argv.push_back(driver.fcArgs[j]); in RunOtherCompiler()
129 Exec(argv, driver.verbose); in RunOtherCompiler()
132 std::string RelocatableName(const DriverOptions &driver, std::string path) { in RelocatableName() argument
133 if (driver.compileOnly && !driver.outputPath.empty()) { in RelocatableName()
134 return driver.outputPath; in RelocatableName()
153 std::string path, Fortran::parser::Options options, DriverOptions &driver) { in CompileFortran() argument
154 if (!driver.forcedForm) { in CompileFortran()
161 options.searchDirectories = driver.searchDirectories; in CompileFortran()
169 (driver.warningsAreErrors || parsing.messages().AnyFatalError())) { in CompileFortran()
170 llvm::errs() << driver.prefix << "could not scan " << path << '\n'; in CompileFortran()
175 if (driver.dumpProvenance) { in CompileFortran()
179 if (driver.dumpCookedChars) { in CompileFortran()
185 if (driver.timeParse) { in CompileFortran()
203 (driver.warningsAreErrors || parsing.messages().AnyFatalError())) || in CompileFortran()
205 llvm::errs() << driver.prefix << "could not parse " << path << '\n'; in CompileFortran()
210 if (driver.dumpParseTree) { in CompileFortran()
214 if (driver.dumpUnparse) { in CompileFortran()
215 Unparse(llvm::outs(), parseTree, driver.encoding, true /*capitalize*/, in CompileFortran()
220 if (driver.parseOnly) { in CompileFortran()
224 std::string relo{RelocatableName(driver, path)}; in CompileFortran()
236 Unparse(tmpSource, parseTree, driver.encoding, true /*capitalize*/, in CompileFortran()
241 RunOtherCompiler(driver, tmpSourcePath.data(), relo.data()); in CompileFortran()
243 if (!driver.compileOnly && driver.outputPath.empty()) { in CompileFortran()
249 std::string CompileOtherLanguage(std::string path, DriverOptions &driver) { in CompileOtherLanguage() argument
250 std::string relo{RelocatableName(driver, path)}; in CompileOtherLanguage()
251 RunOtherCompiler(driver, path.data(), relo.data()); in CompileOtherLanguage()
252 if (!driver.compileOnly && driver.outputPath.empty()) { in CompileOtherLanguage()
258 void Link(std::vector<std::string> &relocatables, DriverOptions &driver) { in Link() argument
260 for (size_t j{0}; j < driver.fcArgs.size(); ++j) { in Link()
261 argv.push_back(driver.fcArgs[j].data()); in Link()
266 if (!driver.outputPath.empty()) { in Link()
269 argv.push_back(driver.outputPath.data()); in Link()
271 Exec(argv, driver.verbose); in Link()
278 DriverOptions driver; in main() local
280 driver.fcArgs.push_back(fc ? fc : "gfortran"); in main()
286 driver.prefix = prefix.data(); in main()
310 driver.fcArgs.push_back(arg); in main()
334 driver.forcedForm = true; in main()
337 driver.forcedForm = true; in main()
348 driver.warnOnNonstandardUsage = true; in main()
353 driver.warningsAreErrors = true; in main()
357 driver.dumpCookedChars = true; in main()
365 driver.dumpProvenance = true; in main()
367 driver.dumpParseTree = true; in main()
369 driver.dumpUnparse = true; in main()
371 driver.timeParse = true; in main()
373 driver.parseOnly = true; in main()
375 driver.compileOnly = true; in main()
377 driver.outputPath = args.front(); in main()
421 driver.fcArgs.push_back(arg); in main()
423 driver.verbose = true; in main()
425 driver.fcArgs.push_back(args.front()); in main()
426 driver.searchDirectories.push_back(args.front()); in main()
429 driver.searchDirectories.push_back(arg.substr(2)); in main()
434 if (driver.warnOnNonstandardUsage) { in main()
439 driver.fcArgs.push_back("-fno-backslash"); // PGI "-Mbackslash" in main()
443 driver.dumpUnparse = true; in main()
444 CompileFortran("-", options, driver); in main()
448 std::string relo{CompileFortran(path, options, driver)}; in main()
449 if (!driver.compileOnly && !relo.empty()) { in main()
454 std::string relo{CompileOtherLanguage(path, driver)}; in main()
455 if (!driver.compileOnly && !relo.empty()) { in main()
460 Link(relocatables, driver); in main()