"""
This type stub file was generated by pyright.
"""

from collections.abc import Sequence

from llvmlite.ir.types import FunctionType, Type
from llvmlite.ir.values import Function, GlobalValue

class Module:
    def __init__(self, name=..., context=...) -> None: ...
    @property
    def name(self) -> str: ...
    def str_ditok_operands(self, operands):  # -> list[Any]:
        ...
    def add_metadata(self, operands):  # -> MDValue:
        """
        Add an unnamed metadata to the module with the given *operands*
        (a sequence of values) or return a previous equivalent metadata.
        A MDValue instance is returned, it can then be associated to
        e.g. an instruction.
        """
        ...

    def add_debug_info(self, kind, operands, is_distinct=...):  # -> DIValue:
        """
        Add debug information metadata to the module with the given
        *operands* (a dict of values with string keys) or return
        a previous equivalent metadata.  *kind* is a string of the
        debug information kind (e.g. "DICompileUnit").

        A DIValue instance is returned, it can then be associated to e.g.
        an instruction.
        """
        ...

    def add_named_metadata(self, name, element=...):  # -> NamedMetaData:
        """
        Add a named metadata node to the module, if it doesn't exist,
        or return the existing node.
        If *element* is given, it will append a new element to
        the named metadata node.  If *element* is a sequence of values
        (rather than a metadata value), a new unnamed node will first be
        created.

        Example::
            module.add_named_metadata("llvm.ident", ["llvmlite/1.0"])
        """
        ...

    def get_named_metadata(self, name):
        """
        Return the metadata node with the given *name*.  KeyError is raised
        if no such node exists (contrast with add_named_metadata()).
        """
        ...

    @property
    def functions(self):  # -> list[Function]:
        """
        A list of functions declared or defined in this module.
        """
        ...

    @property
    def global_values(self):  # -> _odict_values[Any, Any]:
        """
        An iterable of global values in this module.
        """
        ...

    def get_global(self, name: str) -> GlobalValue:
        """
        Get a global value by name.
        """
        ...

    def add_global(self, globalvalue):  # -> None:
        """
        Add a new global value.
        """
        ...

    def get_unique_name(self, name=...):  # -> str:
        """
        Get a unique global name with the following *name* hint.
        """
        ...

    def declare_intrinsic(
        self,
        intrinsic: str,
        tys: Sequence[Type] = ...,
        fnty: FunctionType | None = ...,
    ) -> Function: ...
    def get_identified_types(self):  # -> dict[Any, Any]:
        ...
    def __repr__(self):  # -> LiteralString:
        ...
