Goose  Artifact [4f203a02cc]

Artifact 4f203a02cc5aa284cdc80961944d45843220e70f674f15587de94a8c39f7726d:

  • File bs/codegen/module.h — part of check-in [5c095a9872] at 2019-07-26 02:14:46 on branch trunk — codegen: generate correct function types. (user: achavasse size: 787)

#ifndef EMPATHY_CODEGEN_MODULE_H
#define EMPATHY_CODEGEN_MODULE_H

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

            void DumpAsLlvmIr( const string& filename ) const;

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

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

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

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

#endif