def _finalize_final_module(self):
        """
        Make the underlying LLVM module ready to use.
        """
        self._finalize_dynamic_globals()
        self._verify_declare_only_symbols()

        # Remember this on the module, for the object cache hooks
        self._final_module.__library = weakref.proxy(self)

        # It seems add_module() must be done only here and not before
        # linking in other modules, otherwise get_pointer_to_function()
        # could fail.
        cleanup = self._codegen._add_module(self._final_module)
        if cleanup:
            weakref.finalize(self, cleanup)
        self._finalize_specific()

        self._finalized = True

        if config.DUMP_OPTIMIZED:
            dump("OPTIMIZED DUMP %s" % self.name, self.get_llvm_str(), 'llvm')

        if config.DUMP_ASSEMBLY:
            dump("ASSEMBLY %s" % self.name, self.get_asm_str(), 'asm')

        Make the underlying LLVM module ready to use.
        
numba/core/codegen.py