Skip to content

Commit fd0c420

Browse files
committed
---
yaml --- r: 339711 b: refs/heads/rxwei-patch-1 c: d3262ec h: refs/heads/master i: 339709: cbde1a7 339707: ea77afd 339703: 379d35d 339695: ff52327 339679: cb3652f 339647: c79b73f 339583: 157ae1a 339455: 0e8f52e
1 parent d0c310c commit fd0c420

File tree

165 files changed

+1208
-3696
lines changed

Some content is hidden

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

165 files changed

+1208
-3696
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: af7b461db2d25dc54e52ab50026e569505abb7eb
1018+
refs/heads/rxwei-patch-1: d3262ec10d7e41b9403f83f2f89474795f9eed3a
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/CHANGELOG.md

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,6 @@ CHANGELOG
2626
Swift Next
2727
----------
2828

29-
* [SR-8974][]:
30-
31-
Duplicate tuple element labels are no longer allowed, because it leads
32-
to incorrect behavior. For example:
33-
34-
```
35-
let dupLabels: (foo: Int, foo: Int) = (foo: 1, foo: 2)
36-
37-
enum Foo { case bar(x: Int, x: Int) }
38-
let f: Foo = .bar(x: 0, x: 1)
39-
```
40-
41-
will now be diagnosed as an error.
42-
43-
Note: You can still use duplicate labels when declaring functions and
44-
subscripts, as long as the internal labels are different. For example:
45-
46-
```
47-
func foo(bar x: Int, bar y: Int) {}
48-
subscript(a x: Int, a y: Int) -> Int {}
49-
```
50-
5129
* [SR-6118][]:
5230

5331
Subscripts can now declare default arguments:
@@ -7718,6 +7696,5 @@ Swift 1.0
77187696
[SR-7799]: <https://bugs.swift.org/browse/SR-7799>
77197697
[SR-8109]: <https://bugs.swift.org/browse/SR-8109>
77207698
[SR-8546]: <https://bugs.swift.org/browse/SR-8546>
7721-
[SR-8974]: <https://bugs.swift.org/browse/SR-8974>
77227699
[SR-9043]: <https://bugs.swift.org/browse/SR-9043>
77237700
[SR-9827]: <https://bugs.swift.org/browse/SR-9827>

branches/rxwei-patch-1/CMakeLists.txt

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ endif()
117117

118118
set(SWIFT_ANALYZE_CODE_COVERAGE FALSE CACHE STRING
119119
"Build Swift with code coverage instrumenting enabled [FALSE, NOT-MERGED, MERGED]")
120+
set_property(CACHE SWIFT_ANALYZE_CODE_COVERAGE PROPERTY
121+
STRINGS FALSE "NOT-MERGED" "MERGED")
120122

121123
# SWIFT_VERSION is deliberately /not/ cached so that an existing build directory
122124
# can be reused when a new version of Swift comes out (assuming the user hasn't
@@ -169,20 +171,8 @@ endif()
169171

170172
set(SWIFT_STDLIB_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING
171173
"Build type for the Swift standard library and SDK overlays [Debug, RelWithDebInfo, Release, MinSizeRel]")
172-
# Allow the user to specify the standard library CMAKE_MSVC_RUNTIME_LIBRARY
173-
# value. The following values are valid:
174-
# - MultiThreaded (/MT)
175-
# - MultiThreadedDebug (/MTd)
176-
# - MultiThreadedDLL (/MD)
177-
# - MultiThreadedDebugDLL (/MDd)
178-
if(CMAKE_BUILD_TYPE STREQUAL Debug)
179-
set(SWIFT_STDLIB_MSVC_RUNTIME_LIBRARY_default MultiThreadedDebugDLL)
180-
else()
181-
set(SWIFT_STDLIB_MSVC_RUNTIME_LIBRARY_default MultiThreadedDLL)
182-
endif()
183-
set(SWIFT_STDLIB_MSVC_RUNTIME_LIBRARY
184-
${SWIFT_STDLIB_MSVC_RUNTIME_LIBRARY_default}
185-
CACHE STRING "MSVC Runtime Library for the standard library")
174+
set_property(CACHE SWIFT_STDLIB_BUILD_TYPE PROPERTY
175+
STRINGS "Debug" "RelWithDebInfo" "Release" "MinSizeRel")
186176

187177
is_build_type_optimized("${SWIFT_STDLIB_BUILD_TYPE}" swift_optimized)
188178
if(swift_optimized)

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

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,12 @@ function(_add_variant_swift_compile_flags
400400
list(APPEND result "-D" "SWIFT_ENABLE_RUNTIME_FUNCTION_COUNTERS")
401401
endif()
402402

403+
if(sdk STREQUAL WINDOWS)
404+
list(APPEND result "-Xcc" "-D_MT")
405+
# TODO(compnerd) handle /MT /MTd
406+
list(APPEND result "-Xcc" "-D_DLL")
407+
endif()
408+
403409
set("${result_var_name}" "${result}" PARENT_SCOPE)
404410
endfunction()
405411

@@ -867,8 +873,13 @@ function(_add_swift_library_single target name)
867873
if("${SWIFTLIB_SINGLE_ARCHITECTURE}" MATCHES arm)
868874
list(APPEND SWIFTLIB_SINGLE_SWIFT_COMPILE_FLAGS -Xcc;-D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE)
869875
endif()
870-
list(APPEND SWIFTLIB_SINGLE_SWIFT_COMPILE_FLAGS
871-
-libc;${SWIFT_STDLIB_MSVC_RUNTIME_LIBRARY})
876+
list(APPEND SWIFTLIB_SINGLE_SWIFT_COMPILE_FLAGS -Xfrontend;-autolink-library;-Xfrontend;oldnames)
877+
# TODO(compnerd) handle /MT and /MTd
878+
if(CMAKE_BUILD_TYPE MATCHES Debug)
879+
list(APPEND SWIFTLIB_SINGLE_SWIFT_COMPILE_FLAGS -Xfrontend;-autolink-library;-Xfrontend;msvcrtd)
880+
else()
881+
list(APPEND SWIFTLIB_SINGLE_SWIFT_COMPILE_FLAGS -Xfrontend;-autolink-library;-Xfrontend;msvcrt)
882+
endif()
872883
endif()
873884

874885
# FIXME: don't actually depend on the libraries in SWIFTLIB_SINGLE_LINK_LIBRARIES,
@@ -1914,20 +1925,6 @@ function(add_swift_target_library name)
19141925
GYB_SOURCES ${SWIFTLIB_GYB_SOURCES}
19151926
)
19161927

1917-
if(sdk STREQUAL WINDOWS)
1918-
if(SWIFT_COMPILER_IS_MSVC_LIKE)
1919-
if (SWIFT_STDLIB_MSVC_RUNTIME_LIBRARY MATCHES MultiThreadedDebugDLL)
1920-
target_compile_options(${VARIANT_NAME} PRIVATE /MDd /D_DLL /D_DEBUG)
1921-
elseif (SWIFT_STDLIB_MSVC_RUNTIME_LIBRARY MATCHES MultiThreadedDebug)
1922-
target_compile_options(${VARIANT_NAME} PRIVATE /MTd /U_DLL /D_DEBUG)
1923-
elseif (SWIFT_STDLIB_MSVC_RUNTIME_LIBRARY MATCHES MultiThreadedDLL)
1924-
target_compile_options(${VARIANT_NAME} PRIVATE /MD /D_DLL /U_DEBUG)
1925-
elseif (SWIFT_STDLIB_MSVC_RUNTIME_LIBRARY MATCHES MultiThreaded)
1926-
target_compile_options(${VARIANT_NAME} PRIVATE /MT /U_DLL /U_DEBUG)
1927-
endif()
1928-
endif()
1929-
endif()
1930-
19311928
if(NOT SWIFTLIB_OBJECT_LIBRARY)
19321929
# Add dependencies on the (not-yet-created) custom lipo target.
19331930
foreach(DEP ${SWIFTLIB_LINK_LIBRARIES})

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ option(SWIFT_ENABLE_PARSEABLE_MODULE_INTERFACES
6565
set(SWIFT_STDLIB_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING
6666
"Build type for the Swift standard library and SDK overlays.")
6767

68+
set_property(CACHE SWIFT_STDLIB_BUILD_TYPE PROPERTY
69+
STRINGS
70+
"Debug" "RelWithDebInfo" "Release" "MinSizeRel")
71+
6872
# -----------------------------------------------------------------------------
6973
# Constants
7074

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ ERROR(cannot_convert_sequence_element_value,none,
452452
"cannot convert sequence element type %0 to expected type %1",
453453
(Type, Type))
454454
ERROR(cannot_convert_sequence_element_protocol,none,
455-
"sequence element type %0 does not conform to expected protocol %1",
455+
"sequence element type %0 does not conform to expected type %1",
456456
(Type, Type))
457457

458458
ERROR(throws_functiontype_mismatch,none,
@@ -3523,8 +3523,6 @@ ERROR(tuple_single_element,none,
35233523
"cannot create a single-element tuple with an element label", ())
35243524
ERROR(tuple_ellipsis,none,
35253525
"cannot create a variadic tuple", ())
3526-
ERROR(tuple_duplicate_label,none,
3527-
"cannot create a tuple with a duplicate element label", ())
35283526
ERROR(enum_element_ellipsis,none,
35293527
"variadic enum cases are not supported", ())
35303528

@@ -3953,9 +3951,17 @@ ERROR(borrowed_on_objc_protocol_requirement,none,
39533951
// MARK: dynamic
39543952
//------------------------------------------------------------------------------
39553953

3954+
ERROR(dynamic_not_in_class,none,
3955+
"only members of classes may be dynamic", ())
3956+
ERROR(dynamic_with_nonobjc,none,
3957+
"a declaration cannot be both '@nonobjc' and 'dynamic'",
3958+
())
39563959
ERROR(dynamic_with_transparent,none,
39573960
"a declaration cannot be both '@_tranparent' and 'dynamic'",
39583961
())
3962+
ERROR(dynamic_requires_objc,none,
3963+
"'dynamic' %0 %1 must also be '@objc'",
3964+
(DescriptiveDeclKind, DeclName))
39593965

39603966
//------------------------------------------------------------------------------
39613967
// MARK: @_dynamicReplacement(for:)

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

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -953,25 +953,15 @@ class TapExpr : public Expr {
953953
class InterpolatedStringLiteralExpr : public LiteralExpr {
954954
/// Points at the beginning quote.
955955
SourceLoc Loc;
956-
/// Points at the ending quote.
957-
/// Needed for the upcoming \c ASTScope subsystem because lookups can be
958-
/// targeted to inside an \c InterpolatedStringLiteralExpr. It would be nicer
959-
/// to use \c EndLoc for this value, but then \c Lexer::getLocForEndOfToken()
960-
/// would not work for \c stringLiteral->getEndLoc().
961-
SourceLoc TrailingQuoteLoc;
962956
TapExpr *AppendingExpr;
963957
Expr *SemanticExpr;
964958

965959
public:
966-
InterpolatedStringLiteralExpr(SourceLoc Loc,
967-
SourceLoc TrailingQuoteLoc,
968-
unsigned LiteralCapacity,
960+
InterpolatedStringLiteralExpr(SourceLoc Loc, unsigned LiteralCapacity,
969961
unsigned InterpolationCount,
970962
TapExpr *AppendingExpr)
971963
: LiteralExpr(ExprKind::InterpolatedStringLiteral, /*Implicit=*/false),
972-
Loc(Loc),
973-
TrailingQuoteLoc(TrailingQuoteLoc),
974-
AppendingExpr(AppendingExpr), SemanticExpr() {
964+
Loc(Loc), AppendingExpr(AppendingExpr), SemanticExpr() {
975965
Bits.InterpolatedStringLiteralExpr.InterpolationCount = InterpolationCount;
976966
Bits.InterpolatedStringLiteralExpr.LiteralCapacity = LiteralCapacity;
977967
}
@@ -1008,11 +998,6 @@ class InterpolatedStringLiteralExpr : public LiteralExpr {
1008998
// token, so the range should be (Start == End).
1009999
return Loc;
10101000
}
1011-
SourceLoc getTrailingQuoteLoc() const {
1012-
// Except when computing a SourceRange for an ASTScope. Then the range
1013-
// must be (Start - TrainingQuoteLoc).
1014-
return TrailingQuoteLoc;
1015-
}
10161001

10171002
/// Call the \c callback with information about each segment in turn.
10181003
void forEachSegment(ASTContext &Ctx,

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

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -539,48 +539,6 @@ class ClusteredBitVector {
539539
return !any();
540540
}
541541

542-
/// A class for scanning for set bits, from low indices to high ones.
543-
class SetBitEnumerator {
544-
ChunkType CurChunk;
545-
const ChunkType *Chunks;
546-
unsigned CurChunkIndex;
547-
unsigned NumChunks;
548-
public:
549-
explicit SetBitEnumerator(const ClusteredBitVector &vector) {
550-
if (vector.isInlineAndAllClear()) {
551-
CurChunkIndex = 0;
552-
NumChunks = 0;
553-
} else {
554-
Chunks = vector.getChunksPtr();
555-
CurChunk = Chunks[0];
556-
CurChunkIndex = 0;
557-
NumChunks = vector.getLengthInChunks();
558-
}
559-
}
560-
561-
/// Search for another bit. Returns false if it can't find one.
562-
Optional<size_t> findNext() {
563-
if (CurChunkIndex == NumChunks) return None;
564-
auto cur = CurChunk;
565-
while (!cur) {
566-
if (++CurChunkIndex == NumChunks) return None;
567-
cur = Chunks[CurChunkIndex];
568-
}
569-
570-
// Find the index of the lowest set bit.
571-
size_t bitIndex = llvm::countTrailingZeros(cur, llvm::ZB_Undefined);
572-
573-
// Clear that bit in the current chunk.
574-
CurChunk = cur ^ (ChunkType(1) << bitIndex);
575-
assert(!(CurChunk & (ChunkType(1) << bitIndex)));
576-
577-
return (CurChunkIndex * ChunkSizeInBits + bitIndex);
578-
}
579-
};
580-
SetBitEnumerator enumerateSetBits() const {
581-
return SetBitEnumerator(*this);
582-
}
583-
584542
friend bool operator==(const ClusteredBitVector &lhs,
585543
const ClusteredBitVector &rhs) {
586544
if (lhs.size() != rhs.size())

branches/rxwei-patch-1/include/swift/Driver/Driver.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,18 +87,9 @@ class OutputInfo {
8787
Immediate,
8888
};
8989

90-
enum class MSVCRuntime {
91-
MultiThreaded,
92-
MultiThreadedDebug,
93-
MultiThreadedDLL,
94-
MultiThreadedDebugDLL,
95-
};
96-
9790
/// The mode in which the driver should invoke the frontend.
9891
Mode CompilerMode = Mode::StandardCompile;
9992

100-
Optional<MSVCRuntime> RuntimeVariant = llvm::None;
101-
10293
/// The output type which should be used for compile actions.
10394
file_types::ID CompilerOutputType = file_types::ID::TY_INVALID;
10495

branches/rxwei-patch-1/include/swift/FrontendTool/FrontendTool.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,6 @@ class FrontendObserver {
4242

4343
/// The frontend has configured the compiler instance.
4444
virtual void configuredCompiler(CompilerInstance &instance);
45-
46-
/// The frontend has performed semantic analysis.
47-
virtual void performedSemanticAnalysis(CompilerInstance &instance);
48-
49-
/// The frontend has performed basic SIL generation.
50-
/// SIL diagnostic passes have not yet been applied.
51-
virtual void performedSILGeneration(SILModule &module);
52-
53-
/// The frontend has executed the SIL optimization and diagnostics pipelines.
54-
virtual void performedSILProcessing(SILModule &module);
55-
56-
// TODO: maybe enhance this interface to hear about IRGen and LLVM
57-
// progress.
5845
};
5946

6047
namespace frontend {

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,8 +455,6 @@ def enable_app_extension : Flag<["-"], "application-extension">,
455455
Flags<[FrontendOption, NoInteractiveOption]>,
456456
HelpText<"Restrict code to those available for App Extensions">;
457457

458-
def libc : Separate<["-"], "libc">, HelpText<"libc runtime library to use">;
459-
460458
// Linker options
461459

462460
def linker_option_Group : OptionGroup<"<linker-specific options>">;

branches/rxwei-patch-1/include/swift/SIL/SILBasicBlock.h

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -232,20 +232,11 @@ public llvm::ilist_node<SILBasicBlock>, public SILAllocated<SILBasicBlock> {
232232
const ValueDecl *D = nullptr);
233233

234234
/// Replace the \p{i}th BB arg with a new BBArg with SILType \p Ty and
235-
/// ValueDecl \p D.
236-
///
237-
/// NOTE: This assumes that the current argument in position \p i has had its
238-
/// uses eliminated. To replace/replace all uses with, use
239-
/// replacePhiArgumentAndRAUW.
240-
SILPhiArgument *replacePhiArgument(unsigned i, SILType type,
241-
ValueOwnershipKind kind,
242-
const ValueDecl *decl = nullptr);
243-
244-
/// Replace phi argument \p i and RAUW all uses.
245-
SILPhiArgument *
246-
replacePhiArgumentAndReplaceAllUses(unsigned i, SILType type,
247-
ValueOwnershipKind kind,
248-
const ValueDecl *decl = nullptr);
235+
/// ValueDecl
236+
/// \p D.
237+
SILPhiArgument *replacePhiArgument(unsigned i, SILType Ty,
238+
ValueOwnershipKind Kind,
239+
const ValueDecl *D = nullptr);
249240

250241
/// Allocate a new argument of type \p Ty and append it to the argument
251242
/// list. Optionally you can pass in a value decl parameter.

branches/rxwei-patch-1/include/swift/SIL/SILBuilder.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1938,7 +1938,11 @@ class SILBuilder {
19381938
SILType destTy, SILBasicBlock *successBB,
19391939
SILBasicBlock *failureBB,
19401940
ProfileCounter Target1Count = ProfileCounter(),
1941-
ProfileCounter Target2Count = ProfileCounter());
1941+
ProfileCounter Target2Count = ProfileCounter()) {
1942+
return insertTerminator(CheckedCastBranchInst::create(
1943+
getSILDebugLocation(Loc), isExact, op, destTy, successBB, failureBB,
1944+
getFunction(), C.OpenedArchetypes, Target1Count, Target2Count));
1945+
}
19421946

19431947
CheckedCastValueBranchInst *
19441948
createCheckedCastValueBranch(SILLocation Loc, SILValue op, SILType destTy,

branches/rxwei-patch-1/include/swift/SIL/SILInstruction.h

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1841,8 +1841,6 @@ class ApplyInstBase<Impl, Base, false> : public Base {
18411841
/// issues. It is at the bottom of the file.
18421842
SILFunction *getCalleeFunction() const;
18431843

1844-
bool isCalleeDynamicallyReplaceable() const;
1845-
18461844
/// Gets the referenced function if the callee is a function_ref instruction.
18471845
SILFunction *getReferencedFunction() const {
18481846
if (auto *FRI = dyn_cast<FunctionRefBaseInst>(getCallee()))
@@ -7775,27 +7773,6 @@ SILValue ApplyInstBase<Impl, Base, false>::getCalleeOrigin() const {
77757773
}
77767774
}
77777775

7778-
template <class Impl, class Base>
7779-
bool ApplyInstBase<Impl, Base, false>::isCalleeDynamicallyReplaceable() const {
7780-
SILValue Callee = getCalleeOrigin();
7781-
7782-
while (true) {
7783-
if (auto *FRI = dyn_cast<FunctionRefInst>(Callee))
7784-
return false;
7785-
7786-
if (auto *FRI = dyn_cast<DynamicFunctionRefInst>(Callee))
7787-
return true;
7788-
if (auto *FRI = dyn_cast<PreviousDynamicFunctionRefInst>(Callee))
7789-
return true;
7790-
7791-
if (auto *PAI = dyn_cast<PartialApplyInst>(Callee)) {
7792-
Callee = PAI->getCalleeOrigin();
7793-
continue;
7794-
}
7795-
return false;
7796-
}
7797-
}
7798-
77997776
template <class Impl, class Base>
78007777
SILFunction *ApplyInstBase<Impl, Base, false>::getCalleeFunction() const {
78017778
SILValue Callee = getCalleeOrigin();

0 commit comments

Comments
 (0)