You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it seems like this line causes issues when passed a closure if building with go 1.6. Using GODEBUG=cgocheck=0 when running works but that's not really a good idea. Passing it a closure is the only way to actually pass arguments to your visitor I think, e.g.
// collectMatchKind collects all or one element name(s) in the sub AST-tree rooted at// the provided cursor.funccollectMatchKind(entityCursor clang.Cursor, kind clang.CursorKind,
collectAllbool) (names []string) {
// Invoke the visitor with this closure.entityCursor.Visit(func(cursor, parent clang.Cursor) (
status clang.ChildVisitResult) {
ifcursor.Kind() ==kind {
names=append(names, cursor.DisplayName())
if!collectAll {
returnclang.CVR_Break
}
}
returnclang.CVR_Continue
})
return// named
}
Hi. I was about to post a new issue surrounding this exact problem, and saw this existing one. I too have the same need to collect results during the visit routines. Currently I have had to resort to using global state. I can't seem to find a combination that works, to enable me to associate any kind of unique state collection with a particular visit.
I've tried using a method on a struct that can store state and also a function closing over identifiers. But everything I try seems to end up with this same cgo pointer limitation. Is there a concrete example that anyone can post which allows even some form of managing unique state for a visit operation?
Thanks so much for this binding btw. Its enabled me to write an awesome codegen tool at work. I just want to be able to make the codegen tool work in parallel, but I can't solve this need to have multiple visitors running.
Hi,
https://github.com/sbinet/go-clang/blob/master/cursor.go#L798
it seems like this line causes issues when passed a closure if building with go 1.6. Using
GODEBUG=cgocheck=0
when running works but that's not really a good idea. Passing it a closure is the only way to actually pass arguments to your visitor I think, e.g.The text was updated successfully, but these errors were encountered: