Lines Matching full:driver

9 // Temporary Fortran front end driver main program for development scaffolding.
133 void RunOtherCompiler(DriverOptions &driver, char *source, char *relo) { in RunOtherCompiler() argument
135 for (size_t j{0}; j < driver.F18_FCArgs.size(); ++j) { in RunOtherCompiler()
136 argv.push_back(driver.F18_FCArgs[j]); in RunOtherCompiler()
143 Exec(argv, driver.verbose); in RunOtherCompiler()
146 std::string RelocatableName(const DriverOptions &driver, std::string path) { in RelocatableName() argument
147 if (driver.compileOnly && !driver.outputPath.empty()) { in RelocatableName()
148 return driver.outputPath; in RelocatableName()
188 DriverOptions &driver, in CompileFortran() argument
192 allSources.set_encoding(driver.encoding); in CompileFortran()
195 semanticsContext.set_moduleDirectory(driver.moduleDirectory) in CompileFortran()
196 .set_moduleFileSuffix(driver.moduleFileSuffix) in CompileFortran()
197 .set_searchDirectories(driver.searchDirectories) in CompileFortran()
198 .set_warnOnNonstandardUsage(driver.warnOnNonstandardUsage) in CompileFortran()
199 .set_warningsAreErrors(driver.warningsAreErrors); in CompileFortran()
200 if (!driver.forcedForm) { in CompileFortran()
207 options.searchDirectories = driver.searchDirectories; in CompileFortran()
211 (driver.warningsAreErrors || parsing.messages().AnyFatalError())) { in CompileFortran()
212 llvm::errs() << driver.prefix << "could not scan " << path << '\n'; in CompileFortran()
217 if (driver.dumpProvenance) { in CompileFortran()
221 if (driver.dumpCookedChars) { in CompileFortran()
240 (driver.warningsAreErrors || parsing.messages().AnyFatalError())) || in CompileFortran()
242 llvm::errs() << driver.prefix << "could not parse " << path << '\n'; in CompileFortran()
247 if (driver.measureTree) { in CompileFortran()
250 if (!driver.debugNoSemantics || driver.dumpSymbols || in CompileFortran()
251 driver.dumpUnparseWithSymbols || driver.getDefinition || in CompileFortran()
252 driver.getSymbolsSources) { in CompileFortran()
254 parsing.cooked().AsCharBlock(), driver.debugModuleWriter}; in CompileFortran()
258 if (driver.dumpSymbols) { in CompileFortran()
261 llvm::errs() << driver.prefix << "semantic errors in " << path << '\n'; in CompileFortran()
263 if (driver.dumpParseTree) { in CompileFortran()
271 llvm::errs() << driver.prefix in CompileFortran()
274 if (driver.dumpSymbols) { in CompileFortran()
277 if (driver.dumpUnparseWithSymbols) { in CompileFortran()
279 llvm::outs(), parseTree, driver.encoding); in CompileFortran()
282 if (driver.getSymbolsSources) { in CompileFortran()
286 if (driver.getDefinition) { in CompileFortran()
288 driver.getDefinitionArgs.line, in CompileFortran()
289 driver.getDefinitionArgs.startColumn, in CompileFortran()
290 driver.getDefinitionArgs.endColumn)}) { in CompileFortran()
312 if (driver.dumpParseTree) { in CompileFortran()
315 if (driver.dumpUnparse) { in CompileFortran()
316 Unparse(llvm::outs(), parseTree, driver.encoding, true /*capitalize*/, in CompileFortran()
322 if (driver.dumpPreFirTree) { in CompileFortran()
330 if (driver.parseOnly) { in CompileFortran()
334 std::string relo{RelocatableName(driver, path)}; in CompileFortran()
346 Unparse(tmpSource, parseTree, driver.encoding, true /*capitalize*/, in CompileFortran()
350 driver.unparseTypedExprsToF18_FC ? &asFortran : nullptr); in CompileFortran()
353 RunOtherCompiler(driver, tmpSourcePath.data(), relo.data()); in CompileFortran()
355 if (!driver.compileOnly && driver.outputPath.empty()) { in CompileFortran()
361 std::string CompileOtherLanguage(std::string path, DriverOptions &driver) { in CompileOtherLanguage() argument
362 std::string relo{RelocatableName(driver, path)}; in CompileOtherLanguage()
363 RunOtherCompiler(driver, path.data(), relo.data()); in CompileOtherLanguage()
364 if (!driver.compileOnly && driver.outputPath.empty()) { in CompileOtherLanguage()
371 DriverOptions &driver) { in Link() argument
373 for (size_t j{0}; j < driver.F18_FCArgs.size(); ++j) { in Link()
374 argv.push_back(driver.F18_FCArgs[j].data()); in Link()
379 if (!driver.outputPath.empty()) { in Link()
382 argv.push_back(driver.outputPath.data()); in Link()
387 Exec(argv, driver.verbose); in Link()
401 DriverOptions driver; in main() local
403 driver.F18_FCArgs.push_back(F18_FC ? F18_FC : "gfortran"); in main()
404 bool isPGF90{driver.F18_FCArgs.back().rfind("pgf90") != std::string::npos}; in main()
411 driver.prefix = prefix.data(); in main()
442 driver.F18_FCArgs.push_back(arg); in main()
469 driver.forcedForm = true; in main()
472 driver.forcedForm = true; in main()
489 driver.warnOnNonstandardUsage = true; in main()
497 driver.warningsAreErrors = true; in main()
501 driver.dumpCookedChars = true; in main()
521 driver.dumpProvenance = true; in main()
524 driver.dumpParseTree = true; in main()
526 driver.dumpPreFirTree = true; in main()
528 driver.dumpSymbols = true; in main()
530 driver.debugModuleWriter = true; in main()
532 driver.measureTree = true; in main()
536 driver.debugNoSemantics = true; in main()
538 driver.dumpUnparse = true; in main()
540 driver.dumpUnparseWithSymbols = true; in main()
542 driver.unparseTypedExprsToF18_FC = true; in main()
544 driver.parseOnly = true; in main()
546 driver.compileOnly = true; in main()
548 driver.outputPath = args.front(); in main()
570 driver.F18_FCArgs.push_back("-i8"); in main()
572 driver.F18_FCArgs.push_back("-fdefault-integer-8"); in main()
579 driver.moduleDirectory = args.front(); in main()
582 driver.moduleFileSuffix = args.front(); in main()
585 driver.searchDirectories.push_back(args.front()); in main()
588 driver.encoding = Fortran::parser::Encoding::UTF_8; in main()
590 driver.encoding = Fortran::parser::Encoding::LATIN_1; in main()
594 driver.getDefinition = true; in main()
610 driver.getDefinitionArgs = {arguments[0], arguments[1], arguments[2]}; in main()
612 driver.getSymbolsSources = true; in main()
614 driver.byteswapio = true; // TODO: Pass to lowering, generate call in main()
671 driver.F18_FCArgs.push_back(arg); in main()
674 driver.verbose = true; in main()
679 driver.F18_FCArgs.push_back(args.front()); in main()
680 driver.searchDirectories.push_back(args.front()); in main()
683 driver.searchDirectories.push_back(arg.substr(2)); in main()
688 if (driver.warnOnNonstandardUsage) { in main()
694 driver.F18_FCArgs.push_back( in main()
698 driver.F18_FCArgs.push_back("-mp"); in main()
705 driver.F18_FCArgs.push_back("-fbackslash"); in main()
708 driver.F18_FCArgs.push_back("-fopenmp"); in main()
715 driver.measureTree = true; in main()
716 driver.dumpUnparse = true; in main()
719 CompileFortran("-", options, driver, defaultKinds); in main()
723 std::string relo{CompileFortran(path, options, driver, defaultKinds)}; in main()
724 if (!driver.compileOnly && !relo.empty()) { in main()
729 std::string relo{CompileOtherLanguage(path, driver)}; in main()
730 if (!driver.compileOnly && !relo.empty()) { in main()
734 if (!driver.compileOnly && !objlist.empty()) { in main()
735 Link(liblist, objlist, driver); in main()