Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make Cthulhu use Compiler.jl as stdlib optionally when it's loaded #619

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ authors = ["Valentin Churavy <[email protected]> and contributors"]

[deps]
CodeTracking = "da1fd8a2-8d9e-5ec2-8556-3022fb5608a2"
Compiler = "807dbc54-b67e-4c79-8afb-eafe4df6f2e1"
FoldingTrees = "1eca21be-9b9b-4ed8-839a-6d8ae26b1781"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
JuliaSyntax = "70703baa-626e-46a2-a12c-08ffd08c73b4"
Expand All @@ -17,9 +16,15 @@ UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
Unicode = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
WidthLimitedIO = "b8c1c048-cf81-46c6-9da0-18c1d99e41f2"

[weakdeps]
Compiler = "807dbc54-b67e-4c79-8afb-eafe4df6f2e1"

[extensions]
CthulhuCompilerExt = "Compiler"

[compat]
CodeTracking = "0.5, 1"
Compiler = "0.0.3"
Compiler = "0.0.3, 1.12.0"
FoldingTrees = "1"
InteractiveUtils = "1.9"
JuliaSyntax = "0.4"
Expand Down
16 changes: 16 additions & 0 deletions ext/CthulhuCompilerExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module CthulhuCompilerExt

@static if VERSION ≥ v"1.12.0-DEV.1581"
using Compiler: Compiler as CC
using Compiler.IRShow: IRShow
using Cthulhu: Cthulhu

function __init__()
CC.activate!(; reflection=true)
Cthulhu.CTHULHU_MODULE[] = @__MODULE__
end

include("../src/CthulhuBase.jl")
end

end
Loading
Loading