-
Notifications
You must be signed in to change notification settings - Fork 5
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
new binding for libclang-v17 #183
Comments
The same request. Is this library planned to be ported to the latest LLVM release? |
I have ported one https://github.com/Newbluecake/bootstrap/tree/clang-v17, but not latest version |
Thank you @Newbluecake for your work. I am trying to compile this code with your library https://gist.githubusercontent.com/josharian/54b2268af5792ff0e62f06437f28a8c9/raw/f4d07e7340ae0bf84991deaa9d2cb478b7909d4a/gen_git2go_enum.go and I have a warning:
it seems harmless. But then I run the tool with
which seems comes from
line. Do you have any idea why does it fail to find clang's My system is Arch Linux up-to-date with clang v17:
|
Yeah, it seems that libclang did't automatically add system dir for header search. I add following code in my project to fix this problem: cmd := exec.Command("bash", "-c", "echo | clang -E -v -")
output, err := cmd.CombinedOutput()
if err != nil {
return utils.LogError("exec clang err: %v", err)
}
outputStr := string(output)
lines := strings.Split(outputStr, "\n")
var start, end int
for i, line := range lines {
if line == "#include <...> search starts here:" {
start = i + 1
} else if line == "End of search list." {
end = i - 1
break
}
}
for i := start; i <= end; i++ {
dir := strings.TrimSpace(lines[i])
if dir == "" {
continue
}
psr.SysInclude = append(psr.SysInclude, dir)
} |
It is a bit strange that libclang is unable to detect the clang's sysinclude dir automatically. BTW @Newbluecake is there any chance you can update the bindings to clang-v18? |
@anatol Sorry about that, you may checkout https://github.com/Newbluecake/gen and try it. If you have any question, I can help you. |
Can this generate libtooling binding of clang? |
Hi, I'm using this library to parse c/c++ code. Everying is good until I need a new api in v17. I try to gen binding for this version, but there seems to be some error. Could you support this version?
The text was updated successfully, but these errors were encountered: