6 #ifndef JLM_TOOLING_COMMANDLINE_HPP
7 #define JLM_TOOLING_COMMANDLINE_HPP
69 AAAndersenRegionAware,
70 CommonNodeElimination,
74 InvariantValueRedirection,
95 std::vector<OptimizationId> optimizations,
96 const bool dumpRvsdgDotGraphs)
97 : InputFile_(std::move(inputFile)),
98 InputFormat_(inputFormat),
99 OutputFile_(std::move(outputFile)),
100 OutputFormat_(outputFormat),
101 StatisticsCollectorSettings_(std::move(statisticsCollectorSettings)),
102 OptimizationIds_(std::move(optimizations)),
103 RvsdgTreePrinterConfiguration_(std::move(rvsdgTreePrinterConfiguration)),
104 DumpRvsdgDotGraphs_(dumpRvsdgDotGraphs)
108 Reset() noexcept override;
110 [[nodiscard]] const util::FilePath &
111 GetInputFile() const noexcept
116 [[nodiscard]] InputFormat
131 return OutputFormat_;
137 return StatisticsCollectorSettings_;
140 [[nodiscard]]
const std::vector<OptimizationId> &
143 return OptimizationIds_;
149 return RvsdgTreePrinterConfiguration_;
155 return DumpRvsdgDotGraphs_;
158 static OptimizationId
159 FromCommandLineArgumentToOptimizationId(std::string_view commandLineArgument);
162 FromCommandLineArgumentToStatisticsId(std::string_view commandLineArgument);
164 static std::string_view
165 ToCommandLineArgument(OptimizationId optimizationId);
167 static std::string_view
170 static std::string_view
171 ToCommandLineArgument(InputFormat inputFormat);
173 static std::string_view
176 static std::unique_ptr<JlmOptCommandLineOptions>
184 std::vector<OptimizationId> optimizations,
185 bool dumpRvsdgDotGraphs)
187 return std::make_unique<JlmOptCommandLineOptions>(
188 std::move(inputFile),
190 std::move(outputFile),
192 std::move(statisticsCollectorSettings),
193 std::move(rvsdgTreePrinterConfiguration),
194 std::move(optimizations),
209 GetStatisticsIdCommandLineArguments();
211 static const std::unordered_map<OutputFormat, std::string_view> &
212 GetOutputFormatCommandLineArguments();
215 GetOptimizationIdCommandLineMap();
246 : OnlyPrintCommands_(false),
247 GenerateDebugInformation_(false),
258 static std::string_view
259 ToString(
const OptimizationLevel & optimizationLevel);
261 static std::string_view
262 ToString(
const LanguageStandard & languageStandard);
265 Reset() noexcept override;
267 bool OnlyPrintCommands_;
268 bool GenerateDebugInformation_;
279 util::FilePath OutputFile_;
280 std::vector<std::
string> Libraries_;
281 std::vector<std::
string> MacroDefinitions_;
282 std::vector<std::
string> LibraryPaths_;
283 std::vector<std::
string> Warnings_;
284 std::vector<std::
string> IncludePaths_;
285 std::vector<std::
string> Flags_;
287 util::HashSet<util::Statistics::Id> JlmOptPassStatistics_;
300 bool requiresParsing,
301 bool requiresOptimization,
302 bool requiresAssembly,
303 bool requiresLinking)
304 : RequiresLinking_(requiresLinking),
305 RequiresParsing_(requiresParsing),
306 RequiresOptimization_(requiresOptimization),
307 RequiresAssembly_(requiresAssembly),
308 InputFile_(std::move(inputFile)),
309 OutputFile_(std::move(outputFile)),
310 DependencyFile_(std::move(dependencyFile)),
323 return DependencyFile_;
332 [[nodiscard]]
const std::string &
341 OutputFile_ = outputFile;
347 return RequiresParsing_;
353 return RequiresOptimization_;
359 return RequiresAssembly_;
365 return RequiresLinking_;
395 ExtractHlsFunction_(false),
397 dumpRvsdgDotGraphs_(false)
403 Reset() noexcept override;
405 util::FilePath InputFile_;
406 util::FilePath OutputFiles_;
408 std::
string HlsFunction_;
409 bool ExtractHlsFunction_;
410 size_t MemoryLatency_;
411 bool dumpRvsdgDotGraphs_;
445 : OnlyPrintCommands_(false),
446 GenerateDebugInformation_(false),
451 GenerateFirrtl_(false),
460 Reset() noexcept override;
462 bool OnlyPrintCommands_;
463 bool GenerateDebugInformation_;
468 bool GenerateFirrtl_;
475 util::FilePath OutputFile_;
476 std::vector<std::
string> Libraries_;
477 std::vector<std::
string> MacroDefinitions_;
478 std::vector<std::
string> LibraryPaths_;
479 std::vector<std::
string> Warnings_;
480 std::vector<std::
string> IncludePaths_;
481 std::vector<std::
string> Flags_;
482 std::vector<std::
string> JlmHls_;
485 std::
string HlsFunctionRegex_;
500 : RequiresLinking_(link),
501 RequiresParsing_(parse),
502 RequiresOptimization_(optimize),
503 RequiresAssembly_(assemble),
504 InputFile_(std::move(inputFile)),
505 OutputFile_(std::move(outputFile)),
506 DependencyFile_(std::move(dependencyFile)),
519 return DependencyFile_;
528 [[nodiscard]]
const std::string &
537 OutputFile_ = outputFile;
543 return RequiresParsing_;
549 return RequiresOptimization_;
555 return RequiresAssembly_;
561 return RequiresLinking_;
599 ParseCommandLineArguments(
int argc, const
char * const * argv) = 0;
611 ParseCommandLineArguments(
int argc, const
char * const * argv) override;
615 IsObjectFile(const util::FilePath & file)
617 return file.suffix() ==
"o";
644 ParseCommandLineArguments(
int argc, const
char * const * argv) override;
647 Parse(
int argc, const
char * const * argv);
662 ParseCommandLineArguments(
int argc, const
char * const * argv) override;
665 Parse(
int argc, const
char * const * argv);
680 ParseCommandLineArguments(
int argc, const
char * const * argv) override;
683 Parse(
int argc, const
char * const * arv);
687 IsObjectFile(const util::FilePath & file);
689 static util::FilePath
690 CreateObjectFileFromFile(const util::FilePath & f);
692 static util::FilePath
693 CreateDependencyFileFromFile(const util::FilePath & f);
FilePath Join(const std::string &other) const
std::string base() const noexcept
Returns the base name of the file without the path.
FilePath Dirname() const noexcept
Returns the path to the file or directory's parent directory. Emulates the behavior of the GNU coreut...
static std::string ToString(const std::vector< MemoryNodeId > &memoryNodeIds)