From bf87b76adbdaae57bf5b2f3792177ea4a5c0a8fe Mon Sep 17 00:00:00 2001 From: luoliwoshang <2643523683@qq.com> Date: Fri, 13 Sep 2024 16:06:06 +0800 Subject: [PATCH] llcppsigfetch:variadic order --- chore/_xtool/llcppsigfetch/parse/cvt.go | 2 +- .../cvt_test/decl_test/func_test/llgo.expect | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/chore/_xtool/llcppsigfetch/parse/cvt.go b/chore/_xtool/llcppsigfetch/parse/cvt.go index d6540994..ef32e700 100644 --- a/chore/_xtool/llcppsigfetch/parse/cvt.go +++ b/chore/_xtool/llcppsigfetch/parse/cvt.go @@ -646,12 +646,12 @@ func (ct *Converter) ProcessFieldList(cursor clang.Cursor) *ast.FieldList { params: params, converter: ct, } + clang.VisitChildren(cursor, visitFieldList, c.Pointer(ctx)) if (cursor.Kind == clang.CursorFunctionDecl || isMethod(cursor)) && cursor.IsVariadic() != 0 { params.List = append(params.List, &ast.Field{ Type: &ast.Variadic{}, }) } - clang.VisitChildren(cursor, visitFieldList, c.Pointer(ctx)) return params } diff --git a/chore/_xtool/llcppsigfetch/parse/cvt_test/decl_test/func_test/llgo.expect b/chore/_xtool/llcppsigfetch/parse/cvt_test/decl_test/func_test/llgo.expect index 3332ed99..383660fb 100644 --- a/chore/_xtool/llcppsigfetch/parse/cvt_test/decl_test/func_test/llgo.expect +++ b/chore/_xtool/llcppsigfetch/parse/cvt_test/decl_test/func_test/llgo.expect @@ -122,16 +122,6 @@ TestFuncDecl Case 3: "Params": { "_Type": "FieldList", "List": [{ - "_Type": "Field", - "Type": { - "_Type": "Variadic" - }, - "Doc": null, - "Comment": null, - "IsStatic": false, - "Access": 0, - "Names": null - }, { "_Type": "Field", "Type": { "_Type": "BuiltinType", @@ -146,6 +136,16 @@ TestFuncDecl Case 3: "_Type": "Ident", "Name": "a" }] + }, { + "_Type": "Field", + "Type": { + "_Type": "Variadic" + }, + "Doc": null, + "Comment": null, + "IsStatic": false, + "Access": 0, + "Names": null }] }, "Ret": {