Skip to content

Making ir publicly accessible #2198

Open
@branchseer

Description

@branchseer

Hi, I'd like to use bindgen to parse headers into ir without the codegen part, and then with ir I can generate bindings in other languages.

There is --emit-ir, but that's in debug format which is not easily readable by machines.

I think we can make the ir module public (may need some cleanup though), and/or add a --emit-ir-jsonoption to emit ir in json represetantion, something like:

{
   "kind": "function",
   "name": "foo",
   "mangledName": "_foo",
   "signature": {
      "returnType": ...,
      "params": [ ... ]
   },
}

I'd be happy to work on a PR, if such change doesn't fall out of bindgen's scope.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions