6 #ifndef JLM_TOOLING_COMMAND_HPP
7 #define JLM_TOOLING_COMMAND_HPP
18 class LlvmRvsdgModule;
34 [[nodiscard]]
virtual std::string
63 [[nodiscard]] std::string
69 static std::unique_ptr<CommandGraph>
70 Create(std::unique_ptr<CommandGraph> commandGraph);
76 auto command = std::make_unique<PrintCommandsCommand>(std::move(printedCommandGraph));
111 std::vector<util::FilePath> inputFiles,
113 std::vector<std::string> libraryPaths,
114 std::vector<std::string> libraries,
134 std::vector<std::string> includePaths,
135 std::vector<std::string> macroDefinitions,
136 std::vector<std::string> warnings,
137 std::vector<std::string> flags,
145 std::vector<ClangArgument> clangArguments)
164 [[nodiscard]] std::string
173 [[nodiscard]]
const std::vector<util::FilePath> &
182 const std::vector<util::FilePath> & inputFiles,
184 const std::vector<std::string> & libraryPaths,
185 const std::vector<std::string> & libraries,
188 std::unique_ptr<ClangCommand> command(
189 new ClangCommand(inputFiles, outputFile, libraryPaths, libraries, usePthreads));
199 const std::vector<std::string> & includePaths,
200 const std::vector<std::string> & macroDefinitions,
201 const std::vector<std::string> & warnings,
202 const std::vector<std::string> & flags,
208 const std::string & mT,
210 const std::vector<ClangArgument> & clangArguments)
239 ReplaceAll(std::string str,
const std::string & from,
const std::string & to);
298 [[nodiscard]] std::string
315 std::unique_ptr<LlcCommand> command(
316 new LlcCommand(inputFile, outputFile, optimizationLevel, relocationModel));
343 [[nodiscard]] std::string
347 Run()
const override;
352 std::string programName,
356 std::make_unique<JlmOptCommand>(std::move(programName), std::move(commandLineOptions));
374 std::unique_ptr<llvm::LlvmRvsdgModule>
380 std::unique_ptr<llvm::LlvmRvsdgModule>
384 std::unique_ptr<llvm::LlvmRvsdgModule>
424 [[nodiscard]] std::vector<std::shared_ptr<rvsdg::Transformation>>
427 [[nodiscard]] std::shared_ptr<rvsdg::Transformation>
443 :
Path_(std::move(path))
446 [[nodiscard]] std::string
450 Run()
const override;
455 std::unique_ptr<MkdirCommand> command(
new MkdirCommand(path));
477 util::FilePath inputFile,
478 util::FilePath outputFile,
479 bool writeLlvmAssembly,
487 [[nodiscard]] std::string
501 bool writeLlvmAssembly,
502 const std::vector<Optimization> & optimizations)
504 std::unique_ptr<LlvmOptCommand> command(
505 new LlvmOptCommand(inputFile, outputFile, writeLlvmAssembly, optimizations));
530 std::vector<util::FilePath> inputFiles,
531 util::FilePath outputFile,
532 bool writeLlvmAssembly,
540 [[nodiscard]] std::string
549 [[nodiscard]]
const std::vector<util::FilePath> &
558 const std::vector<util::FilePath> & inputFiles,
560 bool writeLlvmAssembly,
563 std::unique_ptr<LlvmLinkCommand> command(
564 new LlvmLinkCommand(inputFiles, outputFile, writeLlvmAssembly, verbose));
585 util::FilePath inputFile,
586 util::FilePath outputFolder,
587 std::vector<std::
string> options)
593 [[nodiscard]] std::string
631 const std::vector<std::string> & options)
633 auto command = std::make_unique<JlmHlsCommand>(inputFile, outputFolder, options);
653 util::FilePath inputFile,
654 util::FilePath outputFolder,
655 std::
string hlsFunctionName)
661 [[nodiscard]] std::string
682 [[nodiscard]]
const std::string &
692 const std::string & hlsFunctionName,
695 std::unique_ptr<JlmHlsExtractCommand> command(
FilePath WithSuffix(const std::string &suffix) const
Global memory state passed between functions.