1 // =================================
 2 // Copyright (c) 2021 Seppo Laakko
 3 // Distributed under the MIT license
 4 // =================================
 5 
 6 #include <cmajor/codegen/Interface.hpp>
 7 #include <cmajor/codegen/CodeGenerator.hpp>
 8 #include <cmajor/ir/EmittingContext.hpp>
 9 
10 namespace cmajor { namespace codegen {
11 
12 void GenerateCode(cmajor::codegen::EmittingContext& emittingContextcmajor::binder::BoundCompileUnit& boundCompileUnit)
13 {
14     cmajor::ir::EmittingContext* baseEmittingContext = emittingContext.GetBaseEmittingContext();
15     cmajor::codegen::CodeGenerator codeGenerator(*baseEmittingContext);
16     cmajor::codegenbase::CodeGenerator* baseCodeGenerator = codeGenerator.GetBaseCodeGenerator();
17     baseCodeGenerator->GenerateCode(&boundCompileUnit);
18 }
19 
20 } } // namespace cmajor::codegen