llcppsigfetch:variadic order

This commit is contained in:
luoliwoshang
2024-09-13 16:06:06 +08:00
parent c8e06b5837
commit bf87b76adb
2 changed files with 11 additions and 11 deletions

View File

@@ -646,12 +646,12 @@ func (ct *Converter) ProcessFieldList(cursor clang.Cursor) *ast.FieldList {
params: params, params: params,
converter: ct, converter: ct,
} }
clang.VisitChildren(cursor, visitFieldList, c.Pointer(ctx))
if (cursor.Kind == clang.CursorFunctionDecl || isMethod(cursor)) && cursor.IsVariadic() != 0 { if (cursor.Kind == clang.CursorFunctionDecl || isMethod(cursor)) && cursor.IsVariadic() != 0 {
params.List = append(params.List, &ast.Field{ params.List = append(params.List, &ast.Field{
Type: &ast.Variadic{}, Type: &ast.Variadic{},
}) })
} }
clang.VisitChildren(cursor, visitFieldList, c.Pointer(ctx))
return params return params
} }

View File

@@ -122,16 +122,6 @@ TestFuncDecl Case 3:
"Params": { "Params": {
"_Type": "FieldList", "_Type": "FieldList",
"List": [{ "List": [{
"_Type": "Field",
"Type": {
"_Type": "Variadic"
},
"Doc": null,
"Comment": null,
"IsStatic": false,
"Access": 0,
"Names": null
}, {
"_Type": "Field", "_Type": "Field",
"Type": { "Type": {
"_Type": "BuiltinType", "_Type": "BuiltinType",
@@ -146,6 +136,16 @@ TestFuncDecl Case 3:
"_Type": "Ident", "_Type": "Ident",
"Name": "a" "Name": "a"
}] }]
}, {
"_Type": "Field",
"Type": {
"_Type": "Variadic"
},
"Doc": null,
"Comment": null,
"IsStatic": false,
"Access": 0,
"Names": null
}] }]
}, },
"Ret": { "Ret": {