1 // =================================
 2 // Copyright (c) 2021 Seppo Laakko
 3 // Distributed under the MIT license
 4 // =================================
 5 
 6 #include <cmajor/codegenllvm/LlvmCodeGenerator.hpp>
 7 #include <cmajor/codegenlinux/CodeGenLinuxApi.hpp>
 8 #include <cmajor/binder/BoundStatement.hpp>
 9 
10 namespace cmajor { namespace codegenlinux {
11 
12 using namespace cmajor::binder;
13 
14 class LinuxCodeGenerator public cmajor::codegenllvm::LlvmCodeGenerator
15 {
16 public:
17     LinuxCodeGenerator(cmajor::ir::EmittingContext& emittingContext_);
18     void Visit(BoundReturnStatement& boundReturnStatement) override;
19     void Visit(BoundGotoCaseStatement& boundGotoCaseStatement) override;
20     void Visit(BoundGotoDefaultStatement& boundGotoDefaultStatement) override;
21     void Visit(BoundBreakStatement& boundBreakStatement) override;
22     void Visit(BoundContinueStatement& boundContinueStatement) override;
23     void Visit(BoundGotoStatement& boundGotoStatement) override;
24     void Visit(BoundTryStatement& boundTryStatement) override;
25     void Visit(BoundRethrowStatement& boundRethrowStatement) override;
26     void CreateCleanup() override;
27     void* GetPersonalityFunction() const override;
28     void GenerateCodeForCleanups() override;
29 };
30 
31 } } // namespace cmajor::codegenlinux