Goose  Artifact [0c461335ec]

Artifact 0c461335ec5195c686a66eeeef44266ea77103d669a50ec2d961086f65755091:

  • File bs/codegen/module.h — part of check-in [98a6fcaf3f] at 2019-07-13 19:33:00 on branch trunk — codegen: very first draft of function generation. (user: achavasse size: 701)

#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* GetFuncType( const builtins::FuncType& ftype );

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

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

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

#endif