Skip to content

Commit 6efc526

Browse files
authored
Merge pull request #4155 from swiftwasm/main
[pull] swiftwasm from main
2 parents 7858d4d + 4253c2c commit 6efc526

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

lib/IRGen/ConstantBuilder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class ConstantAggregateBuilderBase
143143
}
144144

145145
void addAlignmentPadding(Alignment align) {
146-
auto misalignment = getNextOffsetFromGlobal() % IGM().getPointerAlignment();
146+
auto misalignment = getNextOffsetFromGlobal() % align;
147147
if (misalignment != Size(0))
148148
add(llvm::ConstantAggregateZero::get(
149149
llvm::ArrayType::get(IGM().Int8Ty,

lib/IRGen/GenProto.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3730,6 +3730,11 @@ llvm::Constant *IRGenModule::getAddrOfGenericEnvironment(
37303730
.getIntValue());
37313731
});
37323732

3733+
// Need to pad the structure after generic parameters
3734+
// up to four bytes because generic requirements that
3735+
// follow expect that alignment.
3736+
fields.addAlignmentPadding(Alignment(4));
3737+
37333738
// Generic requirements
37343739
irgen::addGenericRequirements(*this, fields, signature,
37353740
signature.getRequirements());

stdlib/public/Reflection/TypeRef.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -545,19 +545,14 @@ class DemanglingForTypeRef
545545

546546
Demangle::NodePointer
547547
visitBoundGenericTypeRef(const BoundGenericTypeRef *BG) {
548-
Node::Kind nodeKind;
549548
Node::Kind genericNodeKind;
550549
if (BG->isStruct()) {
551-
nodeKind = Node::Kind::Structure;
552550
genericNodeKind = Node::Kind::BoundGenericStructure;
553551
} else if (BG->isEnum()) {
554-
nodeKind = Node::Kind::Enum;
555552
genericNodeKind = Node::Kind::BoundGenericEnum;
556553
} else if (BG->isClass()) {
557-
nodeKind = Node::Kind::Class;
558554
genericNodeKind = Node::Kind::BoundGenericClass;
559555
} else {
560-
nodeKind = Node::Kind::OtherNominalType;
561556
genericNodeKind = Node::Kind::BoundGenericOtherNominalType;
562557
}
563558
auto unspecializedType = Dem.demangleType(BG->getMangledName());

utils/build_swift/build_swift/migration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99

1010
"""
11-
Temporary module with functionaly used to migrate away from build-script-impl.
11+
Temporary module with functionality used to migrate away from build-script-impl.
1212
"""
1313

1414

0 commit comments

Comments
 (0)