-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Description
I'm happy that StaticCompiler has been updated for current julia versions.
In this example, under julia 1.12 StaticCompiler seems to generate a faulty ll-file (and thus produces a error message). Here a function calls two functions that do some string operations. In julia 1.10 and 1.11 compiling works.
using StaticTools
using StaticCompiler
function lowercase(str::MallocString) :: MallocString
erg = str
for i in 1:length(str)
if str[i] > 0x40 && str[i] < 0x5b
erg[i] = str[i] + 0x20
end
end
return erg
end
function find_string(str::MallocString, str_array::MallocVector{MallocString}) :: Int64
for i in 1:length(str_array)
if str_array[i] == str
return i
end
end
return 0
end
function g(a::MallocString, l::MallocVector{MallocString}) :: Int64
b = lowercase(a)
find_string(b, l)
end
function f()
l = mfill(m"", 2)
l[1] = m"A"
l[2] = m"B"
g(m"A", l)
return 0
end
compile_executable(f, (), "C:\\jul\\staticcompiler")
It results in the error message
C:\jul\staticcompiler\f.ll:92:11: error: expected type
92 | %3 = or disjoint i8 %pointerref, 32
| ^
1 error generated.
ERROR: LoadError: failed process: Process(`clang -Wno-override-module 'C:\jul\staticcompiler\wrapper.c' 'C:\jul\staticcompiler\f.ll' -o 'C:\jul\staticcompiler\f.exe'`, ProcessExited(1)) [1]
Compiling works when putting the two string functions directly in the calling main function.
function f()
l = mfill(m"", 2)
l[1] = m"A"
l[2] = m"B"
b = lowercase(m"A")
find_string(b, l)
return 0
end
Metadata
Metadata
Assignees
Labels
No labels