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

Support LLVM 4.0 #141

Closed
zimmski opened this issue Mar 15, 2017 · 16 comments · Fixed by #151
Closed

Support LLVM 4.0 #141

zimmski opened this issue Mar 15, 2017 · 16 comments · Fixed by #151

Comments

@zimmski
Copy link
Member

zimmski commented Mar 15, 2017

I just tried to generate the bindings for LLVM 4.0. Does not work out of the box:

vagrant@vagrant-ubuntu-trusty-64:~/go/src/github.com/go-clang/v4.0$ make test
CGO_LDFLAGS="-L`llvm-config --libdir`" go test -timeout 60s ./...
# github.com/go-clang/v4.0/clang
clang/clang_gen.go:252:6: warning: 'clang_getDiagnosticCategoryName' is deprecated [-Wdeprecated-declarations]
clang/clang-c/Index.h:961:10: note: 'clang_getDiagnosticCategoryName' has been explicitly marked deprecated here
# github.com/go-clang/v4.0/clang
clang/codecompleteresults.go:4: ccr.NumDiagnostics undefined (type *CodeCompleteResults has no field or method NumDiagnostics)
clang/codecompleteresults.go:7: ccr.Diagnostic undefined (type *CodeCompleteResults has no field or method Diagnostic)
clang/clang_test.go:10: undefined: NewIndex
clang/clang_test.go:20: cursor.IsNull undefined (type Cursor has no field or method IsNull)
clang/clang_test.go:26: cursor.Spelling undefined (type Cursor has no field or method Spelling)
clang/clang_test.go:30: cursor.Spelling undefined (type Cursor has no field or method Spelling)
clang/clang_test.go:46: undefined: NewIndex
clang/clang_test.go:55: cursor.Spelling undefined (type Cursor has no field or method Spelling)
clang/clang_test.go:72: cursor.Spelling undefined (type Cursor has no field or method Spelling)
clang/completion_test.go:11: undefined: NewIndex
clang/completion_test.go:11: too many errors
FAIL    github.com/go-clang/v4.0/clang [build failed]
# github.com/go-clang/v4.0/clang
clang/clang_gen.go:252:6: warning: 'clang_getDiagnosticCategoryName' is deprecated [-Wdeprecated-declarations]
clang/clang-c/Index.h:961:10: note: 'clang_getDiagnosticCategoryName' has been explicitly marked deprecated here
# github.com/go-clang/v4.0/clang
clang/codecompleteresults.go:4: ccr.NumDiagnostics undefined (type *CodeCompleteResults has no field or method NumDiagnostics)
clang/codecompleteresults.go:7: ccr.Diagnostic undefined (type *CodeCompleteResults has no field or method Diagnostic)
clang/cursor.go:28: cannot use &cp_availability[i] (type *C.struct_CXPlatformAvailability) as type C.struct_CXPlatformAvailability in field value
clang/idxbaseclassinfo_gen.go:16: cannot use o (type *C.struct___18) as type C.struct___18 in field value
clang/idxcxxclassdeclinfo_gen.go:20: cannot use o (type *C.struct___23) as type C.struct___23 in field value
clang/idxdeclinfo_gen.go:20: cannot use o (type *C.struct___18) as type C.struct___18 in field value
clang/idxdeclinfo_gen.go:39: cannot use o (type *C.struct___20) as type C.struct___20 in field value
clang/idxdeclinfo_gen.go:51: cannot use o (type *C.struct___20) as type C.struct___20 in field value
clang/idxdeclinfo_gen.go:80: cannot use o (type *C.struct___20) as type C.struct___20 in field value
clang/idxentityrefinfo_gen.go:31: cannot use o (type *C.struct___18) as type C.struct___18 in field value
clang/idxentityrefinfo_gen.go:31: too many errors
FAIL    github.com/go-clang/v4.0/cmd/go-clang-compdb [build failed]
FAIL    github.com/go-clang/v4.0/cmd/go-clang-dump [build failed]
make: *** [test] Error 2
vagrant@vagrant-ubuntu-trusty-64:~/go/src/github.com/go-clang/v4.0$ make install
CGO_LDFLAGS="-L`llvm-config --libdir`" go install ./...
# github.com/go-clang/v4.0/clang
clang/clang_gen.go:252:6: warning: 'clang_getDiagnosticCategoryName' is deprecated [-Wdeprecated-declarations]
clang/clang-c/Index.h:961:10: note: 'clang_getDiagnosticCategoryName' has been explicitly marked deprecated here
# github.com/go-clang/v4.0/clang
clang/codecompleteresults.go:4: ccr.NumDiagnostics undefined (type *CodeCompleteResults has no field or method NumDiagnostics)
clang/codecompleteresults.go:7: ccr.Diagnostic undefined (type *CodeCompleteResults has no field or method Diagnostic)
clang/cursor.go:28: cannot use &cp_availability[i] (type *C.struct_CXPlatformAvailability) as type C.struct_CXPlatformAvailability in field value
clang/idxbaseclassinfo_gen.go:16: cannot use o (type *C.struct___18) as type C.struct___18 in field value
clang/idxcxxclassdeclinfo_gen.go:20: cannot use o (type *C.struct___23) as type C.struct___23 in field value
clang/idxdeclinfo_gen.go:20: cannot use o (type *C.struct___18) as type C.struct___18 in field value
clang/idxdeclinfo_gen.go:39: cannot use o (type *C.struct___20) as type C.struct___20 in field value
clang/idxdeclinfo_gen.go:51: cannot use o (type *C.struct___20) as type C.struct___20 in field value
clang/idxdeclinfo_gen.go:80: cannot use o (type *C.struct___20) as type C.struct___20 in field value
clang/idxentityrefinfo_gen.go:31: cannot use o (type *C.struct___18) as type C.struct___18 in field value
clang/idxentityrefinfo_gen.go:31: too many errors
make: *** [install] Error 2
@zchee
Copy link
Member

zchee commented Mar 15, 2017

@zimmski Interesting it. LLVM has been changed some implements?

@zimmski
Copy link
Member Author

zimmski commented Apr 9, 2017

Looks like some functions have been dropped and some types are misused.

@zchee
Copy link
Member

zchee commented Apr 9, 2017

@zimmski interesting, I want to haer that.

@josharian
Copy link
Contributor

Has anyone dug into this, or is anyone planning to?

It's not surprising that 4.0 should bring backwards-incompatible changes. Any thoughts about whether to have a gen3.x and a gen4.x vs trying to make gen handle both?

@zchee
Copy link
Member

zchee commented Feb 16, 2018

@zimmski Hi,

As @josharian said, 3.0.x and 4.0.x are no backward compatibly. Also, LLVM has been released 5.0.1, next major release may 6.0.0.

I’m very like this project and known go-clang internal a little. So, If you don’t intend to maintain this project, I want to join go-clang org and maintain to follow the LLVM(libclang) latest versions API.
Do you think about it?

Thanks

@sbinet
Copy link
Member

sbinet commented Feb 16, 2018

@zchee feel free to send PRs (I can spare a few cycles to review and eventually merge)

@zchee
Copy link
Member

zchee commented Feb 16, 2018

@sbinet Thanks quickly.
OK, I will debug why can’t generate files and checks no backward compatibility APIs.

BTW, If I want to create new versions repository such as v5.0, Can you make it?

@sbinet
Copy link
Member

sbinet commented Mar 1, 2018

done: https://github.com/go-clang/v5.0

@zchee
Copy link
Member

zchee commented Mar 1, 2018

@sbinet Thaaaanks!

@sbinet
Copy link
Member

sbinet commented Mar 1, 2018

do note that all the vX.Y repos are actually generated from go-clang/gen/cmd/go-clang-gen...

@zchee
Copy link
Member

zchee commented Mar 1, 2018

@sbinet

do note that all the vX.Y repos are actually generated from go-clang/gen/cmd/go-clang-gen...

I see, thanks for details.

@zchee
Copy link
Member

zchee commented Mar 1, 2018

@sbinet If you have time, could you also create v4.0 for support LLVM 4.0 mainline ?
I try to 5.0 first but planned also support 4.0.

@sbinet
Copy link
Member

sbinet commented Mar 1, 2018

https://github.com/go-clang/v4.0
done.

@zchee
Copy link
Member

zchee commented Mar 1, 2018

@sbinet Thanks :)

@zchee
Copy link
Member

zchee commented Mar 21, 2018

@sbinet Hi,
I think I can make time for development go-clang next month but LLVM has been released v6.0.0.
http://releases.llvm.org/download.html#6.0.0

Could you also create initial v6.0 repository same as v{4,5}.0 for now?

@zchee
Copy link
Member

zchee commented Mar 24, 2018

@sbinet @zimmski sorry, just ping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants