llvmlite 0.46.0b1__cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of llvmlite might be problematic. Click here for more details.
- llvmlite/__init__.py +11 -0
- llvmlite/_version.py +11 -0
- llvmlite/binding/__init__.py +18 -0
- llvmlite/binding/analysis.py +69 -0
- llvmlite/binding/common.py +34 -0
- llvmlite/binding/config.py +143 -0
- llvmlite/binding/context.py +31 -0
- llvmlite/binding/dylib.py +45 -0
- llvmlite/binding/executionengine.py +330 -0
- llvmlite/binding/ffi.py +395 -0
- llvmlite/binding/initfini.py +85 -0
- llvmlite/binding/libllvmlite.so +0 -0
- llvmlite/binding/linker.py +20 -0
- llvmlite/binding/module.py +349 -0
- llvmlite/binding/newpassmanagers.py +1049 -0
- llvmlite/binding/object_file.py +82 -0
- llvmlite/binding/options.py +17 -0
- llvmlite/binding/orcjit.py +342 -0
- llvmlite/binding/targets.py +462 -0
- llvmlite/binding/typeref.py +267 -0
- llvmlite/binding/value.py +632 -0
- llvmlite/ir/__init__.py +11 -0
- llvmlite/ir/_utils.py +80 -0
- llvmlite/ir/builder.py +1120 -0
- llvmlite/ir/context.py +20 -0
- llvmlite/ir/instructions.py +920 -0
- llvmlite/ir/module.py +256 -0
- llvmlite/ir/transforms.py +64 -0
- llvmlite/ir/types.py +730 -0
- llvmlite/ir/values.py +1217 -0
- llvmlite/tests/__init__.py +57 -0
- llvmlite/tests/__main__.py +3 -0
- llvmlite/tests/customize.py +407 -0
- llvmlite/tests/refprune_proto.py +330 -0
- llvmlite/tests/test_binding.py +3155 -0
- llvmlite/tests/test_ir.py +3095 -0
- llvmlite/tests/test_refprune.py +574 -0
- llvmlite/tests/test_valuerepr.py +60 -0
- llvmlite/utils.py +29 -0
- llvmlite-0.46.0b1.dist-info/METADATA +145 -0
- llvmlite-0.46.0b1.dist-info/RECORD +45 -0
- llvmlite-0.46.0b1.dist-info/WHEEL +6 -0
- llvmlite-0.46.0b1.dist-info/licenses/LICENSE +24 -0
- llvmlite-0.46.0b1.dist-info/licenses/LICENSE.thirdparty +225 -0
- llvmlite-0.46.0b1.dist-info/top_level.txt +1 -0
llvmlite/ir/_utils.py
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
from collections import defaultdict
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class DuplicatedNameError(NameError):
|
|
5
|
+
pass
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class NameScope(object):
|
|
9
|
+
def __init__(self):
|
|
10
|
+
self._useset = set([''])
|
|
11
|
+
self._basenamemap = defaultdict(int)
|
|
12
|
+
|
|
13
|
+
def is_used(self, name):
|
|
14
|
+
return name in self._useset
|
|
15
|
+
|
|
16
|
+
def register(self, name, deduplicate=False):
|
|
17
|
+
if deduplicate:
|
|
18
|
+
name = self.deduplicate(name)
|
|
19
|
+
elif self.is_used(name):
|
|
20
|
+
raise DuplicatedNameError(name)
|
|
21
|
+
self._useset.add(name)
|
|
22
|
+
return name
|
|
23
|
+
|
|
24
|
+
def deduplicate(self, name):
|
|
25
|
+
basename = name
|
|
26
|
+
while self.is_used(name):
|
|
27
|
+
ident = self._basenamemap[basename] + 1
|
|
28
|
+
self._basenamemap[basename] = ident
|
|
29
|
+
name = "{0}.{1}".format(basename, ident)
|
|
30
|
+
return name
|
|
31
|
+
|
|
32
|
+
def get_child(self):
|
|
33
|
+
return type(self)(parent=self)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class _StrCaching(object):
|
|
37
|
+
|
|
38
|
+
def _clear_string_cache(self):
|
|
39
|
+
try:
|
|
40
|
+
del self.__cached_str
|
|
41
|
+
except AttributeError:
|
|
42
|
+
pass
|
|
43
|
+
|
|
44
|
+
def __str__(self):
|
|
45
|
+
try:
|
|
46
|
+
return self.__cached_str
|
|
47
|
+
except AttributeError:
|
|
48
|
+
s = self.__cached_str = self._to_string()
|
|
49
|
+
return s
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class _StringReferenceCaching(object):
|
|
53
|
+
|
|
54
|
+
def get_reference(self):
|
|
55
|
+
try:
|
|
56
|
+
return self.__cached_refstr
|
|
57
|
+
except AttributeError:
|
|
58
|
+
s = self.__cached_refstr = self._get_reference()
|
|
59
|
+
return s
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class _HasMetadata(object):
|
|
63
|
+
|
|
64
|
+
def set_metadata(self, name, node):
|
|
65
|
+
"""
|
|
66
|
+
Attach unnamed metadata *node* to the metadata slot *name* of this
|
|
67
|
+
value.
|
|
68
|
+
"""
|
|
69
|
+
self.metadata[name] = node
|
|
70
|
+
|
|
71
|
+
def _stringify_metadata(self, leading_comma=False):
|
|
72
|
+
if self.metadata:
|
|
73
|
+
buf = []
|
|
74
|
+
if leading_comma:
|
|
75
|
+
buf.append("")
|
|
76
|
+
buf += ["!{0} {1}".format(k, v.get_reference())
|
|
77
|
+
for k, v in self.metadata.items()]
|
|
78
|
+
return ', '.join(buf)
|
|
79
|
+
else:
|
|
80
|
+
return ''
|