@@ -1009,26 +1009,6 @@ llvm::Constant *
1009
1009
ScalarTypeLayoutEntry::layoutString (IRGenModule &IGM,
1010
1010
GenericSignature genericSig) const {
1011
1011
return nullptr ;
1012
- // if (_layoutString) {
1013
- // return *_layoutString;
1014
- // }
1015
-
1016
- // LayoutStringBuilder B{};
1017
-
1018
- // if (!refCountString(IGM, B, genericSig)) {
1019
- // return *(_layoutString = llvm::Optional<llvm::Constant *>(nullptr));
1020
- // }
1021
-
1022
- // ConstantInitBuilder IB(IGM);
1023
- // auto SB = IB.beginStruct();
1024
- // SB.setPacked(true);
1025
-
1026
- // B.result(IGM, SB);
1027
-
1028
- // _layoutString = SB.finishAndCreateGlobal("", IGM.getPointerAlignment(),
1029
- // /*constant*/ true);
1030
-
1031
- // return *_layoutString;
1032
1012
}
1033
1013
1034
1014
bool ScalarTypeLayoutEntry::refCountString (IRGenModule &IGM,
@@ -1505,35 +1485,25 @@ AlignedGroupEntry::layoutString(IRGenModule &IGM,
1505
1485
1506
1486
bool AlignedGroupEntry::refCountString (IRGenModule &IGM, LayoutStringBuilder &B,
1507
1487
GenericSignature genericSig) const {
1508
- if (isFixedSize (IGM)) {
1509
- uint64_t offset = 0 ;
1510
- for (auto *entry : entries) {
1511
- if (offset) {
1512
- uint64_t alignmentMask = entry->fixedAlignment (IGM)->getMaskValue ();
1513
- uint64_t alignedOffset = offset + alignmentMask;
1514
- alignedOffset &= ~alignmentMask;
1515
- if (alignedOffset > offset) {
1516
- B.addSkip (alignedOffset - offset);
1517
- offset = alignedOffset;
1518
- }
1519
- }
1520
- if (!entry->refCountString (IGM, B, genericSig)) {
1521
- return false ;
1488
+ if (!isFixedSize (IGM)) {
1489
+ return false ;
1490
+ }
1491
+
1492
+ uint64_t offset = 0 ;
1493
+ for (auto *entry : entries) {
1494
+ if (offset) {
1495
+ uint64_t alignmentMask = entry->fixedAlignment (IGM)->getMaskValue ();
1496
+ uint64_t alignedOffset = offset + alignmentMask;
1497
+ alignedOffset &= ~alignmentMask;
1498
+ if (alignedOffset > offset) {
1499
+ B.addSkip (alignedOffset - offset);
1500
+ offset = alignedOffset;
1522
1501
}
1523
- offset += entry->fixedSize (IGM)->getValue ();
1524
1502
}
1525
- } else {
1526
- return false ;
1527
- // B.startDynamicAlignment();
1528
- // for (auto *entry : entries) {
1529
- // if (entry->isFixedSize(IGM)) {
1530
- // B.addAlignment(entry->fixedAlignment(IGM)->getValue());
1531
- // }
1532
- // if (!entry->refCountString(IGM, B, genericSig)) {
1533
- // return false;
1534
- // }
1535
- // }
1536
- // B.endDynamicAlignment();
1503
+ if (!entry->refCountString (IGM, B, genericSig)) {
1504
+ return false ;
1505
+ }
1506
+ offset += entry->fixedSize (IGM)->getValue ();
1537
1507
}
1538
1508
1539
1509
return true ;
@@ -3462,8 +3432,6 @@ TypeInfoBasedTypeLayoutEntry::layoutString(IRGenModule &IGM,
3462
3432
bool TypeInfoBasedTypeLayoutEntry::refCountString (
3463
3433
IRGenModule &IGM, LayoutStringBuilder &B,
3464
3434
GenericSignature genericSig) const {
3465
- // auto *accessor = createMetatypeAccessorFunction(IGM, representative);
3466
- // B.addResilientRefCount(accessor);
3467
3435
return false ;
3468
3436
}
3469
3437
0 commit comments