Jlm
Command.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2018 Nico Reißmann <nico.reissmann@gmail.com>
3  * See COPYING for terms of redistribution.
4  */
5 
6 #ifndef JLM_TOOLING_COMMAND_HPP
7 #define JLM_TOOLING_COMMAND_HPP
8 
11 #include <jlm/util/file.hpp>
12 #include <jlm/util/GraphWriter.hpp>
13 
14 #include <memory>
15 #include <string>
16 
17 namespace jlm::llvm
18 {
19 class LlvmRvsdgModule;
20 }
21 
22 namespace jlm::tooling
23 {
24 
30 class Command
31 {
32 public:
33  virtual ~Command();
34 
35  [[nodiscard]] virtual std::string
36  ToString() const = 0;
37 
38  virtual void
39  Run() const;
40 };
41 
45 class PrintCommandsCommand final : public Command
46 {
47 public:
49 
50  explicit PrintCommandsCommand(std::unique_ptr<CommandGraph> commandGraph)
51  : CommandGraph_(std::move(commandGraph))
52  {}
53 
55 
57 
59  operator=(const PrintCommandsCommand &) = delete;
60 
63 
64  [[nodiscard]] std::string
65  ToString() const override;
66 
67  void
68  Run() const override;
69 
70  static std::unique_ptr<CommandGraph>
71  Create(std::unique_ptr<CommandGraph> commandGraph);
72 
73 private:
74  static CommandGraph::Node &
75  Create(CommandGraph & commandGraph, std::unique_ptr<CommandGraph> printedCommandGraph)
76  {
77  auto command = std::make_unique<PrintCommandsCommand>(std::move(printedCommandGraph));
78  return CommandGraph::Node::Create(commandGraph, std::move(command));
79  }
80 
81  std::unique_ptr<CommandGraph> CommandGraph_;
82 };
83 
87 class ClangCommand final : public Command
88 {
89 public:
90  enum class LanguageStandard
91  {
93  Gnu89,
94  Gnu99,
95  C89,
96  C99,
97  C11,
98  Cpp98,
99  Cpp03,
100  Cpp11,
101  Cpp14
102  };
103 
104  enum class ClangArgument
105  {
107  };
108 
109  ~ClangCommand() override;
110 
112  std::vector<util::FilePath> inputFiles,
113  util::FilePath outputFile,
114  std::vector<std::string> libraryPaths,
115  std::vector<std::string> libraries,
116  bool usePthreads)
117  : InputFiles_(std::move(inputFiles)),
118  OutputFile_(std::move(outputFile)),
119  DependencyFile_(""),
120  Libraries_(std::move(libraries)),
121  LibraryPaths_(std::move(libraryPaths)),
122  UsePthreads_(usePthreads),
123  Verbose_(false),
124  Rdynamic_(false),
125  Suppress_(false),
126  Md_(false),
127  LanguageStandard_(LanguageStandard::Unspecified),
128  LinkerCommand_(true)
129  {}
130 
132  const util::FilePath & inputFile,
133  util::FilePath outputFile,
134  util::FilePath dependencyFile,
135  std::vector<std::string> includePaths,
136  std::vector<std::string> macroDefinitions,
137  std::vector<std::string> warnings,
138  std::vector<std::string> flags,
139  bool verbose,
140  bool rdynamic,
141  bool suppress,
142  bool usePthreads,
143  bool mD,
144  std::string mT,
145  const LanguageStandard & languageStandard,
146  std::vector<ClangArgument> clangArguments)
147  : InputFiles_({ inputFile }),
148  OutputFile_(std::move(outputFile)),
149  DependencyFile_(std::move(dependencyFile)),
150  IncludePaths_(std::move(includePaths)),
151  MacroDefinitions_(std::move(macroDefinitions)),
152  Warnings_(std::move(warnings)),
153  Flags_(std::move(flags)),
154  UsePthreads_(usePthreads),
155  Verbose_(verbose),
156  Rdynamic_(rdynamic),
157  Suppress_(suppress),
158  Md_(mD),
159  Mt_(std::move(mT)),
160  LanguageStandard_(languageStandard),
161  ClangArguments_(std::move(clangArguments)),
162  LinkerCommand_(false)
163  {}
164 
165  [[nodiscard]] std::string
166  ToString() const override;
167 
168  [[nodiscard]] const util::FilePath &
169  OutputFile() const noexcept
170  {
171  return OutputFile_;
172  }
173 
174  [[nodiscard]] const std::vector<util::FilePath> &
175  InputFiles() const noexcept
176  {
177  return InputFiles_;
178  }
179 
180  static CommandGraph::Node &
182  CommandGraph & commandGraph,
183  const std::vector<util::FilePath> & inputFiles,
184  const util::FilePath & outputFile,
185  const std::vector<std::string> & libraryPaths,
186  const std::vector<std::string> & libraries,
187  bool usePthreads)
188  {
189  std::unique_ptr<ClangCommand> command(
190  new ClangCommand(inputFiles, outputFile, libraryPaths, libraries, usePthreads));
191  return CommandGraph::Node::Create(commandGraph, std::move(command));
192  }
193 
194  static CommandGraph::Node &
196  CommandGraph & commandGraph,
197  const util::FilePath & inputFile,
198  const util::FilePath & outputFile,
199  const util::FilePath & dependencyFile,
200  const std::vector<std::string> & includePaths,
201  const std::vector<std::string> & macroDefinitions,
202  const std::vector<std::string> & warnings,
203  const std::vector<std::string> & flags,
204  bool verbose,
205  bool rdynamic,
206  bool suppress,
207  bool usePthread,
208  bool mD,
209  const std::string & mT,
210  const LanguageStandard & languageStandard,
211  const std::vector<ClangArgument> & clangArguments)
212  {
213  std::unique_ptr<ClangCommand> command(new ClangCommand(
214  inputFile,
215  outputFile,
216  dependencyFile,
217  includePaths,
218  macroDefinitions,
219  warnings,
220  flags,
221  verbose,
222  rdynamic,
223  suppress,
224  usePthread,
225  mD,
226  mT,
227  languageStandard,
228  clangArguments));
229  return CommandGraph::Node::Create(commandGraph, std::move(command));
230  }
231 
232 private:
233  static std::string
234  ToString(const LanguageStandard & languageStandard);
235 
236  static std::string
237  ToString(const ClangArgument & clangArgument);
238 
239  static std::string
240  ReplaceAll(std::string str, const std::string & from, const std::string & to);
241 
242  std::vector<util::FilePath> InputFiles_;
245 
246  std::vector<std::string> IncludePaths_;
247  std::vector<std::string> MacroDefinitions_;
248  std::vector<std::string> Warnings_;
249  std::vector<std::string> Flags_;
250  std::vector<std::string> Libraries_;
251  std::vector<std::string> LibraryPaths_;
252 
254  bool Verbose_;
255  bool Rdynamic_;
256  bool Suppress_;
257  bool Md_;
258  std::string Mt_;
259 
261  std::vector<ClangArgument> ClangArguments_;
262 
264 };
265 
269 class LlcCommand final : public Command
270 {
271 public:
272  enum class OptimizationLevel
273  {
274  O0,
275  O1,
276  O2,
277  O3
278  };
279 
280  enum class RelocationModel
281  {
282  Static,
283  Pic
284  };
285 
286  ~LlcCommand() override;
287 
289  util::FilePath inputFile,
290  util::FilePath outputFile,
291  const OptimizationLevel & optimizationLevel,
292  const RelocationModel & relocationModel)
293  : OptimizationLevel_(optimizationLevel),
294  RelocationModel_(relocationModel),
295  InputFile_(std::move(inputFile)),
296  OutputFile_(std::move(outputFile))
297  {}
298 
299  [[nodiscard]] std::string
300  ToString() const override;
301 
302  [[nodiscard]] const util::FilePath &
303  OutputFile() const noexcept
304  {
305  return OutputFile_;
306  }
307 
308  static CommandGraph::Node &
310  CommandGraph & commandGraph,
311  const util::FilePath & inputFile,
312  const util::FilePath & outputFile,
313  const OptimizationLevel & optimizationLevel,
314  const RelocationModel & relocationModel)
315  {
316  std::unique_ptr<LlcCommand> command(
317  new LlcCommand(inputFile, outputFile, optimizationLevel, relocationModel));
318  return CommandGraph::Node::Create(commandGraph, std::move(command));
319  }
320 
321 private:
322  static std::string
323  ToString(const OptimizationLevel & optimizationLevel);
324 
325  static std::string
326  ToString(const RelocationModel & relocationModel);
327 
332 };
333 
337 class JlmOptCommand final : public Command
338 {
339 public:
340  ~JlmOptCommand() override;
341 
342  JlmOptCommand(std::string programName, const JlmOptCommandLineOptions & commandLineOptions);
343 
344  [[nodiscard]] std::string
345  ToString() const override;
346 
347  void
348  Run() const override;
349 
350  static CommandGraph::Node &
352  CommandGraph & commandGraph,
353  std::string programName,
354  const JlmOptCommandLineOptions & commandLineOptions)
355  {
356  auto command =
357  std::make_unique<JlmOptCommand>(std::move(programName), std::move(commandLineOptions));
358  return CommandGraph::Node::Create(commandGraph, std::move(command));
359  }
360 
361  [[nodiscard]] const JlmOptCommandLineOptions &
362  GetCommandLineOptions() const noexcept
363  {
364  return CommandLineOptions_;
365  }
366 
367  static void
369  llvm::LlvmRvsdgModule & rvsdgModule,
370  const util::FilePath & outputFile,
371  const JlmOptCommandLineOptions::OutputFormat & outputFormat,
373 
374 private:
375  std::unique_ptr<llvm::LlvmRvsdgModule>
377  const util::FilePath & inputFile,
378  const JlmOptCommandLineOptions::InputFormat & inputFormat,
380 
381  std::unique_ptr<llvm::LlvmRvsdgModule>
383  const;
384 
385  std::unique_ptr<llvm::LlvmRvsdgModule>
387  const;
388 
389  static void
390  PrintAsAscii(
391  const llvm::LlvmRvsdgModule & rvsdgModule,
392  const util::FilePath & outputFile,
394 
395  static void
396  PrintAsLlvm(
397  llvm::LlvmRvsdgModule & rvsdgModule,
398  const util::FilePath & outputFile,
400 
401  static void
402  PrintAsMlir(
403  const llvm::LlvmRvsdgModule & rvsdgModule,
404  const util::FilePath & outputFile,
406 
407  static void
409  const llvm::LlvmRvsdgModule & rvsdgModule,
410  const util::FilePath & outputFile,
412 
413  static void
415  const llvm::LlvmRvsdgModule & rvsdgModule,
416  const util::FilePath & outputFile,
419 
420  static void
422  const llvm::LlvmRvsdgModule & rvsdgModule,
423  const util::FilePath & outputFile,
425 
426  [[nodiscard]] std::vector<std::shared_ptr<rvsdg::Transformation>>
427  GetTransformations() const;
428 
429  [[nodiscard]] std::shared_ptr<rvsdg::Transformation>
431 
432  std::string ProgramName_;
434 };
435 
439 class MkdirCommand final : public Command
440 {
441 public:
442  ~MkdirCommand() noexcept override;
443 
444  explicit MkdirCommand(util::FilePath path)
445  : Path_(std::move(path))
446  {}
447 
448  [[nodiscard]] std::string
449  ToString() const override;
450 
451  void
452  Run() const override;
453 
454  static CommandGraph::Node &
455  Create(CommandGraph & commandGraph, const util::FilePath & path)
456  {
457  std::unique_ptr<MkdirCommand> command(new MkdirCommand(path));
458  return CommandGraph::Node::Create(commandGraph, std::move(command));
459  }
460 
461 private:
463 };
464 
468 class LlvmOptCommand final : public Command
469 {
470 public:
471  enum class Optimization
472  {
473  Mem2Reg,
474  };
475 
476  ~LlvmOptCommand() noexcept override;
477 
479  util::FilePath inputFile,
480  util::FilePath outputFile,
481  bool writeLlvmAssembly,
482  std::vector<Optimization> optimizations)
483  : InputFile_(std::move(inputFile)),
484  OutputFile_(std::move(outputFile)),
485  WriteLlvmAssembly_(writeLlvmAssembly),
486  Optimizations_(std::move(optimizations))
487  {}
488 
489  [[nodiscard]] std::string
490  ToString() const override;
491 
492  [[nodiscard]] const util::FilePath &
493  OutputFile() const noexcept
494  {
495  return OutputFile_;
496  }
497 
498  static CommandGraph::Node &
500  CommandGraph & commandGraph,
501  const util::FilePath & inputFile,
502  const util::FilePath & outputFile,
503  bool writeLlvmAssembly,
504  const std::vector<Optimization> & optimizations)
505  {
506  std::unique_ptr<LlvmOptCommand> command(
507  new LlvmOptCommand(inputFile, outputFile, writeLlvmAssembly, optimizations));
508  return CommandGraph::Node::Create(commandGraph, std::move(command));
509  }
510 
511 private:
512  static std::string
513  ToString(const Optimization & optimization);
514 
517 
519 
520  std::vector<Optimization> Optimizations_;
521 };
522 
526 class LlvmLinkCommand final : public Command
527 {
528 public:
529  ~LlvmLinkCommand() noexcept override;
530 
532  std::vector<util::FilePath> inputFiles,
533  util::FilePath outputFile,
534  bool writeLlvmAssembly,
535  bool verbose)
536  : OutputFile_(std::move(outputFile)),
537  InputFiles_(std::move(inputFiles)),
538  WriteLlvmAssembly_(writeLlvmAssembly),
539  Verbose_(verbose)
540  {}
541 
542  [[nodiscard]] std::string
543  ToString() const override;
544 
545  [[nodiscard]] const util::FilePath &
546  OutputFile() const noexcept
547  {
548  return OutputFile_;
549  }
550 
551  [[nodiscard]] const std::vector<util::FilePath> &
552  InputFiles() const noexcept
553  {
554  return InputFiles_;
555  }
556 
557  static CommandGraph::Node &
559  CommandGraph & commandGraph,
560  const std::vector<util::FilePath> & inputFiles,
561  const util::FilePath & outputFile,
562  bool writeLlvmAssembly,
563  bool verbose)
564  {
565  std::unique_ptr<LlvmLinkCommand> command(
566  new LlvmLinkCommand(inputFiles, outputFile, writeLlvmAssembly, verbose));
567  return CommandGraph::Node::Create(commandGraph, std::move(command));
568  }
569 
570 private:
572  std::vector<util::FilePath> InputFiles_;
573 
575  bool Verbose_;
576 };
577 
581 class JlmHlsCommand final : public Command
582 {
583 public:
584  ~JlmHlsCommand() noexcept override;
585 
587  util::FilePath inputFile,
588  util::FilePath outputFolder,
589  std::vector<std::string> options)
590  : InputFile_(std::move(inputFile)),
591  OutputFolder_(std::move(outputFolder)),
592  Options(std::move(options))
593  {}
594 
595  [[nodiscard]] std::string
596  ToString() const override;
597 
598  [[nodiscard]] util::FilePath
599  FirrtlFile() const noexcept
600  {
601  return OutputFolder_.WithSuffix(".fir");
602  }
603 
604  [[nodiscard]] util::FilePath
605  LlvmFile() const noexcept
606  {
607  return OutputFolder_.WithSuffix(".rest.ll");
608  }
609 
610  [[nodiscard]] util::FilePath
611  RefFile() const noexcept
612  {
613  return OutputFolder_.WithSuffix(".ref.ll");
614  }
615 
616  [[nodiscard]] util::FilePath
617  HarnessFile() const noexcept
618  {
619  return OutputFolder_.WithSuffix(".harness.cpp");
620  }
621 
622  [[nodiscard]] const util::FilePath &
623  InputFile() const noexcept
624  {
625  return InputFile_;
626  }
627 
628  static CommandGraph::Node &
630  CommandGraph & commandGraph,
631  const util::FilePath & inputFile,
632  const util::FilePath & outputFolder,
633  const std::vector<std::string> & options)
634  {
635  auto command = std::make_unique<JlmHlsCommand>(inputFile, outputFolder, options);
636  return CommandGraph::Node::Create(commandGraph, std::move(command));
637  }
638 
639 private:
642  std::vector<std::string> Options;
643 };
644 
649 class JlmHlsExtractCommand final : public Command
650 {
651 public:
652  ~JlmHlsExtractCommand() noexcept override;
653 
655  util::FilePath inputFile,
656  util::FilePath outputFolder,
657  std::string hlsFunctionName)
658  : InputFile_(std::move(inputFile)),
659  OutputFolder_(std::move(outputFolder)),
660  HlsFunctionName_(std::move(hlsFunctionName))
661  {}
662 
663  [[nodiscard]] std::string
664  ToString() const override;
665 
666  [[nodiscard]] util::FilePath
667  HlsFunctionFile() const noexcept
668  {
669  return OutputFolder_.WithSuffix(".function.ll");
670  }
671 
672  [[nodiscard]] util::FilePath
673  LlvmFile() const noexcept
674  {
675  return OutputFolder_.WithSuffix(".rest.ll");
676  }
677 
678  [[nodiscard]] const util::FilePath &
679  InputFile() const noexcept
680  {
681  return InputFile_;
682  }
683 
684  [[nodiscard]] const std::string &
685  HlsFunctionName() const noexcept
686  {
687  return HlsFunctionName_;
688  }
689 
690  static CommandGraph::Node &
692  CommandGraph & commandGraph,
693  const util::FilePath & inputFile,
694  const std::string & hlsFunctionName,
695  const util::FilePath & outputFolder)
696  {
697  std::unique_ptr<JlmHlsExtractCommand> command(
698  new JlmHlsExtractCommand(inputFile, outputFolder, hlsFunctionName));
699  return CommandGraph::Node::Create(commandGraph, std::move(command));
700  }
701 
702 private:
705 
706  std::string HlsFunctionName_;
707 };
708 
709 }
710 
711 #endif
static jlm::util::StatisticsCollector statisticsCollector
const std::vector< util::FilePath > & InputFiles() const noexcept
Definition: Command.hpp:175
ClangCommand(const util::FilePath &inputFile, util::FilePath outputFile, util::FilePath dependencyFile, std::vector< std::string > includePaths, std::vector< std::string > macroDefinitions, std::vector< std::string > warnings, std::vector< std::string > flags, bool verbose, bool rdynamic, bool suppress, bool usePthreads, bool mD, std::string mT, const LanguageStandard &languageStandard, std::vector< ClangArgument > clangArguments)
Definition: Command.hpp:131
std::string ToString() const override
Definition: Command.cpp:104
std::vector< util::FilePath > InputFiles_
Definition: Command.hpp:242
std::vector< std::string > Libraries_
Definition: Command.hpp:250
std::vector< std::string > MacroDefinitions_
Definition: Command.hpp:247
std::vector< std::string > Warnings_
Definition: Command.hpp:248
const util::FilePath & OutputFile() const noexcept
Definition: Command.hpp:169
std::vector< std::string > LibraryPaths_
Definition: Command.hpp:251
ClangCommand(std::vector< util::FilePath > inputFiles, util::FilePath outputFile, std::vector< std::string > libraryPaths, std::vector< std::string > libraries, bool usePthreads)
Definition: Command.hpp:111
LanguageStandard LanguageStandard_
Definition: Command.hpp:260
util::FilePath OutputFile_
Definition: Command.hpp:243
std::vector< ClangArgument > ClangArguments_
Definition: Command.hpp:261
std::vector< std::string > Flags_
Definition: Command.hpp:249
static std::string ReplaceAll(std::string str, const std::string &from, const std::string &to)
Definition: Command.cpp:236
static CommandGraph::Node & CreateLinkerCommand(CommandGraph &commandGraph, const std::vector< util::FilePath > &inputFiles, const util::FilePath &outputFile, const std::vector< std::string > &libraryPaths, const std::vector< std::string > &libraries, bool usePthreads)
Definition: Command.hpp:181
static CommandGraph::Node & CreateParsingCommand(CommandGraph &commandGraph, const util::FilePath &inputFile, const util::FilePath &outputFile, const util::FilePath &dependencyFile, const std::vector< std::string > &includePaths, const std::vector< std::string > &macroDefinitions, const std::vector< std::string > &warnings, const std::vector< std::string > &flags, bool verbose, bool rdynamic, bool suppress, bool usePthread, bool mD, const std::string &mT, const LanguageStandard &languageStandard, const std::vector< ClangArgument > &clangArguments)
Definition: Command.hpp:195
util::FilePath DependencyFile_
Definition: Command.hpp:244
std::vector< std::string > IncludePaths_
Definition: Command.hpp:246
static Node & Create(CommandGraph &commandGraph, std::unique_ptr< Command > command)
Command class.
Definition: Command.hpp:31
virtual void Run() const
Definition: Command.cpp:61
virtual std::string ToString() const =0
const util::FilePath & InputFile() const noexcept
Definition: Command.hpp:623
util::FilePath HarnessFile() const noexcept
Definition: Command.hpp:617
~JlmHlsCommand() noexcept override
util::FilePath OutputFolder_
Definition: Command.hpp:641
std::string ToString() const override
Definition: Command.cpp:772
util::FilePath FirrtlFile() const noexcept
Definition: Command.hpp:599
std::vector< std::string > Options
Definition: Command.hpp:642
util::FilePath LlvmFile() const noexcept
Definition: Command.hpp:605
static CommandGraph::Node & Create(CommandGraph &commandGraph, const util::FilePath &inputFile, const util::FilePath &outputFolder, const std::vector< std::string > &options)
Definition: Command.hpp:629
util::FilePath RefFile() const noexcept
Definition: Command.hpp:611
util::FilePath InputFile_
Definition: Command.hpp:640
const std::string & HlsFunctionName() const noexcept
Definition: Command.hpp:685
static CommandGraph::Node & Create(CommandGraph &commandGraph, const util::FilePath &inputFile, const std::string &hlsFunctionName, const util::FilePath &outputFolder)
Definition: Command.hpp:691
std::string ToString() const override
Definition: Command.cpp:785
JlmHlsExtractCommand(util::FilePath inputFile, util::FilePath outputFolder, std::string hlsFunctionName)
Definition: Command.hpp:654
util::FilePath HlsFunctionFile() const noexcept
Definition: Command.hpp:667
~JlmHlsExtractCommand() noexcept override
const util::FilePath & InputFile() const noexcept
Definition: Command.hpp:679
util::FilePath LlvmFile() const noexcept
Definition: Command.hpp:673
std::unique_ptr< llvm::LlvmRvsdgModule > ParseMlirIrFile(const util::FilePath &inputFile, util::StatisticsCollector &statisticsCollector) const
Definition: Command.cpp:485
JlmOptCommand(std::string programName, const JlmOptCommandLineOptions &commandLineOptions)
Definition: Command.cpp:294
static void printAsRvsdgJsonTree(const llvm::LlvmRvsdgModule &rvsdgModule, const util::FilePath &outputFile, util::StatisticsCollector &statisticsCollector)
Definition: Command.cpp:626
static void PrintRvsdgModule(llvm::LlvmRvsdgModule &rvsdgModule, const util::FilePath &outputFile, const JlmOptCommandLineOptions::OutputFormat &outputFormat, util::StatisticsCollector &statisticsCollector)
Definition: Command.cpp:648
static void PrintAsLlvm(llvm::LlvmRvsdgModule &rvsdgModule, const util::FilePath &outputFile, util::StatisticsCollector &statisticsCollector)
Definition: Command.cpp:537
static void PrintAsAscii(const llvm::LlvmRvsdgModule &rvsdgModule, const util::FilePath &outputFile, util::StatisticsCollector &statisticsCollector)
Definition: Command.cpp:517
std::unique_ptr< llvm::LlvmRvsdgModule > ParseLlvmIrFile(const util::FilePath &inputFile, util::StatisticsCollector &statisticsCollector) const
Definition: Command.cpp:457
static void PrintAsRvsdgTree(const llvm::LlvmRvsdgModule &rvsdgModule, const util::FilePath &outputFile, util::StatisticsCollector &statisticsCollector)
Definition: Command.cpp:578
std::shared_ptr< rvsdg::Transformation > CreateTransformation(JlmOptCommandLineOptions::OptimizationId optimizationId) const
Definition: Command.cpp:403
void Run() const override
Definition: Command.cpp:349
JlmOptCommandLineOptions CommandLineOptions_
Definition: Command.hpp:433
std::string ToString() const override
Definition: Command.cpp:302
static CommandGraph::Node & Create(CommandGraph &commandGraph, std::string programName, const JlmOptCommandLineOptions &commandLineOptions)
Definition: Command.hpp:351
static void PrintAsMlir(const llvm::LlvmRvsdgModule &rvsdgModule, const util::FilePath &outputFile, util::StatisticsCollector &statisticsCollector)
Definition: Command.cpp:562
std::unique_ptr< llvm::LlvmRvsdgModule > ParseInputFile(const util::FilePath &inputFile, const JlmOptCommandLineOptions::InputFormat &inputFormat, util::StatisticsCollector &statisticsCollector) const
Definition: Command.cpp:497
const JlmOptCommandLineOptions & GetCommandLineOptions() const noexcept
Definition: Command.hpp:362
static void PrintAsGraphs(const llvm::LlvmRvsdgModule &rvsdgModule, const util::FilePath &outputFile, jlm::util::graph::OutputFormat format, util::StatisticsCollector &statisticsCollector)
Definition: Command.cpp:600
std::vector< std::shared_ptr< rvsdg::Transformation > > GetTransformations() const
Definition: Command.cpp:377
RelocationModel RelocationModel_
Definition: Command.hpp:329
util::FilePath InputFile_
Definition: Command.hpp:330
const util::FilePath & OutputFile() const noexcept
Definition: Command.hpp:303
std::string ToString() const override
Definition: Command.cpp:250
OptimizationLevel OptimizationLevel_
Definition: Command.hpp:328
LlcCommand(util::FilePath inputFile, util::FilePath outputFile, const OptimizationLevel &optimizationLevel, const RelocationModel &relocationModel)
Definition: Command.hpp:288
util::FilePath OutputFile_
Definition: Command.hpp:331
static CommandGraph::Node & Create(CommandGraph &commandGraph, const util::FilePath &inputFile, const util::FilePath &outputFile, const OptimizationLevel &optimizationLevel, const RelocationModel &relocationModel)
Definition: Command.hpp:309
util::FilePath OutputFile_
Definition: Command.hpp:571
std::string ToString() const override
Definition: Command.cpp:752
const std::vector< util::FilePath > & InputFiles() const noexcept
Definition: Command.hpp:552
static CommandGraph::Node & Create(CommandGraph &commandGraph, const std::vector< util::FilePath > &inputFiles, const util::FilePath &outputFile, bool writeLlvmAssembly, bool verbose)
Definition: Command.hpp:558
std::vector< util::FilePath > InputFiles_
Definition: Command.hpp:572
LlvmLinkCommand(std::vector< util::FilePath > inputFiles, util::FilePath outputFile, bool writeLlvmAssembly, bool verbose)
Definition: Command.hpp:531
~LlvmLinkCommand() noexcept override
const util::FilePath & OutputFile() const noexcept
Definition: Command.hpp:546
~LlvmOptCommand() noexcept override
util::FilePath OutputFile_
Definition: Command.hpp:516
util::FilePath InputFile_
Definition: Command.hpp:515
LlvmOptCommand(util::FilePath inputFile, util::FilePath outputFile, bool writeLlvmAssembly, std::vector< Optimization > optimizations)
Definition: Command.hpp:478
std::vector< Optimization > Optimizations_
Definition: Command.hpp:520
const util::FilePath & OutputFile() const noexcept
Definition: Command.hpp:493
std::string ToString() const override
Definition: Command.cpp:706
static CommandGraph::Node & Create(CommandGraph &commandGraph, const util::FilePath &inputFile, const util::FilePath &outputFile, bool writeLlvmAssembly, const std::vector< Optimization > &optimizations)
Definition: Command.hpp:499
static CommandGraph::Node & Create(CommandGraph &commandGraph, const util::FilePath &path)
Definition: Command.hpp:455
~MkdirCommand() noexcept override
std::string ToString() const override
Definition: Command.cpp:691
MkdirCommand(util::FilePath path)
Definition: Command.hpp:444
util::FilePath Path_
Definition: Command.hpp:462
void Run() const override
Definition: Command.cpp:697
std::unique_ptr< CommandGraph > CommandGraph_
Definition: Command.hpp:81
PrintCommandsCommand(PrintCommandsCommand &&)=delete
PrintCommandsCommand & operator=(const PrintCommandsCommand &)=delete
PrintCommandsCommand & operator=(PrintCommandsCommand &&)=delete
std::string ToString() const override
Definition: Command.cpp:75
void Run() const override
Definition: Command.cpp:81
static std::unique_ptr< CommandGraph > Create(std::unique_ptr< CommandGraph > commandGraph)
Definition: Command.cpp:91
PrintCommandsCommand(const PrintCommandsCommand &)=delete
PrintCommandsCommand(std::unique_ptr< CommandGraph > commandGraph)
Definition: Command.hpp:50
static CommandGraph::Node & Create(CommandGraph &commandGraph, std::unique_ptr< CommandGraph > printedCommandGraph)
Definition: Command.hpp:75
FilePath WithSuffix(const std::string &suffix) const
Definition: file.hpp:211
Global memory state passed between functions.