goplus / llgo

A Go compiler based on LLVM in order to better integrate Go with the C ecosystem including Python
Apache License 2.0
365 stars 26 forks source link

llcppsigfetch:undef custom type refer error #882

Open luoliwoshang opened 5 days ago

luoliwoshang commented 5 days ago

For undefined type references, an error type should be returned instead of the type corresponding to int.

llcppsigfetch --extract "void fn(a *undef);" -temp=true -cpp=false 

the under type show as a int.

[
    {
        "_Type": "FuncDecl",
        "Loc": {
            "_Type": "Location",
            "File": "temp.h"
        },
        "Doc": null,
        "Parent": null,
        "Name": {
            "_Type": "Ident",
            "Name": "fn"
        },
        "MangledName": "fn",
        "Type": {
            "_Type": "FuncType",
            "Params": {
                "_Type": "FieldList",
                "List": [
                    {
                        "_Type": "Field",
                        "Type": {
                            "_Type": "PointerType",
                            "X": {
                                "_Type": "BuiltinType",
                                "Kind": 6,
                                "Flags": 0
                            }
                        },
                        "Doc": null,
                        "Comment": null,
                        "IsStatic": false,
                        "Access": 0,
                        "Names": [
                            {
                                "_Type": "Ident",
                                "Name": "undef"
                            }
                        ]
                    }
                ]
            },
            "Ret": {
                "_Type": "BuiltinType",
                "Kind": 0,
                "Flags": 0
            }
        },
    }
]