Skip to content

Commit 0785398

Browse files
committed
---
yaml --- r: 340794 b: refs/heads/rxwei-patch-1 c: 0a27c88 h: refs/heads/master
1 parent 0ab5daf commit 0785398

File tree

91 files changed

+480
-1718
lines changed

Some content is hidden

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

91 files changed

+480
-1718
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-08-18-a: b10b1fce14385faa6d44f6b933e95
10151015
refs/heads/rdar-43033749-fix-batch-mode-no-diags-swift-5.0-branch: a14e64eaad30de89f0f5f0b2a782eed7ecdcb255
10161016
refs/heads/revert-19006-error-bridging-integer-type: 8a9065a3696535305ea53fe9b71f91cbe6702019
10171017
refs/heads/revert-19050-revert-19006-error-bridging-integer-type: ecf752d54b05dd0a20f510f0bfa54a3fec3bcaca
1018-
refs/heads/rxwei-patch-1: b70cd7031fe7a2c400976007abbfff1597189174
1018+
refs/heads/rxwei-patch-1: 0a27c88163d17b55b17a5e4766c198eca48f6d1d
10191019
refs/heads/shahmishal-patch-1: e58ec0f7488258d42bef51bc3e6d7b3dc74d7b2a
10201020
refs/heads/typelist-existential: 4046359efd541fb5c72d69a92eefc0a784df8f5e
10211021
refs/tags/swift-4.2-DEVELOPMENT-SNAPSHOT-2018-08-20-a: 4319ba09e4fb8650ee86061075c74a016b6baab9

branches/rxwei-patch-1/cmake/modules/AddSwift.cmake

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1383,7 +1383,7 @@ function(_add_swift_library_single target name)
13831383
# NOTE(compnerd) use the C linker language to invoke `clang` rather than
13841384
# `clang++` as we explicitly link against the C++ runtime. We were previously
13851385
# actually passing `-nostdlib++` to avoid the C++ runtime linkage.
1386-
if("${SWIFTLIB_SINGLE_SDK}" STREQUAL "ANDROID")
1386+
if(SWIFTLIB_SINGLE_SDK STREQUAL ANDROID)
13871387
set_property(TARGET "${target}" PROPERTY
13881388
LINKER_LANGUAGE "C")
13891389
else()
@@ -2346,6 +2346,17 @@ function(_add_swift_executable_single name)
23462346
target_link_libraries("${name}" PRIVATE ${SWIFTEXE_SINGLE_LINK_LIBRARIES})
23472347
swift_common_llvm_config("${name}" ${SWIFTEXE_SINGLE_LLVM_LINK_COMPONENTS})
23482348

2349+
# NOTE(compnerd) use the C linker language to invoke `clang` rather than
2350+
# `clang++` as we explicitly link against the C++ runtime. We were previously
2351+
# actually passing `-nostdlib++` to avoid the C++ runtime linkage.
2352+
if(SWIFTEXE_SINGLE_SDK STREQUAL ANDROID)
2353+
set_property(TARGET "${name}" PROPERTY
2354+
LINKER_LANGUAGE "C")
2355+
else()
2356+
set_property(TARGET "${name}" PROPERTY
2357+
LINKER_LANGUAGE "CXX")
2358+
endif()
2359+
23492360
set_target_properties(${name} PROPERTIES FOLDER "Swift executables")
23502361
endfunction()
23512362

branches/rxwei-patch-1/cmake/modules/SwiftSource.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ function(_compile_swift_files
269269
# into the new runtime.
270270
if (SWIFTFILE_IS_STDLIB OR SWIFTFILE_IS_SDK_OVERLAY)
271271
list(APPEND swift_flags "-runtime-compatibility-version" "none")
272-
list(APPEND swift_flags "-disable-autolinking-runtime-compatibility-dynamic-replacements")
273272
endif()
274273

275274
if (SWIFTFILE_IS_STDLIB_CORE OR SWIFTFILE_IS_SDK_OVERLAY)

branches/rxwei-patch-1/include/swift/AST/ASTContext.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -590,10 +590,6 @@ class ASTContext final {
590590
/// Get the runtime availability of the opaque types language feature for the target platform.
591591
AvailabilityContext getOpaqueTypeAvailability();
592592

593-
/// Get the runtime availability of features introduced in the Swift 5.1
594-
/// compiler for the target platform.
595-
AvailabilityContext getSwift51Availability();
596-
597593
//===--------------------------------------------------------------------===//
598594
// Diagnostics Helper functions
599595
//===--------------------------------------------------------------------===//

branches/rxwei-patch-1/include/swift/AST/Decl.h

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ class alignas(1 << DeclAlignInBits) Decl {
605605
HasAnyUnavailableValues : 1
606606
);
607607

608-
SWIFT_INLINE_BITFIELD(ModuleDecl, TypeDecl, 1+1+1+1+1+1+1+1,
608+
SWIFT_INLINE_BITFIELD(ModuleDecl, TypeDecl, 1+1+1+1+1+1+1,
609609
/// If the module was or is being compiled with `-enable-testing`.
610610
TestingEnabled : 1,
611611

@@ -620,18 +620,14 @@ class alignas(1 << DeclAlignInBits) Decl {
620620
/// Whether all imports have been resolved. Used to detect circular imports.
621621
HasResolvedImports : 1,
622622

623-
/// If the module was or is being compiled with `-enable-private-imports`.
623+
// If the module was or is being compiled with `-enable-private-imports`.
624624
PrivateImportsEnabled : 1,
625625

626-
/// If the module is compiled with `-enable-implicit-dynamic`.
626+
// If the module is compiled with `-enable-implicit-dynamic`.
627627
ImplicitDynamicEnabled : 1,
628628

629-
/// Whether the module is a system module.
630-
IsSystemModule : 1,
631-
632-
/// Whether the module was imported from Clang (or, someday, maybe another
633-
/// language).
634-
IsNonSwiftModule : 1
629+
// Whether the module is a system module.
630+
IsSystemModule : 1
635631
);
636632

637633
SWIFT_INLINE_BITFIELD(PrecedenceGroupDecl, Decl, 1+2,
@@ -2700,11 +2696,7 @@ class ValueDecl : public Decl {
27002696
/// True if this is a C function that was imported as a member of a type in
27012697
/// Swift.
27022698
bool isImportAsMember() const;
2703-
2704-
/// Returns true if the declaration's interface type is a function type with a
2705-
/// curried self parameter.
2706-
bool hasCurriedSelf() const;
2707-
2699+
27082700
/// Get the decl for this value's opaque result type, if it has one.
27092701
OpaqueTypeDecl *getOpaqueResultTypeDecl() const;
27102702

@@ -7193,14 +7185,6 @@ inline bool ValueDecl::isImportAsMember() const {
71937185
return false;
71947186
}
71957187

7196-
inline bool ValueDecl::hasCurriedSelf() const {
7197-
if (auto *afd = dyn_cast<AbstractFunctionDecl>(this))
7198-
return afd->hasImplicitSelfDecl();
7199-
if (isa<EnumElementDecl>(this))
7200-
return true;
7201-
return false;
7202-
}
7203-
72047188
inline bool Decl::isPotentiallyOverridable() const {
72057189
if (isa<VarDecl>(this) ||
72067190
isa<SubscriptDecl>(this) ||

branches/rxwei-patch-1/include/swift/AST/DiagnosticsSema.def

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -792,11 +792,6 @@ ERROR(module_not_compiled_for_private_import,none,
792792
ERROR(import_implementation_cannot_be_exported,none,
793793
"module %0 cannot be both exported and implementation-only", (Identifier))
794794

795-
WARNING(module_not_compiled_with_library_evolution,none,
796-
"module %0 was not compiled with library evolution support; "
797-
"using it means binary compatibility for %1 can't be guaranteed",
798-
(Identifier, Identifier))
799-
800795

801796
// Operator decls
802797
ERROR(ambiguous_operator_decls,none,
@@ -4157,9 +4152,6 @@ ERROR(availability_protocol_requires_version,
41574152
NOTE(availability_protocol_requirement_here, none,
41584153
"protocol requirement here", ())
41594154

4160-
WARNING(public_decl_needs_availability, none,
4161-
"public declarations should have an availability attribute with -require-explicit-availability", ())
4162-
41634155
// This doesn't display as an availability diagnostic, but it's
41644156
// implemented there and fires when these subscripts are marked
41654157
// unavailable, so it seems appropriate to put it here.

branches/rxwei-patch-1/include/swift/AST/Expr.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2126,6 +2126,8 @@ class CollectionExpr : public Expr {
21262126
SourceLoc RBracketLoc;
21272127
ConcreteDeclRef Initializer;
21282128

2129+
Expr *SemanticExpr = nullptr;
2130+
21292131
/// Retrieve the intrusive pointer storage from the subtype
21302132
Expr *const *getTrailingObjectsPointer() const;
21312133
Expr **getTrailingObjectsPointer() {
@@ -2190,6 +2192,9 @@ class CollectionExpr : public Expr {
21902192
SourceRange getSourceRange() const {
21912193
return SourceRange(LBracketLoc, RBracketLoc);
21922194
}
2195+
2196+
Expr *getSemanticExpr() const { return SemanticExpr; }
2197+
void setSemanticExpr(Expr *e) { SemanticExpr = e; }
21932198

21942199
static bool classof(const Expr *e) {
21952200
return e->getKind() >= ExprKind::First_CollectionExpr &&
@@ -2267,8 +2272,6 @@ class DictionaryExpr final : public CollectionExpr,
22672272
static bool classof(const Expr *e) {
22682273
return e->getKind() == ExprKind::Dictionary;
22692274
}
2270-
2271-
Type getElementType();
22722275
};
22732276

22742277
/// Subscripting expressions like a[i] that refer to an element within a

branches/rxwei-patch-1/include/swift/AST/IRGenOptions.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ class IRGenOptions {
228228

229229
/// Pull in runtime compatibility shim libraries by autolinking.
230230
Optional<llvm::VersionTuple> AutolinkRuntimeCompatibilityLibraryVersion;
231-
Optional<llvm::VersionTuple> AutolinkRuntimeCompatibilityDynamicReplacementLibraryVersion;
232231

233232
IRGenOptions()
234233
: DWARFVersion(2), OutputKind(IRGenOutputKind::LLVMAssembly),

branches/rxwei-patch-1/include/swift/AST/Module.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -337,18 +337,6 @@ class ModuleDecl : public DeclContext, public TypeDecl {
337337
Bits.ModuleDecl.IsSystemModule = flag;
338338
}
339339

340-
/// Returns true if this module is a non-Swift module that was imported into
341-
/// Swift.
342-
///
343-
/// Right now that's just Clang modules.
344-
bool isNonSwiftModule() const {
345-
return Bits.ModuleDecl.IsNonSwiftModule;
346-
}
347-
/// \see #isNonSwiftModule
348-
void setIsNonSwiftModule(bool flag = true) {
349-
Bits.ModuleDecl.IsNonSwiftModule = flag;
350-
}
351-
352340
bool isResilient() const {
353341
return getResilienceStrategy() != ResilienceStrategy::Default;
354342
}

branches/rxwei-patch-1/include/swift/Basic/LangOptions.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,6 @@ namespace swift {
9696
/// Enable 'availability' restrictions for App Extensions.
9797
bool EnableAppExtensionRestrictions = false;
9898

99-
/// Require public declarations to declare an introduction OS version.
100-
bool RequireExplicitAvailability = false;
101-
102-
/// Introduction platform and version to suggest as fix-it
103-
/// when using RequireExplicitAvailability.
104-
std::string RequireExplicitAvailabilityTarget;
105-
10699
///
107100
/// Support for alternate usage modes
108101
///

branches/rxwei-patch-1/include/swift/Option/Options.td

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -312,14 +312,6 @@ def enable_library_evolution : Flag<["-"], "enable-library-evolution">,
312312
Flags<[FrontendOption, ModuleInterfaceOption]>,
313313
HelpText<"Build the module to allow binary-compatible library evolution">;
314314

315-
def require_explicit_availability : Flag<["-"], "require-explicit-availability">,
316-
Flags<[FrontendOption, NoInteractiveOption]>,
317-
HelpText<"Require explicit availability on public declarations">;
318-
def require_explicit_availability_target : Separate<["-"], "require-explicit-availability-target">,
319-
Flags<[FrontendOption, NoInteractiveOption]>,
320-
HelpText<"Suggest fix-its adding @available(<target>, *) to public declarations without availability">,
321-
MetaVarName<"<target>">;
322-
323315
def module_name : Separate<["-"], "module-name">,
324316
Flags<[FrontendOption, ModuleInterfaceOption]>,
325317
HelpText<"Name of the module to build">;
@@ -912,10 +904,4 @@ def disable_autolinking_runtime_compatibility : Flag<["-"], "disable-autolinking
912904
Flags<[FrontendOption]>,
913905
HelpText<"Do not use autolinking for runtime compatibility libraries">;
914906

915-
def disable_autolinking_runtime_compatibility_dynamic_replacements
916-
: Flag<[ "-" ], "disable-autolinking-runtime-compatibility-dynamic-replacements">,
917-
Flags<[ FrontendOption ]>,
918-
HelpText<"Do not use autolinking for the dynamic replacement runtime "
919-
"compatibility library">;
920-
921907
include "FrontendOptions.td"

branches/rxwei-patch-1/include/swift/Runtime/Exclusivity.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,13 @@ void swift_beginAccess(void *pointer, ValueBuffer *buffer,
4444
/// replacement function if it should be called.
4545
/// Returns null if the original function (which is passed in \p CurrFn) should
4646
/// be called.
47-
#ifdef __APPLE__
48-
__attribute__((weak_import))
49-
#endif
5047
SWIFT_RUNTIME_EXPORT
5148
char *swift_getFunctionReplacement(char **ReplFnPtr, char *CurrFn);
5249

5350
/// Returns the original function of a replaced function, which is loaded from
5451
/// \p OrigFnPtr.
5552
/// This function is called from a replacement function to call the original
5653
/// function.
57-
#ifdef __APPLE__
58-
__attribute__((weak_import))
59-
#endif
6054
SWIFT_RUNTIME_EXPORT
6155
char *swift_getOrigOfReplaceable(char **OrigFnPtr);
6256

branches/rxwei-patch-1/include/swift/Runtime/RuntimeFnWrappersGen.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,6 @@
2222
namespace swift {
2323

2424
class AvailabilityContext;
25-
class ASTContext;
26-
27-
enum class RuntimeAvailability {
28-
AlwaysAvailable,
29-
AvailableByCompatibilityLibrary,
30-
ConditionallyAvailable
31-
};
3225

3326
/// Generate an llvm declaration for a runtime entry with a
3427
/// given name, return types, argument types, attributes and
@@ -37,8 +30,7 @@ llvm::Constant *getRuntimeFn(llvm::Module &Module,
3730
llvm::Constant *&cache,
3831
char const *name,
3932
llvm::CallingConv::ID cc,
40-
RuntimeAvailability availability,
41-
ASTContext *context,
33+
bool isWeakLinked,
4234
llvm::ArrayRef<llvm::Type*> retTypes,
4335
llvm::ArrayRef<llvm::Type*> argTypes,
4436
llvm::ArrayRef<llvm::Attribute::AttrKind> attrs);

branches/rxwei-patch-1/include/swift/Runtime/RuntimeFunctions.def

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ FUNCTION(GetGenericMetadata, swift_getGenericMetadata,
638638
// const OpaqueTypeDescriptor *descriptor,
639639
// uintptr_t index);
640640
FUNCTION(GetOpaqueTypeMetadata, swift_getOpaqueTypeMetadata,
641-
SwiftCC, ConditionallyAvailable,
641+
SwiftCC, OpaqueTypeAvailability,
642642
RETURNS(TypeMetadataResponseTy),
643643
ARGS(SizeTy, Int8PtrTy, OpaqueTypeDescriptorPtrTy, SizeTy),
644644
ATTRS(NoUnwind, ReadOnly))
@@ -647,7 +647,7 @@ FUNCTION(GetOpaqueTypeMetadata, swift_getOpaqueTypeMetadata,
647647
// const OpaqueTypeDescriptor *descriptor,
648648
// uintptr_t index);
649649
FUNCTION(GetOpaqueTypeConformance, swift_getOpaqueTypeConformance,
650-
SwiftCC, ConditionallyAvailable,
650+
SwiftCC, OpaqueTypeAvailability,
651651
RETURNS(WitnessTablePtrTy),
652652
ARGS(Int8PtrTy, OpaqueTypeDescriptorPtrTy, SizeTy),
653653
ATTRS(NoUnwind, ReadOnly))
@@ -1225,14 +1225,12 @@ FUNCTION(EndAccess, swift_endAccess, C_CC, AlwaysAvailable,
12251225
ARGS(getFixedBufferTy()->getPointerTo()),
12261226
ATTRS(NoUnwind))
12271227

1228-
FUNCTION(GetOrigOfReplaceable, swift_getOrigOfReplaceable, C_CC,
1229-
AvailableByCompatibilityLibrary,
1228+
FUNCTION(GetOrigOfReplaceable, swift_getOrigOfReplaceable, C_CC, AlwaysAvailable,
12301229
RETURNS(FunctionPtrTy),
12311230
ARGS(FunctionPtrTy->getPointerTo()),
12321231
ATTRS(NoUnwind))
12331232

1234-
FUNCTION(GetReplacement, swift_getFunctionReplacement, C_CC,
1235-
AvailableByCompatibilityLibrary,
1233+
FUNCTION(GetReplacement, swift_getFunctionReplacement, C_CC, AlwaysAvailable,
12361234
RETURNS(FunctionPtrTy),
12371235
ARGS(FunctionPtrTy->getPointerTo(), FunctionPtrTy),
12381236
ATTRS(NoUnwind))

branches/rxwei-patch-1/lib/AST/ASTDumper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2127,16 +2127,16 @@ class PrintExpr : public ExprVisitor<PrintExpr> {
21272127
OS << '\n';
21282128
printRec(elt);
21292129
}
2130+
printSemanticExpr(E->getSemanticExpr());
21302131
PrintWithColorRAII(OS, ParenthesisColor) << ')';
21312132
}
21322133
void visitDictionaryExpr(DictionaryExpr *E) {
21332134
printCommon(E, "dictionary_expr");
2134-
PrintWithColorRAII(OS, LiteralValueColor) << " initializer=";
2135-
E->getInitializer().dump(PrintWithColorRAII(OS, LiteralValueColor).getOS());
21362135
for (auto elt : E->getElements()) {
21372136
OS << '\n';
21382137
printRec(elt);
21392138
}
2139+
printSemanticExpr(E->getSemanticExpr());
21402140
PrintWithColorRAII(OS, ParenthesisColor) << ')';
21412141
}
21422142
void visitSubscriptExpr(SubscriptExpr *E) {

branches/rxwei-patch-1/lib/AST/ASTWalker.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,8 @@ class Traversal : public ASTVisitor<Traversal, Expr*, Stmt*,
525525
}
526526

527527
Expr *visitCollectionExpr(CollectionExpr *E) {
528+
HANDLE_SEMANTIC_EXPR(E);
529+
528530
for (auto &elt : E->getElements())
529531
if (Expr *Sub = doIt(elt))
530532
elt = Sub;

branches/rxwei-patch-1/lib/AST/Availability.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,6 @@ AvailabilityContext AvailabilityInference::inferForType(Type t) {
218218
}
219219

220220
AvailabilityContext ASTContext::getOpaqueTypeAvailability() {
221-
return getSwift51Availability();
222-
}
223-
224-
AvailabilityContext ASTContext::getSwift51Availability() {
225221
auto target = LangOpts.Target;
226222

227223
if (target.isMacOSX()) {

branches/rxwei-patch-1/lib/AST/Expr.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,19 +1485,6 @@ Type ArrayExpr::getElementType() {
14851485
.subst(init.getSubstitutions());
14861486
}
14871487

1488-
Type DictionaryExpr::getElementType() {
1489-
auto init = getInitializer();
1490-
if (!init)
1491-
return Type();
1492-
1493-
auto *decl = cast<ConstructorDecl>(init.getDecl());
1494-
return decl->getMethodInterfaceType()
1495-
->getAs<AnyFunctionType>()
1496-
->getParams()[0]
1497-
.getPlainType()
1498-
.subst(init.getSubstitutions());
1499-
}
1500-
15011488
DictionaryExpr *DictionaryExpr::create(ASTContext &C, SourceLoc LBracketLoc,
15021489
ArrayRef<Expr*> Elements,
15031490
ArrayRef<SourceLoc> CommaLocs,

branches/rxwei-patch-1/lib/ClangImporter/ClangImporter.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1672,7 +1672,8 @@ ModuleDecl *ClangImporter::Implementation::finishLoadingClangModule(
16721672
Identifier name = SwiftContext.getIdentifier((*clangModule).Name);
16731673
result = ModuleDecl::create(name, SwiftContext);
16741674
result->setIsSystemModule(clangModule->IsSystem);
1675-
result->setIsNonSwiftModule();
1675+
// Silence error messages about testably importing a Clang module.
1676+
result->setTestingEnabled();
16761677
result->setHasResolvedImports();
16771678

16781679
wrapperUnit =
@@ -1841,7 +1842,8 @@ ClangModuleUnit *ClangImporter::Implementation::getWrapperForModule(
18411842
Identifier name = SwiftContext.getIdentifier(underlying->Name);
18421843
auto wrapper = ModuleDecl::create(name, SwiftContext);
18431844
wrapper->setIsSystemModule(underlying->IsSystem);
1844-
wrapper->setIsNonSwiftModule();
1845+
// Silence error messages about testably importing a Clang module.
1846+
wrapper->setTestingEnabled();
18451847
wrapper->setHasResolvedImports();
18461848

18471849
auto file = new (SwiftContext) ClangModuleUnit(*wrapper, *this,

branches/rxwei-patch-1/lib/DWARFImporter/DWARFImporter.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ class DWARFImporter::Implementation {
120120
return it->second->getParentModule();
121121

122122
auto *decl = ModuleDecl::create(name, SwiftContext);
123-
decl->setIsNonSwiftModule();
123+
// Silence error messages about testably importing a Clang module.
124+
decl->setTestingEnabled();
124125
decl->setHasResolvedImports();
125126
auto wrapperUnit = new (SwiftContext) DWARFModuleUnit(*decl);
126127
ModuleWrappers.insert({name, wrapperUnit});

0 commit comments

Comments
 (0)