#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
