Files
revng-revng/python/revng/internal/api/__init__.py
Giacomo Vercesi bfed42ed1e Add revng.support.get_llvmcpy helper
Add the `get_llvmcpy` helper function which returns an instance of
`LLVMCPy` which uses the `llvm-config` that's present in the search
paths.
2025-05-05 16:02:40 +02:00

29 lines
589 B
Python

#
# This file is distributed under the MIT License. See LICENSE.md for details.
#
import atexit
from typing import Optional
from revng.support import AnyPath
from ._capi import initialize, shutdown
from .manager import Manager
__all__ = ["Manager", "initialize", "shutdown"]
_initialized = False
def make_manager(workdir: Optional[AnyPath] = None):
global _initialized
if not _initialized:
initialize()
atexit.register(shutdown)
_initialized = True
if workdir is None:
return Manager(None)
else:
return Manager(str(workdir))