1 // =================================
 2 // Copyright (c) 2021 Seppo Laakko
 3 // Distributed under the MIT license
 4 // =================================
 5 
 6 #ifndef CMAJOR_CODEGENBASE_CODEGENERATOR_INCLUDED
 7 #define CMAJOR_CODEGENBASE_CODEGENERATOR_INCLUDED
 8 #include <cmajor/codegenbase/CodeGenBaseApi.hpp>
 9 #include <cmajor/ir/Emitter.hpp>
10 #include <cmajor/ir/EmittingContext.hpp>
11 
12 namespace cmajor { namespace codegenbase {
13 
14 class CodeGenerator 
15 {
16 public:
17     CodeGenerator(cmajor::ir::EmittingContext& emittingContext);
18     cmajor::ir::Emitter* GetEmitter() { return emitter; }
19     virtual ~CodeGenerator();
20     virtual void GenerateCode(void* boundCompileUnit) = 0;
21 private:
22     cmajor::ir::Emitter* emitter;
23 };
24 
25 } } // namespace cmajor::codegenbase
26 
27 #endif // CMAJOR_CODEGENBASE_CODEGENERATOR_INCLUDED