Skip to content

Commit c78bb3e

Browse files
committed
Merge remote-tracking branch 'origin/main' into rebranch
2 parents 2611686 + d7cf7fb commit c78bb3e

File tree

4 files changed

+38
-38
lines changed

4 files changed

+38
-38
lines changed

include/swift/Basic/LangOptions.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -632,14 +632,14 @@ namespace swift {
632632
/// contribute to a Swift Dependency Scanning hash.
633633
llvm::hash_code getModuleScanningHashComponents() const {
634634
auto hashValue = getPCHHashComponents();
635-
if (TargetVariant.hasValue())
636-
hashValue = llvm::hash_combine(hashValue, TargetVariant.getValue().str());
637-
if (ClangTarget.hasValue())
638-
hashValue = llvm::hash_combine(hashValue, ClangTarget.getValue().str());
639-
if (SDKVersion.hasValue())
640-
hashValue = llvm::hash_combine(hashValue, SDKVersion.getValue().getAsString());
641-
if (VariantSDKVersion.hasValue())
642-
hashValue = llvm::hash_combine(hashValue, VariantSDKVersion.getValue().getAsString());
635+
if (TargetVariant.has_value())
636+
hashValue = llvm::hash_combine(hashValue, TargetVariant.value().str());
637+
if (ClangTarget.has_value())
638+
hashValue = llvm::hash_combine(hashValue, ClangTarget.value().str());
639+
if (SDKVersion.has_value())
640+
hashValue = llvm::hash_combine(hashValue, SDKVersion.value().getAsString());
641+
if (VariantSDKVersion.has_value())
642+
hashValue = llvm::hash_combine(hashValue, VariantSDKVersion.value().getAsString());
643643
return hashValue;
644644
}
645645

lib/IRGen/TypeLayout.cpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ ScalarTypeLayoutEntry::layoutString(IRGenModule &IGM) const {
838838
0x0, 0x0, 0x0, 0x1, 'N'}};
839839
}
840840
default:
841-
return llvm::NoneType::None;
841+
return None;
842842
}
843843
}
844844

@@ -1156,7 +1156,7 @@ llvm::Optional<Size> AlignedGroupEntry::fixedSize(IRGenModule &IGM) const {
11561156
Size currentSize(0);
11571157
for (auto *entry : entries) {
11581158
if (!entry->fixedSize(IGM) || !entry->fixedAlignment(IGM)) {
1159-
return *(_fixedSize = llvm::Optional<Size>(llvm::NoneType::None));
1159+
return *(_fixedSize = llvm::Optional<Size>(None));
11601160
}
11611161
Size entrySize = *entry->fixedSize(IGM);
11621162
currentSize =
@@ -1174,7 +1174,7 @@ AlignedGroupEntry::fixedAlignment(IRGenModule &IGM) const {
11741174
for (auto *entry : entries) {
11751175
if (!entry->fixedAlignment(IGM)) {
11761176
return *(_fixedAlignment =
1177-
llvm::Optional<Alignment>(llvm::NoneType::None));
1177+
llvm::Optional<Alignment>(None));
11781178
}
11791179
currentAlignment = std::max(currentAlignment, *entry->fixedAlignment(IGM));
11801180
}
@@ -1190,7 +1190,7 @@ AlignedGroupEntry::fixedXICount(IRGenModule &IGM) const {
11901190
for (auto *entry : entries) {
11911191
auto entryXICount = entry->fixedXICount(IGM);
11921192
if (!entryXICount) {
1193-
return *(_fixedXICount = llvm::Optional<uint32_t>(llvm::NoneType::None));
1193+
return *(_fixedXICount = llvm::Optional<uint32_t>(None));
11941194
}
11951195
currentMaxXICount = std::max(*entryXICount, currentMaxXICount);
11961196
}
@@ -1269,7 +1269,7 @@ AlignedGroupEntry::layoutString(IRGenModule &IGM) const {
12691269
}
12701270
auto entryStr = entry->layoutString(IGM);
12711271
if (!entryStr) {
1272-
return llvm::NoneType::None;
1272+
return None;
12731273
}
12741274
uint32_t entryStrSize;
12751275
llvm::support::endian::write32be(&entryStrSize, entryStr->size());
@@ -1597,17 +1597,17 @@ bool ArchetypeLayoutEntry::canValueWitnessExtraInhabitantsUpTo(
15971597
bool ArchetypeLayoutEntry::isSingleRetainablePointer() const { return false; }
15981598

15991599
llvm::Optional<Size> ArchetypeLayoutEntry::fixedSize(IRGenModule &IGM) const {
1600-
return llvm::NoneType::None;
1600+
return None;
16011601
}
16021602

16031603
llvm::Optional<Alignment>
16041604
ArchetypeLayoutEntry::fixedAlignment(IRGenModule &IGM) const {
1605-
return llvm::NoneType::None;
1605+
return None;
16061606
}
16071607

16081608
llvm::Optional<uint32_t>
16091609
ArchetypeLayoutEntry::fixedXICount(IRGenModule &IGM) const {
1610-
return llvm::NoneType::None;
1610+
return None;
16111611
}
16121612

16131613
llvm::Value *
@@ -1638,7 +1638,7 @@ ArchetypeLayoutEntry::layoutString(IRGenModule &IGM) const {
16381638
return layoutStr;
16391639
}
16401640
}
1641-
return llvm::NoneType::None;
1641+
return None;
16421642
}
16431643

16441644
void ArchetypeLayoutEntry::destroy(IRGenFunction &IGF, Address addr) const {
@@ -1770,7 +1770,7 @@ EnumTypeLayoutEntry::layoutString(IRGenModule &IGM) const {
17701770
// E numEmptyPayloads numPayloads legnthOfEachPayload payloads
17711771
//
17721772
// Not yet supported/implemented
1773-
return llvm::NoneType::None;
1773+
return None;
17741774
} else {
17751775
// SINGLEENUM := 'e' SIZE SIZE VALUE
17761776
// e NumEmptyPayloads LengthOfPayload Payload
@@ -1783,7 +1783,7 @@ EnumTypeLayoutEntry::layoutString(IRGenModule &IGM) const {
17831783
llvm::Optional<std::vector<uint8_t>> payloadLayout =
17841784
cases[0]->layoutString(IGM);
17851785
if (!payloadLayout) {
1786-
return llvm::NoneType::None;
1786+
return None;
17871787
}
17881788
assert(payloadLayout->size() <= UINT32_MAX &&
17891789
"Enum layout exceeds length limit");
@@ -1938,7 +1938,7 @@ llvm::Optional<Size> EnumTypeLayoutEntry::fixedSize(IRGenModule &IGM) const {
19381938
auto payloadNumExtraInhabitants = cases[0]->fixedXICount(IGM);
19391939
auto payloadSize = cases[0]->fixedSize(IGM);
19401940
if (!payloadNumExtraInhabitants || !payloadSize) {
1941-
return *(_fixedSize = llvm::Optional<Size>(llvm::NoneType::None));
1941+
return *(_fixedSize = llvm::Optional<Size>(None));
19421942
}
19431943
if (*payloadNumExtraInhabitants >= numEmptyCases) {
19441944
size = *payloadSize;
@@ -1957,7 +1957,7 @@ llvm::Optional<Size> EnumTypeLayoutEntry::fixedSize(IRGenModule &IGM) const {
19571957
for (auto enum_case : cases) {
19581958
auto caseSize = enum_case->fixedSize(IGM);
19591959
if (!caseSize) {
1960-
return *(_fixedSize = llvm::Optional<Size>(llvm::NoneType::None));
1960+
return *(_fixedSize = llvm::Optional<Size>(None));
19611961
}
19621962
maxPayloadSize = std::max(*caseSize, maxPayloadSize);
19631963
}
@@ -1977,7 +1977,7 @@ EnumTypeLayoutEntry::fixedAlignment(IRGenModule &IGM) const {
19771977
auto caseAlign = payload->fixedAlignment(IGM);
19781978
if (!caseAlign) {
19791979
return *(_fixedAlignment =
1980-
llvm::Optional<Alignment>(llvm::NoneType::None));
1980+
llvm::Optional<Alignment>(None));
19811981
}
19821982
maxAlign = std::max(*caseAlign, maxAlign);
19831983
}
@@ -1999,7 +1999,7 @@ EnumTypeLayoutEntry::fixedXICount(IRGenModule &IGM) const {
19991999
// payloadNumExtraInhabitants - emptyCases : 0;
20002000
auto payloadXIs = cases[0]->fixedXICount(IGM);
20012001
if (!payloadXIs) {
2002-
return *(_fixedXICount = llvm::Optional<uint32_t>(llvm::NoneType::None));
2002+
return *(_fixedXICount = llvm::Optional<uint32_t>(None));
20032003
}
20042004
return *(_fixedXICount =
20052005
payloadXIs >= numEmptyCases ? *payloadXIs - numEmptyCases : 0);
@@ -2015,7 +2015,7 @@ EnumTypeLayoutEntry::fixedXICount(IRGenModule &IGM) const {
20152015
for (auto enum_case : cases) {
20162016
auto caseSize = enum_case->fixedSize(IGM);
20172017
if (!caseSize) {
2018-
return *(_fixedXICount = llvm::Optional<uint32_t>(llvm::NoneType::None));
2018+
return *(_fixedXICount = llvm::Optional<uint32_t>(None));
20192019
}
20202020
maxPayloadSize = std::max(*caseSize, maxPayloadSize);
20212021
}
@@ -2900,7 +2900,7 @@ llvm::Value *ResilientTypeLayoutEntry::size(IRGenFunction &IGF) const {
29002900

29012901
llvm::Optional<Size>
29022902
ResilientTypeLayoutEntry::fixedSize(IRGenModule &IGM) const {
2903-
return llvm::NoneType::None;
2903+
return None;
29042904
}
29052905

29062906
bool ResilientTypeLayoutEntry::isFixedSize(IRGenModule &IGM) const {
@@ -2920,12 +2920,12 @@ bool ResilientTypeLayoutEntry::canValueWitnessExtraInhabitantsUpTo(
29202920

29212921
llvm::Optional<Alignment>
29222922
ResilientTypeLayoutEntry::fixedAlignment(IRGenModule &IGM) const {
2923-
return llvm::NoneType::None;
2923+
return None;
29242924
}
29252925

29262926
llvm::Optional<uint32_t>
29272927
ResilientTypeLayoutEntry::fixedXICount(IRGenModule &IGM) const {
2928-
return llvm::NoneType::None;
2928+
return None;
29292929
}
29302930

29312931
llvm::Value *
@@ -3190,7 +3190,7 @@ void TypeInfoBasedTypeLayoutEntry::storeEnumTagSinglePayload(
31903190

31913191
llvm::Optional<std::vector<uint8_t>>
31923192
TypeInfoBasedTypeLayoutEntry::layoutString(IRGenModule &IGM) const {
3193-
return llvm::NoneType::None;
3193+
return None;
31943194
}
31953195

31963196
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)

lib/IRGen/TypeLayout.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -411,20 +411,20 @@ class AlignedGroupEntry : public TypeLayoutEntry, public llvm::FoldingSetNode {
411411
/// Optional(None) -> Not fixed size
412412
/// Optional(Size) -> Fixed Size
413413
mutable llvm::Optional<llvm::Optional<Size>> _fixedSize =
414-
llvm::NoneType::None;
414+
None;
415415
/// Memoize the value of fixedAlignment()
416416
/// None -> Not yet computed
417417
/// Optional(None) -> Not fixed Alignment
418418
/// Optional(Alignment) -> Fixed Alignment
419419
mutable llvm::Optional<llvm::Optional<Alignment>> _fixedAlignment =
420-
llvm::NoneType::None;
420+
None;
421421

422422
/// Memoize the value of fixedXICount()
423423
/// None -> Not yet computed
424424
/// Optional(None) -> Not fixed xi count
425425
/// Optional(Count) -> Fixed XICount
426426
mutable llvm::Optional<llvm::Optional<uint32_t>> _fixedXICount =
427-
llvm::NoneType::None;
427+
None;
428428

429429
llvm::Value *withExtraInhabitantProvidingEntry(
430430
IRGenFunction &IGF, Address addr, llvm::Type *returnType,
@@ -532,20 +532,20 @@ class EnumTypeLayoutEntry : public TypeLayoutEntry,
532532
/// Optional(None) -> Not fixed size
533533
/// Optional(Size) -> Fixed Size
534534
mutable llvm::Optional<llvm::Optional<Size>> _fixedSize =
535-
llvm::NoneType::None;
535+
None;
536536
/// Memoize the value of fixedAlignment()
537537
/// None -> Not yet computed
538538
/// Optional(None) -> Not fixed Alignment
539539
/// Optional(Alignment) -> Fixed Alignment
540540
mutable llvm::Optional<llvm::Optional<Alignment>> _fixedAlignment =
541-
llvm::NoneType::None;
541+
None;
542542

543543
/// Memoize the value of fixedXICount()
544544
/// None -> Not yet computed
545545
/// Optional(None) -> Not fixed xi count
546546
/// Optional(Count) -> Fixed XICount
547547
mutable llvm::Optional<llvm::Optional<uint32_t>> _fixedXICount =
548-
llvm::NoneType::None;
548+
None;
549549

550550
llvm::Value *maxPayloadSize(IRGenFunction &IGF) const;
551551
llvm::BasicBlock *testSinglePayloadEnumContainsPayload(IRGenFunction &IGF,

lib/SIL/Utils/Projection.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ Optional<ProjectionPath> ProjectionPath::getProjectionPath(SILValue Start,
376376
// and unions. This is currently only associated with structs.
377377
if (Start->getType().aggregateHasUnreferenceableStorage() ||
378378
End->getType().aggregateHasUnreferenceableStorage())
379-
return llvm::NoneType::None;
379+
return None;
380380

381381
auto Iter = End;
382382
while (Start != Iter) {
@@ -405,7 +405,7 @@ Optional<ProjectionPath> ProjectionPath::getProjectionPath(SILValue Start,
405405
// ProjectionPath never allow paths to be compared as a list of indices.
406406
// Only the encoded type+index pair will be compared.
407407
if (P.empty() || Start != Iter)
408-
return llvm::NoneType::None;
408+
return None;
409409

410410
// Reverse to get a path from base to most-derived.
411411
std::reverse(P.Path.begin(), P.Path.end());
@@ -540,15 +540,15 @@ ProjectionPath::removePrefix(const ProjectionPath &Path,
540540
const ProjectionPath &Prefix) {
541541
// We can only subtract paths that have the same base.
542542
if (Path.BaseType != Prefix.BaseType)
543-
return llvm::NoneType::None;
543+
return None;
544544

545545
// If Prefix is greater than or equal to Path in size, Prefix can not be a
546546
// prefix of Path. Return None.
547547
unsigned PrefixSize = Prefix.size();
548548
unsigned PathSize = Path.size();
549549

550550
if (PrefixSize >= PathSize)
551-
return llvm::NoneType::None;
551+
return None;
552552

553553
// First make sure that the prefix matches.
554554
Optional<ProjectionPath> P = ProjectionPath(Path.BaseType);

0 commit comments

Comments
 (0)