Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkgs/ffigen/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## 21.0.0

- __Breaking change__: Remove deprecated `useDartHandle` field from
`FfiGenerator`.
- __Breaking change__: Remove unused `includeSymbolAddress` field from
`Categories`, `Interfaces`, and `Protocols`.
- __Breaking change__: Remove deprecated `wrapperName` field from
`NativeExternalBindings`.

Expand Down
3 changes: 0 additions & 3 deletions pkgs/ffigen/ffigen.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -479,9 +479,6 @@
"preamble": {
"type": "string"
},
"use-dart-handle": {
"type": "boolean"
},
"ffi-native": {
"$oneOf": [
{
Expand Down
18 changes: 0 additions & 18 deletions pkgs/ffigen/lib/src/config_provider/config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,6 @@ final class FfiGenerator {
)
final List<LibraryImport> libraryImports;

/// Whether `Dart_Handle` should be mapped with Handle/Object.
// TODO(https://github.com/dart-lang/native/issues/2594): Remove this.
@Deprecated(
'Will be removed in a future version. Please reply in '
'https://github.com/dart-lang/native/issues/2594 if you rely on this.',
)
final bool useDartHandle;

/// Path to the clang library.
///
/// Only visible for YamlConfig plumbing.
Expand Down Expand Up @@ -109,11 +101,6 @@ final class FfiGenerator {
'https://github.com/dart-lang/native/issues/2597.',
)
this.libraryImports = const <LibraryImport>[],
@Deprecated(
'Will be removed in a future version. Please reply in '
'https://github.com/dart-lang/native/issues/2594 if you rely on this.',
)
this.useDartHandle = true,
@Deprecated('Only visible for YamlConfig plumbing.') this.libclangDylib,
});

Expand Down Expand Up @@ -579,7 +566,6 @@ final class Categories extends Declarations {
const Categories({
super.include,
super.includeMember,
super.includeSymbolAddress,
super.rename,
super.renameMember,
this.includeTransitive = true,
Expand Down Expand Up @@ -607,7 +593,6 @@ final class Interfaces extends Declarations {
const Interfaces({
super.include,
super.includeMember,
super.includeSymbolAddress,
super.rename,
super.renameMember,
this.includeTransitive = false,
Expand Down Expand Up @@ -638,7 +623,6 @@ final class Protocols extends Declarations {
const Protocols({
super.include,
super.includeMember,
super.includeSymbolAddress,
super.rename,
super.renameMember,
this.includeTransitive = false,
Expand Down Expand Up @@ -752,8 +736,6 @@ extension type Config(FfiGenerator ffiGen) implements FfiGenerator {
Protocols get objcProtocols => _objectiveC.protocols;
ExternalVersions get externalVersions => _objectiveC.externalVersions;
// ignore: deprecated_member_use_from_same_package
bool get useDartHandle => ffiGen.useDartHandle;
// ignore: deprecated_member_use_from_same_package
Map<String, ImportedType> get importedTypesByUsr => ffiGen.importedTypesByUsr;
String get wrapperName =>
(ffiGen.output.style as DynamicLibraryBindings).wrapperName;
Expand Down
15 changes: 0 additions & 15 deletions pkgs/ffigen/lib/src/config_provider/yaml_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,6 @@ final class YamlConfig {
String? get preamble => _preamble;
String? _preamble;

/// If `Dart_Handle` should be mapped with Handle/Object.
bool get useDartHandle => _useDartHandle;
late bool _useDartHandle;

/// Where to silence warning for enum integer type mimicking.
bool get silenceEnumWarning => _silenceEnumWarning;
late bool _silenceEnumWarning;
Expand Down Expand Up @@ -877,12 +873,6 @@ final class YamlConfig {
result: (node) => _preamble = node.value as String?,
),
),
HeterogeneousMapEntry(
key: strings.useDartHandle,
valueConfigSpec: BoolConfigSpec(),
defaultValue: (node) => true,
resultOrDefault: (node) => _useDartHandle = node.value as bool,
),
HeterogeneousMapEntry(
key: strings.ffiNative,
valueConfigSpec: OneOfConfigSpec(
Expand Down Expand Up @@ -1320,7 +1310,6 @@ final class YamlConfig {
? ObjectiveC(
interfaces: Interfaces(
include: objcInterfaces.shouldInclude,
includeSymbolAddress: objcInterfaces.shouldIncludeSymbolAddress,
includeMember: objcInterfaces.shouldIncludeMember,
rename: objcInterfaces.rename,
renameMember: objcInterfaces.renameMember,
Expand All @@ -1329,7 +1318,6 @@ final class YamlConfig {
),
protocols: Protocols(
include: objcProtocols.shouldInclude,
includeSymbolAddress: objcProtocols.shouldIncludeSymbolAddress,
includeMember: objcProtocols.shouldIncludeMember,
rename: objcProtocols.rename,
renameMember: objcProtocols.renameMember,
Expand All @@ -1338,7 +1326,6 @@ final class YamlConfig {
),
categories: Categories(
include: objcCategories.shouldInclude,
includeSymbolAddress: objcCategories.shouldIncludeSymbolAddress,
includeMember: objcCategories.shouldIncludeMember,
rename: objcCategories.rename,
renameMember: objcCategories.renameMember,
Expand All @@ -1356,8 +1343,6 @@ final class YamlConfig {
// ignore: deprecated_member_use_from_same_package
integers: Integers(imported: nativeTypeMappings.values.toList()),
// ignore: deprecated_member_use_from_same_package
useDartHandle: useDartHandle,
// ignore: deprecated_member_use_from_same_package
libclangDylib: libclangDylib,
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class _ParsedCompound {
unimplementedMemberType ||
flexibleArrayMember ||
bitFieldMember ||
(dartHandleMember && context.config.useDartHandle) ||
dartHandleMember ||
incompleteCompoundMember ||
alignment == clang_types.CXTypeLayoutError.CXTypeLayoutError_Incomplete;

Expand Down Expand Up @@ -237,7 +237,7 @@ void fillCompoundMembersIfNeeded(
'Removed All $className Members from ${compound.originalName}'
'(${compound.originalName}), Bit Field members not supported.',
);
} else if (parsed.dartHandleMember && context.config.useDartHandle) {
} else if (parsed.dartHandleMember) {
logger.fine(
'---- Removed $className members, reason: Dart_Handle member. '
'${cursor.completeStringRepr()}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,7 @@ Type getCodeGenType(
);

// Replace Pointer<_Dart_Handle> with Handle.
if (context.config.useDartHandle &&
s is Struct &&
s.usr == strings.dartHandleUsr) {
if (s is Struct && s.usr == strings.dartHandleUsr) {
return HandleType();
}
return PointerType(s);
Expand Down
1 change: 0 additions & 1 deletion pkgs/ffigen/lib/src/strings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ const supportedNativeTypeMappings = <String, SupportedNativeType>{
// Boolean flags.
const sort = 'sort';
const useSupportedTypedefs = 'use-supported-typedefs';
const useDartHandle = 'use-dart-handle';
const silenceEnumWarning = 'silence-enum-warning';
const ignoreSourceErrors = 'ignore-source-errors';

Expand Down
2 changes: 0 additions & 2 deletions pkgs/swiftgen/lib/src/generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ extension SwiftGenGenerator on SwiftGenerator {
interfaces: fg.Interfaces(
include: interfaces.include,
includeMember: interfaces.includeMember,
includeSymbolAddress: interfaces.includeSymbolAddress,
rename: interfaces.rename,
renameMember: interfaces.renameMember,
includeTransitive: interfaces.includeTransitive,
Expand All @@ -109,7 +108,6 @@ extension SwiftGenGenerator on SwiftGenerator {
protocols: fg.Protocols(
include: protocols.include,
includeMember: protocols.includeMember,
includeSymbolAddress: protocols.includeSymbolAddress,
rename: protocols.rename,
renameMember: protocols.renameMember,
includeTransitive: protocols.includeTransitive,
Expand Down