'Make the underlying LLVM module ready to use.'

@llvmts.lock_llvm
def _finalize_final_module(self):

    self._final_module.__library = weakref.proxy(self)
    cleanup = self._codegen._add_module(self._final_module)
    if cleanup:
        utils.finalize(self, cleanup)
    self._finalize_specific()
    self._finalized = True
    if config.DUMP_OPTIMIZED:
        dump(('OPTIMIZED    DUMP    %s' % self._name), self.get_llvm_str())
    if config.DUMP_ASSEMBLY:
        asm = self.get_asm_str()
        if asm:
            dump(('ASSEMBLY    %s' % self._name), self.get_asm_str())
