Skip to content

Conversation

@liamappelbe
Copy link
Contributor

@liamappelbe liamappelbe commented Dec 3, 2025

BindingsIndex._declaredTypes is another part of the BindingsIndex that behaved inconsistently with the other parts. Most clang AST to ffigen AST transformations are cached inside the *decl_parser.dart files, but a few of them (enums, compounds, typealiases, and objC interfaces) were cached inside extractor.dart, in _declaredTypes.

I've removed _declaredTypes and refactored the caching of these entities to match the others. This significantly simplifies the extractor, since it doesn't need special handling for types that may or may not be cached. It does complicates BindingsIndex a bit, but makes it more consistent. My eventual goal is to collapse all the maps in BindingsIndex into one, and do all the caching in a single location.

@github-actions
Copy link

github-actions bot commented Dec 3, 2025

PR Health

License Headers ✔️
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
Files
no missing headers

All source files should start with a license header.

Unrelated files missing license headers
Files
pkgs/hooks_runner/test_data/download_assets/hook/build.dart
pkgs/objective_c/example/command_line/lib/main.dart
pkgs/objective_c/lib/src/ns_input_stream.dart

This check can be disabled by tagging the PR with skip-license-check.

API leaks ✔️

The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.

Package Leaked API symbol Leaking sources

This check can be disabled by tagging the PR with skip-leaking-check.

Breaking changes ✔️
Package Change Current Version New Version Needed Version Looking good?

This check can be disabled by tagging the PR with skip-breaking-check.

Changelog Entry ✔️
Package Changed Files

Changes to files need to be accounted for in their respective changelogs.

This check can be disabled by tagging the PR with skip-changelog-check.

@coveralls
Copy link

coveralls commented Dec 3, 2025

Coverage Status

coverage: 82.888% (+0.2%) from 82.722%
when pulling 3bd46bf on ffigen_cleanup_6
into 9d538ae on main.

@liamappelbe liamappelbe changed the title WIP: [ffigen] Remove BindingsIndex._declaredTypes [ffigen] Remove BindingsIndex._declaredTypes Dec 9, 2025
@liamappelbe liamappelbe marked this pull request as ready for review December 9, 2025 03:41
@liamappelbe liamappelbe merged commit 21b2bf7 into main Dec 9, 2025
26 of 30 checks passed
@liamappelbe liamappelbe deleted the ffigen_cleanup_6 branch December 9, 2025 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants