Skip to content

Commit

Permalink
Quick adaptation to new pm (#1538)
Browse files Browse the repository at this point in the history
* Quick adaptation to new pm

* fixup

* fix passes

* effects

* fix versioning

* more fixes

* fixup

* add gcloaded fb

* Update utils.jl

* more 1.11

* Update utils.jl

* Update utils.jl

* Update compiler.jl
  • Loading branch information
wsmoses committed Jun 16, 2024
1 parent 53f64a6 commit e980433
Show file tree
Hide file tree
Showing 7 changed files with 887 additions and 160 deletions.
9 changes: 7 additions & 2 deletions src/absint.jl
Original file line number Diff line number Diff line change
Expand Up @@ -323,20 +323,25 @@ function abs_typeof(arg::LLVM.Value, partial::Bool=false)::Union{Tuple{Bool, Typ
end

function abs_cstring(arg::LLVM.Value)::Tuple{Bool,String}

if isa(arg, ConstantExpr)
ce = arg
while isa(ce, ConstantExpr)
if opcode(ce) == LLVM.API.LLVMAddrSpaceCast || opcode(ce) == LLVM.API.LLVMBitCast || opcode(ce) == LLVM.API.LLVMIntToPtr
ce = operands(ce)[1]
elseif opcode(ce) == LLVM.API.LLVMGetElementPtr
if all(x -> isa(x, LLVM.ConstantInt) && convert(UInt, x) == 0, operands(ce)[2:end])
ce = operands(ce)[1]
else
break
end
else
break
end
end
if isa(ce, LLVM.GlobalVariable)
ce = LLVM.initializer(ce)
if (isa(ce, LLVM.ConstantArray) || isa(ce, LLVM.ConstantDataArray)) && eltype(value_type(ce)) == LLVM.IntType(8)
return (true, String(map((x)->convert(UInt8, x), collect(flib)[1:(end-1)])))
return (true, String(map((x)->convert(UInt8, x), collect(ce)[1:(end-1)])))
end

end
Expand Down
220 changes: 166 additions & 54 deletions src/compiler.jl

Large diffs are not rendered by default.

Loading

2 comments on commit e980433

@wsmoses
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/109130

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.12.14 -m "<description of version>" e9804331d9e5ef6c277982e68f9077203b6d1a37
git push origin v0.12.14

Please sign in to comment.