@@ -3688,41 +3688,6 @@ namespace {
3688
3688
return nullptr ;
3689
3689
}
3690
3690
3691
- bool hasVisibleValueWitnessTable (CanType t) const {
3692
- // Some builtin and structural types have value witnesses exported from
3693
- // the runtime.
3694
- auto &C = IGF.IGM .Context ;
3695
- if (t == C.TheEmptyTupleType
3696
- || t == C.TheNativeObjectType
3697
- || t == C.TheBridgeObjectType
3698
- || t == C.TheRawPointerType
3699
- || t == C.getAnyObjectType ())
3700
- return true ;
3701
- if (auto intTy = dyn_cast<BuiltinIntegerType>(t)) {
3702
- auto width = intTy->getWidth ();
3703
- if (width.isPointerWidth ())
3704
- return true ;
3705
- if (width.isFixedWidth ()) {
3706
- switch (width.getFixedWidth ()) {
3707
- case 8 :
3708
- case 16 :
3709
- case 32 :
3710
- case 64 :
3711
- case 128 :
3712
- case 256 :
3713
- return true ;
3714
- default :
3715
- return false ;
3716
- }
3717
- }
3718
- return false ;
3719
- }
3720
-
3721
- // TODO: If a nominal type is in the same source file as we're currently
3722
- // emitting, we would be able to see its value witness table.
3723
- return false ;
3724
- }
3725
-
3726
3691
// / Fallback default implementation.
3727
3692
llvm::Value *visitType (CanType t, DynamicMetadataRequest request) {
3728
3693
auto silTy = IGF.IGM .getLoweredType (t);
@@ -3731,7 +3696,10 @@ namespace {
3731
3696
// If the type is in the same source file, or has a common value
3732
3697
// witness table exported from the runtime, we can project from the
3733
3698
// value witness table instead of emitting a new record.
3734
- if (hasVisibleValueWitnessTable (t))
3699
+ //
3700
+ // TODO: If a nominal type is in the same source file as we're currently
3701
+ // emitting, we would be able to see its value witness table.
3702
+ if (IGF.IGM .IsWellKnownBuiltinOrStructralType (t))
3735
3703
return emitFromValueWitnessTable (t);
3736
3704
3737
3705
// If the type is a singleton aggregate, the field's layout is equivalent
0 commit comments