Goose  Artifact [51a37a9bbb]

Artifact 51a37a9bbb86cbf63ee8552e81aedef4106b938ab186520ac979fe2f6fbe738f:

  • File bs/codegen/module.h — part of check-in [ab106469dd] at 2019-07-14 19:29:07 on branch trunk — codegen:
    • implemented api to generate functions.
    • implemented tests for function generation.
    (user: achavasse size: 725)

#ifndef EMPATHY_CODEGEN_MODULE_H
#define EMPATHY_CODEGEN_MODULE_H

namespace empathy::codegen
{
    class Module
    {
        public:
            Module( Env& env, const string& name );

            void DumpAsLlvmIr( const string& filename ) const;

            llvm::FunctionType* GetOrCreateFuncType( const builtins::FuncType& ftype );

            llvm::Function* BuildFuncProto( const builtins::Func& func, const string& name );

            llvm::Function* GetOrCreateFunc( const builtins::Func& func );
            llvm::Function* GetOrCreateFunc( const builtins::Func& func, const string& name );

        private:
            llvm::Module m_llvmModule;
            llvm::IRBuilder<> m_llvmBuilder;
    };
}

#endif