Skip to content
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
9 changes: 9 additions & 0 deletions cl/class.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,15 @@ func initClassTypeEx(ctx *pkgCtx, typDecl typDecl, this *classCtx, goName string
if *feats&featAllIgnore != 0 {
return
}
// A record that holds a callback (function pointer) field must carry the
// "// llgo:type C" directive so those callbacks use the C calling
// convention, mirroring how function-pointer typedefs are handled (see
// defineTypedef). featHasCallback is set by toTypeEx while visiting the
// members above, so it is only known now; upgrade the doc-only comment set
// at the top of this function to the directive form.
if *feats&featHasCallback != 0 {
typDecl.defs.SetComments(ctx.directiveTypeC(cls, true))
Comment thread
xushiwei marked this conversation as resolved.
}
// Establish the layout at offset 0, following the C++ Itanium ABI. A
// polymorphic class shares its vptr with its primary base (the first
// non-virtual *polymorphic* direct base in declaration order); that base is
Expand Down
4 changes: 4 additions & 0 deletions tool/_testc/clang-c-22.1.8/Index.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions tool/_testc/clang-c-22.1.8/Index/out.go
Original file line number Diff line number Diff line change
Expand Up @@ -2644,6 +2644,8 @@ type InclusionVisitor = func(_llcppg_param1 CXFile.File, _llcppg_param2 *CXSourc

// Evaluation result of a cursor
type EvalResult uintptr

// llgo:type C
type CursorAndRangeVisitor struct {
Context unsafe.Pointer
Visit func(_llcppg_param1 unsafe.Pointer, _llcppg_param2 Cursor, _llcppg_param3 CXSourceLocation.SourceRange) VisitorResult
Expand Down Expand Up @@ -2779,6 +2781,8 @@ type IdxEntityRefInfo struct {

// A group of callbacks used by #clang_indexSourceFile and
// #clang_indexTranslationUnit.
//
// llgo:type C
type IndexerCallbacks struct {
AbortQuery func(_llcppg_param1 ClientData, _llcppg_param2 unsafe.Pointer) c.Int
Diagnostic func(_llcppg_param1 ClientData, _llcppg_param2 CXDiagnostic.DiagnosticSet, _llcppg_param3 unsafe.Pointer)
Expand Down
2 changes: 2 additions & 0 deletions tool/_testc/python-3.14.8/pythread.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading