picceler
Loading...
Searching...
No Matches
compiler.h
Go to the documentation of this file.
1#pragma once
2
3#include "CLI/CLI.hpp"
4#include "mlir/Pass/PassManager.h"
5#include "llvm/IR/Module.h"
6
7#include "dialect.h"
8#include "mlir_gen.h"
9#include "parser.h"
10#include "pass_manager.h"
11
12namespace picceler {
13
18public:
19 std::string _inputFile;
20 std::string _outputFile;
21};
22
26class Compiler {
27public:
28 Compiler();
29
33 bool run();
34
35 CLI::App &getCliApp() { return _cliApp; }
36 const CLIOptions &getCliOptions() const { return _cliOptions; }
37
38private:
39 mlir::MLIRContext &getContext() { return _context; }
40
44 static mlir::DialectRegistry initRegistry();
45
52 bool emitObjectFile(llvm::Module *llvmModule, const std::string &objFilename);
53
61 bool linkWithClang(const std::string &objFile, const std::string &runtimeLib, const std::string &outputExe);
62
63private:
64 CLI::App _cliApp;
65 CLIOptions _cliOptions;
66 Lexer _lexer;
67 Parser _parser;
68
69 mlir::MLIRContext _context;
70 MLIRGen _mlirGen;
71 IRPassManager _passManager;
72};
73
74} // namespace picceler
Struct to hold command-line options for the compiler.
Definition compiler.h:17
std::string _outputFile
Definition compiler.h:20
std::string _inputFile
Definition compiler.h:19
const CLIOptions & getCliOptions() const
Definition compiler.h:36
bool run()
Runs the compilation process.
Definition compiler.cpp:170
Compiler()
Definition compiler.cpp:142
CLI::App & getCliApp()
Definition compiler.h:35
Picceler MLIR dialect declarations.
Definition ast.h:11