-
Notifications
You must be signed in to change notification settings - Fork 45
Allow external consumers to register custom C++ passes #525
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
Open
oscardssmith
wants to merge
2
commits into
JuliaLLVM:master
Choose a base branch
from
oscardssmith:os/register-passes
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Your PR requires formatting changes to meet the project's style guidelines. Click here to view the suggested changes.diff --git a/lib/15/libLLVM_extra.jl b/lib/15/libLLVM_extra.jl
index 0204f16d..441166f6 100644
--- a/lib/15/libLLVM_extra.jl
+++ b/lib/15/libLLVM_extra.jl
@@ -372,7 +372,7 @@ function LLVMDisposePassBuilderExtensions(Extensions)
end
function LLVMPassBuilderExtensionsPushRegistrationCallbacks(Options, RegistrationCallback)
- ccall((:LLVMPassBuilderExtensionsPushRegistrationCallbacks, libLLVMExtra), Cvoid, (LLVMPassBuilderExtensionsRef, Ptr{Cvoid}), Options, RegistrationCallback)
+ return ccall((:LLVMPassBuilderExtensionsPushRegistrationCallbacks, libLLVMExtra), Cvoid, (LLVMPassBuilderExtensionsRef, Ptr{Cvoid}), Options, RegistrationCallback)
end
# typedef LLVMBool ( * LLVMJuliaModulePassCallback ) ( LLVMModuleRef M , void * Thunk )
diff --git a/lib/16/libLLVM_extra.jl b/lib/16/libLLVM_extra.jl
index 0204f16d..441166f6 100644
--- a/lib/16/libLLVM_extra.jl
+++ b/lib/16/libLLVM_extra.jl
@@ -372,7 +372,7 @@ function LLVMDisposePassBuilderExtensions(Extensions)
end
function LLVMPassBuilderExtensionsPushRegistrationCallbacks(Options, RegistrationCallback)
- ccall((:LLVMPassBuilderExtensionsPushRegistrationCallbacks, libLLVMExtra), Cvoid, (LLVMPassBuilderExtensionsRef, Ptr{Cvoid}), Options, RegistrationCallback)
+ return ccall((:LLVMPassBuilderExtensionsPushRegistrationCallbacks, libLLVMExtra), Cvoid, (LLVMPassBuilderExtensionsRef, Ptr{Cvoid}), Options, RegistrationCallback)
end
# typedef LLVMBool ( * LLVMJuliaModulePassCallback ) ( LLVMModuleRef M , void * Thunk )
diff --git a/lib/17/libLLVM_extra.jl b/lib/17/libLLVM_extra.jl
index 485a4912..ee9edb51 100644
--- a/lib/17/libLLVM_extra.jl
+++ b/lib/17/libLLVM_extra.jl
@@ -332,7 +332,7 @@ function LLVMDisposePassBuilderExtensions(Extensions)
end
function LLVMPassBuilderExtensionsPushRegistrationCallbacks(Options, RegistrationCallback)
- ccall((:LLVMPassBuilderExtensionsPushRegistrationCallbacks, libLLVMExtra), Cvoid, (LLVMPassBuilderExtensionsRef, Ptr{Cvoid}), Options, RegistrationCallback)
+ return ccall((:LLVMPassBuilderExtensionsPushRegistrationCallbacks, libLLVMExtra), Cvoid, (LLVMPassBuilderExtensionsRef, Ptr{Cvoid}), Options, RegistrationCallback)
end
# typedef LLVMBool ( * LLVMJuliaModulePassCallback ) ( LLVMModuleRef M , void * Thunk )
diff --git a/lib/18/libLLVM_extra.jl b/lib/18/libLLVM_extra.jl
index 36487c40..cc1173eb 100644
--- a/lib/18/libLLVM_extra.jl
+++ b/lib/18/libLLVM_extra.jl
@@ -266,7 +266,7 @@ function LLVMDisposePassBuilderExtensions(Extensions)
end
function LLVMPassBuilderExtensionsPushRegistrationCallbacks(Options, RegistrationCallback)
- ccall((:LLVMPassBuilderExtensionsPushRegistrationCallbacks, libLLVMExtra), Cvoid, (LLVMPassBuilderExtensionsRef, Ptr{Cvoid}), Options, RegistrationCallback)
+ return ccall((:LLVMPassBuilderExtensionsPushRegistrationCallbacks, libLLVMExtra), Cvoid, (LLVMPassBuilderExtensionsRef, Ptr{Cvoid}), Options, RegistrationCallback)
end
# typedef LLVMBool ( * LLVMJuliaModulePassCallback ) ( LLVMModuleRef M , void * Thunk )
diff --git a/lib/19/libLLVM_extra.jl b/lib/19/libLLVM_extra.jl
index 36487c40..cc1173eb 100644
--- a/lib/19/libLLVM_extra.jl
+++ b/lib/19/libLLVM_extra.jl
@@ -266,7 +266,7 @@ function LLVMDisposePassBuilderExtensions(Extensions)
end
function LLVMPassBuilderExtensionsPushRegistrationCallbacks(Options, RegistrationCallback)
- ccall((:LLVMPassBuilderExtensionsPushRegistrationCallbacks, libLLVMExtra), Cvoid, (LLVMPassBuilderExtensionsRef, Ptr{Cvoid}), Options, RegistrationCallback)
+ return ccall((:LLVMPassBuilderExtensionsPushRegistrationCallbacks, libLLVMExtra), Cvoid, (LLVMPassBuilderExtensionsRef, Ptr{Cvoid}), Options, RegistrationCallback)
end
# typedef LLVMBool ( * LLVMJuliaModulePassCallback ) ( LLVMModuleRef M , void * Thunk )
diff --git a/lib/20/libLLVM_extra.jl b/lib/20/libLLVM_extra.jl
index 50c4c4f6..f5bed765 100644
--- a/lib/20/libLLVM_extra.jl
+++ b/lib/20/libLLVM_extra.jl
@@ -222,7 +222,7 @@ function LLVMDisposePassBuilderExtensions(Extensions)
end
function LLVMPassBuilderExtensionsPushRegistrationCallbacks(Options, RegistrationCallback)
- ccall((:LLVMPassBuilderExtensionsPushRegistrationCallbacks, libLLVMExtra), Cvoid, (LLVMPassBuilderExtensionsRef, Ptr{Cvoid}), Options, RegistrationCallback)
+ return ccall((:LLVMPassBuilderExtensionsPushRegistrationCallbacks, libLLVMExtra), Cvoid, (LLVMPassBuilderExtensionsRef, Ptr{Cvoid}), Options, RegistrationCallback)
end
# typedef LLVMBool ( * LLVMJuliaModulePassCallback ) ( LLVMModuleRef M , void * Thunk ) |
vchuravy
reviewed
Sep 30, 2025
Needs test? |
oscardssmith
commented
Sep 30, 2025
oscardssmith
commented
Sep 30, 2025
This is tested by the normal tests. Registering the Julia passes does this |
I assumed @vchuravy was asking for a test of an external consumer, but would be good to confirm. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
desired for Enzyme.
cc: @gbaraldi @wsmoses