Skip to content

Commit

Permalink
Regenerate the libclang bindings with a default docstring callback
Browse files Browse the repository at this point in the history
It looks like this also automatically the version of Clang 15 used.
  • Loading branch information
JamesWrigley authored and Gnimuc committed Dec 24, 2023
1 parent efa2632 commit 47e06ac
Show file tree
Hide file tree
Showing 4 changed files with 715 additions and 513 deletions.
11 changes: 11 additions & 0 deletions gen/generator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ function rewrite!(dag::ExprDAG)
end
end

function get_docs(node::ExprNode)
whitelist = [:CXRewriter, :clang_disposeCXTUResourceUsage]

if node.id in whitelist
String["*Documentation not found in headers.*"]
else
String[]
end
end

import Pkg
import BinaryBuilderBase: PkgSpec, Prefix, temp_prefix, setup_dependencies, cleanup_dependencies, destdir

Expand All @@ -61,6 +71,7 @@ for (llvm_version, julia_version) in (#=(v"12.0.1", v"1.7"),=#
artifact_paths = setup_dependencies(prefix, dependencies, platform; verbose=true)

let options = deepcopy(options)
options["general"]["callback_documentation"] = get_docs
output_file_path = joinpath(libdir, string(llvm_version.major), options["general"]["output_file_path"])
isdir(dirname(output_file_path)) || mkpath(dirname(output_file_path))
options["general"]["output_file_path"] = output_file_path
Expand Down
8 changes: 8 additions & 0 deletions lib/13/LibClang.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1696,6 +1696,11 @@ function clang_getCXTUResourceUsage(TU)
@ccall libclang.clang_getCXTUResourceUsage(TU::CXTranslationUnit)::CXTUResourceUsage
end

"""
clang_disposeCXTUResourceUsage(usage)

*Documentation not found in headers.*
"""
function clang_disposeCXTUResourceUsage(usage)
@ccall libclang.clang_disposeCXTUResourceUsage(usage::CXTUResourceUsage)::Cvoid
end
Expand Down Expand Up @@ -6836,6 +6841,9 @@ function clang_uninstall_llvm_fatal_error_handler()
@ccall libclang.clang_uninstall_llvm_fatal_error_handler()::Cvoid
end

"""
*Documentation not found in headers.*
"""
const CXRewriter = Ptr{Cvoid}

"""
Expand Down
8 changes: 8 additions & 0 deletions lib/14/LibClang.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1696,6 +1696,11 @@ function clang_getCXTUResourceUsage(TU)
@ccall libclang.clang_getCXTUResourceUsage(TU::CXTranslationUnit)::CXTUResourceUsage
end

"""
clang_disposeCXTUResourceUsage(usage)

*Documentation not found in headers.*
"""
function clang_disposeCXTUResourceUsage(usage)
@ccall libclang.clang_disposeCXTUResourceUsage(usage::CXTUResourceUsage)::Cvoid
end
Expand Down Expand Up @@ -6842,6 +6847,9 @@ function clang_uninstall_llvm_fatal_error_handler()
@ccall libclang.clang_uninstall_llvm_fatal_error_handler()::Cvoid
end

"""
*Documentation not found in headers.*
"""
const CXRewriter = Ptr{Cvoid}

"""
Expand Down
Loading

0 comments on commit 47e06ac

Please sign in to comment.