Skip to content

Commit e9074ee

Browse files
committed
Merge branch 'main' of github.com:swiftwasm/swift into maxd/main-merge
2 parents c3d23c5 + b13a8e9 commit e9074ee

File tree

103 files changed

+1041
-412
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+1041
-412
lines changed

cmake/modules/SwiftManpage.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,12 @@ function(manpage)
3939
ALL)
4040

4141
add_dependencies(${MP_INSTALL_IN_COMPONENT} ${manpage_target})
42+
set(MANPAGE_DEST "share/")
43+
if("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "OPENBSD")
44+
set(MANPAGE_DEST "")
45+
endif()
4246
swift_install_in_component(FILES "${output_file_name}"
43-
DESTINATION "share/man/man${MP_MAN_SECTION}"
47+
DESTINATION "${MANPAGE_DEST}man/man${MP_MAN_SECTION}"
4448
COMPONENT "${MP_INSTALL_IN_COMPONENT}")
4549
endfunction()
4650

include/swift/AST/DiagnosticsDriver.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,5 @@ WARNING(warn_drv_darwin_sdk_invalid_settings, none,
193193
REMARK(remark_forwarding_to_new_driver, none,
194194
"new Swift driver at '%0' will be used", (StringRef))
195195

196-
REMARK(remark_forwarding_driver_not_there, none,
197-
"new Swift driver at '%0' cannot be found; C++ driver will be used", (StringRef))
198-
199196
#define UNDEFINE_DIAGNOSTIC_MACROS
200197
#include "DefineDiagnosticMacros.h"

include/swift/AST/DiagnosticsSema.def

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,9 +1112,13 @@ ERROR(missing_unwrap_optional_try,none,
11121112
"value of optional type %0 not unwrapped; did you mean to use 'try!' "
11131113
"or chain with '?'?",
11141114
(Type))
1115-
ERROR(missing_forced_downcast,none,
1116-
"%0 is not convertible to %1; "
1117-
"did you mean to use 'as!' to force downcast?", (Type, Type))
1115+
ERROR(cannot_coerce_to_type, none,
1116+
"%0 is not convertible to %1", (Type, Type))
1117+
NOTE(missing_forced_downcast, none,
1118+
"did you mean to use 'as!' to force downcast?", ())
1119+
NOTE(missing_optional_downcast, none,
1120+
"did you mean to use 'as?' to conditionally downcast?", ())
1121+
11181122
WARNING(coercion_may_fail_warning,none,
11191123
"coercion from %0 to %1 may fail; use 'as?' or 'as!' instead",
11201124
(Type, Type))
@@ -1788,6 +1792,10 @@ ERROR(spi_attribute_on_protocol_requirement,none,
17881792
ERROR(spi_attribute_on_frozen_stored_properties,none,
17891793
"stored property %0 cannot be declared '@_spi' in a '@frozen' struct",
17901794
(DeclName))
1795+
WARNING(spi_attribute_on_import_of_public_module,none,
1796+
"'@_spi' import of %0 will not include any SPI symbols; "
1797+
"%0 was built from the public interface at %1",
1798+
(DeclName, StringRef))
17911799

17921800
// Opaque return types
17931801
ERROR(opaque_type_invalid_constraint,none,
@@ -2615,6 +2623,9 @@ WARNING(duplicate_anyobject_class_inheritance,none,
26152623
"redundant inheritance from 'AnyObject' and Swift 3 'class' keyword", ())
26162624
ERROR(inheritance_from_protocol_with_superclass,none,
26172625
"inheritance from class-constrained protocol composition type %0", (Type))
2626+
WARNING(anyobject_class_inheritance_deprecated,none,
2627+
"using 'class' keyword for protocol inheritance is deprecated; "
2628+
"use 'AnyObject' instead", ())
26182629
ERROR(multiple_inheritance,none,
26192630
"multiple inheritance from classes %0 and %1", (Type, Type))
26202631
ERROR(inheritance_from_non_protocol_or_class,none,

include/swift/Basic/InlineBitfield.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,32 @@ namespace swift {
8181
LLVM_PACKED_END \
8282
static_assert(sizeof(T##Bitfield) <= 8, "Bitfield overflow")
8383

84+
/// Define a full bitfield for type 'T' that uses all of the remaining bits in
85+
/// the inline bitfield. We allow for 'T' to have a single generic parameter.
86+
///
87+
/// For optimal code gen, place naturally sized fields at the end, with the
88+
/// largest naturally sized field at the very end. For example:
89+
///
90+
/// SWIFT_INLINE_BITFIELD_FULL(Foo, Bar, 1+8+16,
91+
/// flag : 1,
92+
/// : NumPadBits, // pad the center, not the end
93+
/// x : 8,
94+
/// y : 16
95+
/// );
96+
///
97+
/// NOTE: All instances of Foo will access via the same bitfield entry even if
98+
/// they differ in the templated value!
99+
#define SWIFT_INLINE_BITFIELD_FULL_TEMPLATE(T, U, C, ...) \
100+
LLVM_PACKED_START \
101+
class T##Bitfield { \
102+
template <typename TTy> \
103+
friend class T; \
104+
enum { NumPadBits = 64 - (Num##U##Bits + (C)) }; \
105+
uint64_t : Num##U##Bits, __VA_ARGS__; \
106+
} T; \
107+
LLVM_PACKED_END \
108+
static_assert(sizeof(T##Bitfield) <= 8, "Bitfield overflow")
109+
84110
/// Define an empty bitfield for type 'T'.
85111
#define SWIFT_INLINE_BITFIELD_EMPTY(T, U) \
86112
enum { Num##T##Bits = Num##U##Bits }

include/swift/SIL/OwnershipUtils.h

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,33 +32,22 @@ class DeadEndBlocks;
3232
/// Returns true if v is an address or trivial.
3333
bool isValueAddressOrTrivial(SILValue v);
3434

35-
/// These operations forward both owned and guaranteed ownership.
36-
bool isOwnershipForwardingValueKind(SILNodeKind kind);
37-
38-
/// Is this an operand that can forward both owned and guaranteed ownership
39-
/// kinds.
35+
/// Is this an operand that can forward both owned and guaranteed ownership into
36+
/// one of the operand's owner instruction's result.
4037
bool isOwnershipForwardingUse(Operand *op);
4138

42-
/// Is this an operand that forwards guaranteed ownership from its value to a
43-
/// result of the using instruction.
39+
/// Is this an operand that can forward guaranteed ownership into one of the
40+
/// operand's owner instruction's result.
4441
bool isGuaranteedForwardingUse(Operand *op);
4542

46-
/// These operations forward guaranteed ownership, but don't necessarily forward
47-
/// owned values.
48-
bool isGuaranteedForwardingValueKind(SILNodeKind kind);
43+
/// Is this an operand that can forward owned ownership into one of the
44+
/// operand's owner instruction's result.
45+
bool isOwnedForwardingUse(Operand *use);
4946

50-
/// Is this a value that is the result of an operation that forwards owned
51-
/// ownership.
47+
/// Is this a value that is the result of an instruction that forwards
48+
/// guaranteed ownership from one of its operands.
5249
bool isGuaranteedForwardingValue(SILValue value);
5350

54-
/// Is this a node kind that can forward owned ownership, but may not be able to
55-
/// forward guaranteed ownership.
56-
bool isOwnedForwardingValueKind(SILNodeKind kind);
57-
58-
/// Does this operand 'forward' owned ownership, but may not be able to forward
59-
/// guaranteed ownership.
60-
bool isOwnedForwardingUse(Operand *use);
61-
6251
/// Is this value the result of an instruction that 'forward's owned ownership,
6352
/// but may not be able to forward guaranteed ownership.
6453
///
@@ -76,6 +65,11 @@ class ForwardingOperand {
7665
static Optional<ForwardingOperand> get(Operand *use);
7766

7867
Operand *getUse() const { return use; }
68+
OwnershipConstraint getOwnershipConstraint() const {
69+
// We use a force unwrap since a ForwardingOperand should always have an
70+
// ownership constraint.
71+
return *use->getOwnershipConstraint();
72+
}
7973
ValueOwnershipKind getOwnershipKind() const;
8074
void setOwnershipKind(ValueOwnershipKind newKind) const;
8175
void replaceOwnershipKind(ValueOwnershipKind oldKind,

0 commit comments

Comments
 (0)