Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

llcppsigfetch:unexpect lose fieldlist in funcdecl #94

Closed
luoliwoshang opened this issue Dec 25, 2024 · 1 comment
Closed

llcppsigfetch:unexpect lose fieldlist in funcdecl #94

luoliwoshang opened this issue Dec 25, 2024 · 1 comment

Comments

@luoliwoshang
Copy link
Contributor

luoliwoshang commented Dec 25, 2024

llcppsigfetch --extract /opt/homebrew/Cellar/raylib/5.0/include/raylib.h -out=true -cpp=false
RLAPI bool IsShaderReady(Shader shader);                                   // Check if a shader is ready
RLAPI void UnloadShader(Shader shader);                                    // Unload shader from GPU memory (VRAM)

对于UnloadShader,可以正确获得其参数列表

        {
          "_Type": "FuncDecl",
          "Loc": {
            "_Type": "Location",
            "File": "/opt/homebrew/Cellar/raylib/5.0/include/raylib.h"
          },
          "Doc": null,
          "Parent": null,
          "Name": {
            "_Type": "Ident",
            "Name": "UnloadShader"
          },
          "MangledName": "UnloadShader",
          "Type": {
            "_Type": "FuncType",
            "Params": {
              "_Type": "FieldList",
              "List": [
                {
                  "_Type": "Field",
                  "Type": {
                    "_Type": "Ident",
                    "Name": "Shader"
                  },
                  "Doc": null,
                  "Comment": null,
                  "IsStatic": false,
                  "Access": 0,
                  "Names": [
                    {
                      "_Type": "Ident",
                      "Name": "shader"
                    }
                  ]
                }
              ]
            },
            "Ret": {
              "_Type": "BuiltinType",
              "Kind": 0,
              "Flags": 0
            }
          },
          "IsInline": false,
          "IsStatic": false,
          "IsConst": false,
          "IsExplicit": false,
          "IsConstructor": false,
          "IsDestructor": false,
          "IsVirtual": false,
          "IsOverride": false
        },

而对于相同的只有一个Shader作为参数的IsShaderReady,其FieldList丢失了

        {
          "_Type": "FuncDecl",
          "Loc": {
            "_Type": "Location",
            "File": "/opt/homebrew/Cellar/raylib/5.0/include/raylib.h"
          },
          "Doc": null,
          "Parent": null,
          "Name": {
            "_Type": "Ident",
            "Name": "IsShaderReady"
          },
          "MangledName": "IsShaderReady",
          "Type": {
            "_Type": "FuncType",
            "Params": {
              "_Type": "FieldList",
              "List": null
            },
            "Ret": {
              "_Type": "BuiltinType",
              "Kind": 6,
              "Flags": 0
            }
          },
          "IsInline": false,
          "IsStatic": false,
          "IsConst": false,
          "IsExplicit": false,
          "IsConstructor": false,
          "IsDestructor": false,
          "IsVirtual": false,
          "IsOverride": false
        },
@luoliwoshang
Copy link
Contributor Author

luoliwoshang commented Dec 25, 2024

最小化到这个程度,又能正常获得FieldList

typedef struct Shader {
    unsigned int id; // Shader program id
    int *locs;       // Shader locations array (RL_MAX_SHADER_LOCATIONS)
} Shader;

bool IsShaderReady(Shader shader); // Check if a shader is ready
void UnloadShader(Shader shader);  // Unload shader from GPU memory (VRAM)

got

        {
          "_Type": "FuncDecl",
          "Loc": {
            "_Type": "Location",
            "File": "./test.h"
          },
          "Doc": null,
          "Parent": null,
          "Name": {
            "_Type": "Ident",
            "Name": "IsShaderReady"
          },
          "MangledName": "IsShaderReady",
          "Type": {
            "_Type": "FuncType",
            "Params": {
              "_Type": "FieldList",
              "List": [
                {
                  "_Type": "Field",
                  "Type": {
                    "_Type": "Ident",
                    "Name": "Shader"
                  },
                  "Doc": null,
                  "Comment": null,
                  "IsStatic": false,
                  "Access": 0,
                  "Names": [
                    {
                      "_Type": "Ident",
                      "Name": "shader"
                    }
                  ]
                }
              ]
            },
            "Ret": {
              "_Type": "BuiltinType",
              "Kind": 6,
              "Flags": 0
            }
          },
          "IsInline": false,
          "IsStatic": false,
          "IsConst": false,
          "IsExplicit": false,
          "IsConstructor": false,
          "IsDestructor": false,
          "IsVirtual": false,
          "IsOverride": false
        },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant