ruby-llvm 19.1.0 → 19.1.2
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.
- checksums.yaml +4 -4
- data/lib/llvm/config.rb +1 -1
- data/lib/llvm/core/type.rb +25 -8
- data/lib/llvm/core/value.rb +12 -1
- data/lib/llvm/version.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df367b2c98f260a385eaadca04206f2a7f71a9354b2e2584be63ac33fd28b122
|
4
|
+
data.tar.gz: 478b9eea54dd4686fba6d6643965be3aa21570906dcf6b95df4b8b6a5101ff0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71f91dd881e22562015aba5cd9d818f949f460f44a7e4d0dd12850d95aefdfd512db2c9fc9131db0515947a0a31e0afe806cc55b8d5bbc185cd16fb3fa282eea
|
7
|
+
data.tar.gz: 21a4ea3e227b4c127ac5212cd705fae433a571be7524fe3c4e14b48c3e0eec1e10c5642c4c47ff773432bceec862cf07199d148e407caa384dfe761dbc380b3d
|
data/lib/llvm/config.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Generated by ruby-llvm. Please do not change this file by hand.
|
2
2
|
module LLVM
|
3
3
|
module CONFIG
|
4
|
-
VERSION = "19.1.
|
4
|
+
VERSION = "19.1.2"
|
5
5
|
COMPONENTS = ["aarch64", "aarch64asmparser", "aarch64codegen", "aarch64desc", "aarch64disassembler", "aarch64info", "aarch64utils", "aggressiveinstcombine", "all", "all-targets", "amdgpu", "amdgpuasmparser", "amdgpucodegen", "amdgpudesc", "amdgpudisassembler", "amdgpuinfo", "amdgputargetmca", "amdgpuutils", "analysis", "arm", "armasmparser", "armcodegen", "armdesc", "armdisassembler", "arminfo", "armutils", "asmparser", "asmprinter", "avr", "avrasmparser", "avrcodegen", "avrdesc", "avrdisassembler", "avrinfo", "binaryformat", "bitreader", "bitstreamreader", "bitwriter", "bpf", "bpfasmparser", "bpfcodegen", "bpfdesc", "bpfdisassembler", "bpfinfo", "cfguard", "codegen", "codegendata", "codegentypes", "core", "coroutines", "coverage", "debuginfobtf", "debuginfocodeview", "debuginfodwarf", "debuginfogsym", "debuginfologicalview", "debuginfomsf", "debuginfopdb", "demangle", "dlltooldriver", "dwarflinker", "dwarflinkerclassic", "dwarflinkerparallel", "dwp", "engine", "executionengine", "extensions", "filecheck", "frontenddriver", "frontendhlsl", "frontendoffloading", "frontendopenacc", "frontendopenmp", "fuzzercli", "fuzzmutate", "globalisel", "hexagon", "hexagonasmparser", "hexagoncodegen", "hexagondesc", "hexagondisassembler", "hexagoninfo", "hipstdpar", "instcombine", "instrumentation", "interfacestub", "interpreter", "ipo", "irprinter", "irreader", "jitlink", "lanai", "lanaiasmparser", "lanaicodegen", "lanaidesc", "lanaidisassembler", "lanaiinfo", "libdriver", "lineeditor", "linker", "loongarch", "loongarchasmparser", "loongarchcodegen", "loongarchdesc", "loongarchdisassembler", "loongarchinfo", "lto", "m68k", "m68kasmparser", "m68kcodegen", "m68kdesc", "m68kdisassembler", "m68kinfo", "mc", "mca", "mcdisassembler", "mcjit", "mcparser", "mips", "mipsasmparser", "mipscodegen", "mipsdesc", "mipsdisassembler", "mipsinfo", "mirparser", "msp430", "msp430asmparser", "msp430codegen", "msp430desc", "msp430disassembler", "msp430info", "native", "nativecodegen", "nvptx", "nvptxcodegen", "nvptxdesc", "nvptxinfo", "objcarcopts", "objcopy", "object", "objectyaml", "option", "orcdebugging", "orcjit", "orcshared", "orctargetprocess", "passes", "perfjitevents", "powerpc", "powerpcasmparser", "powerpccodegen", "powerpcdesc", "powerpcdisassembler", "powerpcinfo", "profiledata", "remarks", "riscv", "riscvasmparser", "riscvcodegen", "riscvdesc", "riscvdisassembler", "riscvinfo", "riscvtargetmca", "runtimedyld", "sandboxir", "scalaropts", "selectiondag", "sparc", "sparcasmparser", "sparccodegen", "sparcdesc", "sparcdisassembler", "sparcinfo", "support", "symbolize", "systemz", "systemzasmparser", "systemzcodegen", "systemzdesc", "systemzdisassembler", "systemzinfo", "tablegen", "target", "targetparser", "textapi", "textapibinaryreader", "transformutils", "ve", "veasmparser", "vecodegen", "vectorize", "vedesc", "vedisassembler", "veinfo", "webassembly", "webassemblyasmparser", "webassemblycodegen", "webassemblydesc", "webassemblydisassembler", "webassemblyinfo", "webassemblyutils", "windowsdriver", "windowsmanifest", "x86", "x86asmparser", "x86codegen", "x86desc", "x86disassembler", "x86info", "x86targetmca", "xcore", "xcorecodegen", "xcoredesc", "xcoredisassembler", "xcoreinfo", "xray", "xtensa", "xtensaasmparser", "xtensacodegen", "xtensadesc", "xtensadisassembler", "xtensainfo"]
|
6
6
|
TARGETS_BUILT = ["AArch64", "AMDGPU", "ARM", "AVR", "BPF", "Hexagon", "Lanai", "LoongArch", "Mips", "MSP430", "NVPTX", "PowerPC", "RISCV", "Sparc", "SystemZ", "VE", "WebAssembly", "X86", "XCore", "M68k", "Xtensa"]
|
7
7
|
HOST_TARGET = "x86_64-pc-linux-gnu"
|
data/lib/llvm/core/type.rb
CHANGED
@@ -228,8 +228,8 @@ module LLVM
|
|
228
228
|
C.get_int_type_width(self)
|
229
229
|
end
|
230
230
|
|
231
|
-
def
|
232
|
-
|
231
|
+
private def get_sign_option(options)
|
232
|
+
case options
|
233
233
|
when true, false
|
234
234
|
options
|
235
235
|
when Hash
|
@@ -237,11 +237,16 @@ module LLVM
|
|
237
237
|
else
|
238
238
|
raise ArgumentError
|
239
239
|
end
|
240
|
-
|
240
|
+
end
|
241
|
+
|
242
|
+
def from_i(int, options = {})
|
243
|
+
signed = get_sign_option(options)
|
241
244
|
|
242
|
-
|
243
|
-
|
244
|
-
val.
|
245
|
+
return parse(int.to_s, 0) if width > 64 || int.is_a?(String)
|
246
|
+
|
247
|
+
val = from_ptr(C.const_int(self, int, signed ? 1 : 0))
|
248
|
+
unpoisoned = val.to_i(signed) == int
|
249
|
+
unpoisoned ? val : poison
|
245
250
|
end
|
246
251
|
|
247
252
|
# unused
|
@@ -259,9 +264,21 @@ module LLVM
|
|
259
264
|
ConstantInt.from_ptr(ptr)
|
260
265
|
end
|
261
266
|
|
267
|
+
# parse string using const_int_of_string_and_size
|
268
|
+
# normalize the string to base 10 (used in llvm ir), and handle prefixes like 0x
|
269
|
+
private def const_int_of_string_and_size(str, radix)
|
270
|
+
normalized_string = radix == 10 ? str : str.to_i(radix).to_s
|
271
|
+
val = from_ptr(C.const_int_of_string_and_size(self, normalized_string, normalized_string.size, 10))
|
272
|
+
|
273
|
+
unpoisoned = normalized_string == val.to_s.split.last
|
274
|
+
unpoisoned ? val : poison
|
275
|
+
end
|
276
|
+
|
277
|
+
# parse string using const_int_of_string_and_size
|
278
|
+
# alternative implementation parsing with ruby:
|
279
|
+
# from_i(str.to_i(radix))
|
262
280
|
def parse(str, radix = 10)
|
263
|
-
|
264
|
-
from_i(str.to_i(radix))
|
281
|
+
const_int_of_string_and_size(str, radix)
|
265
282
|
end
|
266
283
|
|
267
284
|
def type
|
data/lib/llvm/core/value.rb
CHANGED
@@ -627,13 +627,24 @@ module LLVM
|
|
627
627
|
type.from_f(to_i.to_f)
|
628
628
|
end
|
629
629
|
|
630
|
-
def
|
630
|
+
private def to_i_i64(signed)
|
631
631
|
if signed
|
632
632
|
C.const_int_get_sext_value(self)
|
633
633
|
else
|
634
634
|
C.const_int_get_zext_value(self)
|
635
635
|
end
|
636
636
|
end
|
637
|
+
|
638
|
+
# const_int_get_sext_value const_int_get_zext_value only return long long, 64-bits
|
639
|
+
# beyond 64-bits parse the string value into a ruby integer
|
640
|
+
# TODO: overflow behavior is not the same on these arms, signed is ignored above 64-bits
|
641
|
+
def to_i(signed = true)
|
642
|
+
if type.width <= 64
|
643
|
+
to_i_i64(signed)
|
644
|
+
else
|
645
|
+
to_s.split.last.to_i
|
646
|
+
end
|
647
|
+
end
|
637
648
|
end
|
638
649
|
|
639
650
|
# creates LLVM::Int1, LLVM::Int64, etc
|
data/lib/llvm/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-llvm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 19.1.
|
4
|
+
version: 19.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jesse Johnson
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
12
|
+
date: 2024-10-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ffi
|