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

Generate bindings for Clang@15 #431

Merged
merged 1 commit into from
May 9, 2023
Merged
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
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"

[compat]
CEnum = "0.4"
Clang_jll = "12,13,14"
Clang_jll = "12,13,14,15"
Downloads = "1.4"
TOML = "1.0"
julia = "1.7.0"
Expand Down
4 changes: 4 additions & 0 deletions gen/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[deps]
BinaryBuilderBase = "7f725544-6523-48cd-82d1-3fa08ff4056e"
Clang = "40e3b903-d033-50b4-a0cc-940c62c95e31"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
5 changes: 3 additions & 2 deletions gen/generator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,14 @@ end
import Pkg
import BinaryBuilderBase: PkgSpec, Prefix, temp_prefix, setup_dependencies, cleanup_dependencies, destdir

const dependencies = PkgSpec[PkgSpec(; name = "Clang_jll")]
const dependencies = PkgSpec[PkgSpec(; name = "LLVM_full_jll")]

const libdir = joinpath(@__DIR__, "..", "lib")

for (llvm_version, julia_version) in (#=(v"12.0.1", v"1.7"),=#
(v"13.0.1", v"1.8"),
(v"14.0.5", v"1.9"))
(v"14.0.5", v"1.9"),
(v"15.0.6", v"1.10"))
@info "Generating..." llvm_version julia_version
temp_prefix() do prefix
# let prefix = Prefix(mktempdir())
Expand Down
132 changes: 66 additions & 66 deletions lib/13/LibClang.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4431,7 +4431,7 @@ end
"""
clang_Cursor_isObjCOptional(C)

Given a cursor that represents an Objective-C method or property declaration, return non-zero if the declaration was affected by "@optional". Returns zero if the cursor is not such a declaration or it is "@required".
Given a cursor that represents an Objective-C method or property declaration, return non-zero if the declaration was affected by "\\@optional". Returns zero if the cursor is not such a declaration or it is "\\@required".
"""
function clang_Cursor_isObjCOptional(C)
@ccall libclang.clang_Cursor_isObjCOptional(C::CXCursor)::Cuint
Expand Down Expand Up @@ -6265,71 +6265,6 @@ function clang_Type_visitFields(T, visitor, client_data)
@ccall libclang.clang_Type_visitFields(T::CXType, visitor::CXFieldVisitor, client_data::CXClientData)::Cuint
end

const CXRewriter = Ptr{Cvoid}

"""
clang_CXRewriter_create(TU)

Create [`CXRewriter`](@ref).
"""
function clang_CXRewriter_create(TU)
@ccall libclang.clang_CXRewriter_create(TU::CXTranslationUnit)::CXRewriter
end

"""
clang_CXRewriter_insertTextBefore(Rew, Loc, Insert)

Insert the specified string at the specified location in the original buffer.
"""
function clang_CXRewriter_insertTextBefore(Rew, Loc, Insert)
@ccall libclang.clang_CXRewriter_insertTextBefore(Rew::CXRewriter, Loc::CXSourceLocation, Insert::Cstring)::Cvoid
end

"""
clang_CXRewriter_replaceText(Rew, ToBeReplaced, Replacement)

Replace the specified range of characters in the input with the specified replacement.
"""
function clang_CXRewriter_replaceText(Rew, ToBeReplaced, Replacement)
@ccall libclang.clang_CXRewriter_replaceText(Rew::CXRewriter, ToBeReplaced::CXSourceRange, Replacement::Cstring)::Cvoid
end

"""
clang_CXRewriter_removeText(Rew, ToBeRemoved)

Remove the specified range.
"""
function clang_CXRewriter_removeText(Rew, ToBeRemoved)
@ccall libclang.clang_CXRewriter_removeText(Rew::CXRewriter, ToBeRemoved::CXSourceRange)::Cvoid
end

"""
clang_CXRewriter_overwriteChangedFiles(Rew)

Save all changed files to disk. Returns 1 if any files were not saved successfully, returns 0 otherwise.
"""
function clang_CXRewriter_overwriteChangedFiles(Rew)
@ccall libclang.clang_CXRewriter_overwriteChangedFiles(Rew::CXRewriter)::Cint
end

"""
clang_CXRewriter_writeMainFileToStdOut(Rew)

Write out rewritten version of the main file to stdout.
"""
function clang_CXRewriter_writeMainFileToStdOut(Rew)
@ccall libclang.clang_CXRewriter_writeMainFileToStdOut(Rew::CXRewriter)::Cvoid
end

"""
clang_CXRewriter_dispose(Rew)

Free the given [`CXRewriter`](@ref).
"""
function clang_CXRewriter_dispose(Rew)
@ccall libclang.clang_CXRewriter_dispose(Rew::CXRewriter)::Cvoid
end

"""
CXComment

Expand Down Expand Up @@ -6901,6 +6836,71 @@ function clang_uninstall_llvm_fatal_error_handler()
@ccall libclang.clang_uninstall_llvm_fatal_error_handler()::Cvoid
end

const CXRewriter = Ptr{Cvoid}

"""
clang_CXRewriter_create(TU)

Create [`CXRewriter`](@ref).
"""
function clang_CXRewriter_create(TU)
@ccall libclang.clang_CXRewriter_create(TU::CXTranslationUnit)::CXRewriter
end

"""
clang_CXRewriter_insertTextBefore(Rew, Loc, Insert)

Insert the specified string at the specified location in the original buffer.
"""
function clang_CXRewriter_insertTextBefore(Rew, Loc, Insert)
@ccall libclang.clang_CXRewriter_insertTextBefore(Rew::CXRewriter, Loc::CXSourceLocation, Insert::Cstring)::Cvoid
end

"""
clang_CXRewriter_replaceText(Rew, ToBeReplaced, Replacement)

Replace the specified range of characters in the input with the specified replacement.
"""
function clang_CXRewriter_replaceText(Rew, ToBeReplaced, Replacement)
@ccall libclang.clang_CXRewriter_replaceText(Rew::CXRewriter, ToBeReplaced::CXSourceRange, Replacement::Cstring)::Cvoid
end

"""
clang_CXRewriter_removeText(Rew, ToBeRemoved)

Remove the specified range.
"""
function clang_CXRewriter_removeText(Rew, ToBeRemoved)
@ccall libclang.clang_CXRewriter_removeText(Rew::CXRewriter, ToBeRemoved::CXSourceRange)::Cvoid
end

"""
clang_CXRewriter_overwriteChangedFiles(Rew)

Save all changed files to disk. Returns 1 if any files were not saved successfully, returns 0 otherwise.
"""
function clang_CXRewriter_overwriteChangedFiles(Rew)
@ccall libclang.clang_CXRewriter_overwriteChangedFiles(Rew::CXRewriter)::Cint
end

"""
clang_CXRewriter_writeMainFileToStdOut(Rew)

Write out rewritten version of the main file to stdout.
"""
function clang_CXRewriter_writeMainFileToStdOut(Rew)
@ccall libclang.clang_CXRewriter_writeMainFileToStdOut(Rew::CXRewriter)::Cvoid
end

"""
clang_CXRewriter_dispose(Rew)

Free the given [`CXRewriter`](@ref).
"""
function clang_CXRewriter_dispose(Rew)
@ccall libclang.clang_CXRewriter_dispose(Rew::CXRewriter)::Cvoid
end

const CINDEX_VERSION_MAJOR = 0

const CINDEX_VERSION_MINOR = 62
Expand Down
Loading