File tree 2 files changed +2
-23
lines changed
2 files changed +2
-23
lines changed Original file line number Diff line number Diff line change @@ -1424,7 +1424,7 @@ impl CodeGenerator for CompInfo {
1424
1424
//
1425
1425
// FIXME: Once we generate proper vtables, we need to codegen the
1426
1426
// vtable, but *not* generate a field for it in the case that
1427
- // needs_explicit_vtable is false but has_vtable is true.
1427
+ // HasVtable::has_vtable_ptr is false but HasVtable:: has_vtable is true.
1428
1428
//
1429
1429
// Also, we need to generate the vtable in such a way it "inherits" from
1430
1430
// the parent too.
@@ -1434,7 +1434,7 @@ impl CodeGenerator for CompInfo {
1434
1434
StructLayoutTracker :: new ( ctx, self , & canonical_name) ;
1435
1435
1436
1436
if !is_opaque {
1437
- if self . needs_explicit_vtable ( ctx, item ) {
1437
+ if item . has_vtable_ptr ( ctx) {
1438
1438
let vtable =
1439
1439
Vtable :: new ( item. id ( ) , self . methods ( ) , self . base_members ( ) ) ;
1440
1440
vtable. codegen ( ctx, result, item) ;
Original file line number Diff line number Diff line change @@ -1451,27 +1451,6 @@ impl CompInfo {
1451
1451
self . packed
1452
1452
}
1453
1453
1454
- /// Returns whether this type needs an explicit vtable because it has
1455
- /// virtual methods and none of its base classes has already a vtable.
1456
- pub fn needs_explicit_vtable (
1457
- & self ,
1458
- ctx : & BindgenContext ,
1459
- item : & Item ,
1460
- ) -> bool {
1461
- item. has_vtable ( ctx) && !self . base_members . iter ( ) . any ( |base| {
1462
- // NB: Ideally, we could rely in all these types being `comp`, and
1463
- // life would be beautiful.
1464
- //
1465
- // Unfortunately, given the way we implement --match-pat, and also
1466
- // that you can inherit from templated types, we need to handle
1467
- // other cases here too.
1468
- ctx. resolve_type ( base. ty )
1469
- . canonical_type ( ctx)
1470
- . as_comp ( )
1471
- . map_or ( false , |_| base. ty . has_vtable ( ctx) )
1472
- } )
1473
- }
1474
-
1475
1454
/// Returns true if compound type has been forward declared
1476
1455
pub fn is_forward_declaration ( & self ) -> bool {
1477
1456
self . is_forward_declaration
You can’t perform that action at this time.
0 commit comments