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,
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
}

View File

@@ -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": {