Skip to content

Commit 9fd6a3a

Browse files
committed
---
yaml --- r: 349133 b: refs/heads/master c: a29a5f1 h: refs/heads/master i: 349131: 8c6ad33
1 parent 907fbea commit 9fd6a3a

File tree

113 files changed

+469
-1016
lines changed

Some content is hidden

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

113 files changed

+469
-1016
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: b6b310fd7a2ca90e63f5789ed3a283b768a97b05
2+
refs/heads/master: a29a5f1a34388e2ce131a07b6df041d995b71d9b
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ endif()
1111
list(APPEND CMAKE_MODULE_PATH
1212
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
1313

14-
set(CMAKE_DISABLE_IN_SOURCE_BUILD YES)
15-
1614
if(DEFINED CMAKE_JOB_POOLS)
1715
# CMake < 3.11 doesn't support CMAKE_JOB_POOLS. Manually set the property.
1816
set_property(GLOBAL PROPERTY JOB_POOLS "${CMAKE_JOB_POOLS}")
@@ -377,10 +375,6 @@ option(SWIFT_ENABLE_STDLIBCORE_EXCLUSIVITY_CHECKING
377375
"Build stdlibCore with exclusivity checking enabled"
378376
FALSE)
379377

380-
option(SWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING
381-
"Enable experimental Swift differentiable programming features"
382-
FALSE)
383-
384378
#
385379
# End of user-configurable options.
386380
#

trunk/benchmark/scripts/run_smoke_bench

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,6 @@ def main():
9393
argparser.add_argument(
9494
'-num-samples', type=int,
9595
help='The (minimum) number of samples to run', default=3)
96-
argparser.add_argument(
97-
'-num-reruns', type=int,
98-
help="The number of re-runs until it's assumed to be a real change",
99-
default=8)
10096
argparser.add_argument(
10197
'-platform', type=str,
10298
help='The benchmark build platform', default='macosx')
@@ -124,7 +120,7 @@ def test_opt_levels(args):
124120
if test_performance(opt_level, args.oldbuilddir[0],
125121
args.newbuilddir[0],
126122
float(args.threshold) / 100, args.num_samples,
127-
args.num_reruns, output_file):
123+
output_file):
128124
changes = True
129125

130126
# There is no point in reporting code size for Onone.
@@ -175,7 +171,7 @@ def merge(results, other_results):
175171

176172

177173
def test_performance(opt_level, old_dir, new_dir, threshold, num_samples,
178-
num_reruns, output_file):
174+
output_file):
179175
"""Detect performance changes in benchmarks.
180176
181177
Start fast with few samples per benchmark and gradually spend more time
@@ -189,7 +185,7 @@ def test_performance(opt_level, old_dir, new_dir, threshold, num_samples,
189185
tests = TestComparator(results[0], results[1], threshold)
190186
changed = tests.decreased + tests.increased
191187

192-
while len(changed) > 0 and unchanged_length_count < num_reruns:
188+
while len(changed) > 0 and unchanged_length_count < 10:
193189
i += 1
194190
if VERBOSE:
195191
log(' test again: ' + str([test.name for test in changed]))

trunk/benchmark/single-source/UTF8Decode.swift

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,6 @@ public let UTF8Decode = [
4242
name: "UTF8Decode_InitFromBytes_ascii",
4343
runFunction: run_UTF8Decode_InitFromBytes_ascii,
4444
tags: [.validation, .api, .String]),
45-
BenchmarkInfo(
46-
name: "UTF8Decode_InitFromData_ascii_as_ascii",
47-
runFunction: run_UTF8Decode_InitFromData_ascii_as_ascii,
48-
tags: [.validation, .api, .String]),
49-
BenchmarkInfo(
50-
name: "UTF8Decode_InitDecoding_ascii_as_ascii",
51-
runFunction: run_UTF8Decode_InitDecoding_ascii_as_ascii,
52-
tags: [.validation, .api, .String]),
53-
BenchmarkInfo(
54-
name: "UTF8Decode_InitFromBytes_ascii_as_ascii",
55-
runFunction: run_UTF8Decode_InitFromBytes_ascii_as_ascii,
56-
tags: [.validation, .api, .String]),
5745
]
5846

5947
// 1-byte sequences
@@ -141,26 +129,4 @@ public func run_UTF8Decode_InitFromBytes_ascii(_ N: Int) {
141129
}
142130
}
143131

144-
@inline(never)
145-
public func run_UTF8Decode_InitFromData_ascii_as_ascii(_ N: Int) {
146-
let input = asciiData
147-
for _ in 0..<1_000*N {
148-
blackHole(String(data: input, encoding: .ascii))
149-
}
150-
}
151-
@inline(never)
152-
public func run_UTF8Decode_InitDecoding_ascii_as_ascii(_ N: Int) {
153-
let input = asciiBytes
154-
for _ in 0..<1_000*N {
155-
blackHole(String(decoding: input, as: Unicode.ASCII.self))
156-
}
157-
}
158-
@inline(never)
159-
public func run_UTF8Decode_InitFromBytes_ascii_as_ascii(_ N: Int) {
160-
let input = asciiBytes
161-
for _ in 0..<1_000*N {
162-
blackHole(String(bytes: input, encoding: .ascii))
163-
}
164-
}
165-
166132

trunk/cmake/modules/AddSwift.cmake

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -422,10 +422,6 @@ function(_add_variant_swift_compile_flags
422422
list(APPEND result "-D" "SWIFT_ENABLE_RUNTIME_FUNCTION_COUNTERS")
423423
endif()
424424

425-
if(SWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING)
426-
list(APPEND result "-D" "SWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING")
427-
endif()
428-
429425
set("${result_var_name}" "${result}" PARENT_SCOPE)
430426
endfunction()
431427

trunk/docs/WindowsBuild.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ mklink "%VCToolsInstallDir%\include\visualc.apinotes" S:\swift\stdlib\public\Pla
9999
Warning: Creating the above links usually requires administrator privileges. The quick and easy way to do this is to open a second developer prompt by right clicking whatever shortcut you used to open the first one, choosing Run As Administrator, and pasting the above commands into the resulting window. You can then close the privileged prompt; this is the only step which requires elevation.
100100

101101
## 6. Build LLVM/Clang
102-
- This must be done from within a developer command prompt. Make sure that the build
102+
- This must be done from within a developer command prompt. LLVM and Clang are
103+
large projects, so building might take a few hours. Make sure that the build
103104
type for LLVM/Clang is compatible with the build type for Swift. That is,
104105
either build everything `Debug` or some variant of `Release` (e.g. `Release`,
105106
`RelWithDebInfo`).
@@ -125,8 +126,8 @@ ninja
125126
path S:\b\llvm\bin;%PATH%
126127
```
127128
## 7. Build CMark
128-
- This must be done from within a developer command prompt.
129-
129+
- This must be done from within a developer command prompt. CMark is a fairly
130+
small project and should only take a few minutes to build.
130131
```cmd
131132
md "S:\b\cmark"
132133
cd "S:\b\cmark"
@@ -179,8 +180,8 @@ cmake -G "Visual Studio 2017" -A x64 -T "host=x64"^ ...
179180
```
180181

181182
## 9. Build lldb
182-
- This must be done from within a developer command prompt.
183-
183+
- This must be done from within a developer command prompt and could take hours
184+
depending on your system.
184185
```cmd
185186
md "S:\b\lldb"
186187
cd "S:\b\lldb"

trunk/include/swift/AST/AnyFunctionRef.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ class AnyFunctionRef {
5252
}
5353
}
5454

55-
CaptureInfo getCaptureInfo() const {
55+
const CaptureInfo &getCaptureInfo() const {
5656
if (auto *AFD = TheFunction.dyn_cast<AbstractFunctionDecl *>())
5757
return AFD->getCaptureInfo();
5858
return TheFunction.get<AbstractClosureExpr *>()->getCaptureInfo();
5959
}
6060

61-
void setCaptureInfo(CaptureInfo captures) const {
61+
void setCaptureInfo(const CaptureInfo &captures) const {
6262
if (auto *AFD = TheFunction.dyn_cast<AbstractFunctionDecl *>()) {
6363
AFD->setCaptureInfo(captures);
6464
return;

trunk/include/swift/AST/Decl.h

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ namespace swift {
7171
class GenericTypeParamDecl;
7272
class GenericTypeParamType;
7373
class ModuleDecl;
74-
class NamedPattern;
7574
class EnumCaseDecl;
7675
class EnumElementDecl;
7776
class ParameterList;
@@ -2022,8 +2021,8 @@ class PatternBindingEntry {
20222021
/// from the source range.
20232022
SourceRange getSourceRange(bool omitAccessors = false) const;
20242023

2025-
CaptureInfo getCaptureInfo() const { return Captures; }
2026-
void setCaptureInfo(CaptureInfo captures) { Captures = captures; }
2024+
const CaptureInfo &getCaptureInfo() const { return Captures; }
2025+
void setCaptureInfo(const CaptureInfo &captures) { Captures = captures; }
20272026

20282027
private:
20292028
SourceLoc getLastAccessorEndLoc() const;
@@ -2127,11 +2126,11 @@ class PatternBindingDecl final : public Decl,
21272126
return getPatternList()[i].getInitContext();
21282127
}
21292128

2130-
CaptureInfo getCaptureInfo(unsigned i) const {
2129+
const CaptureInfo &getCaptureInfo(unsigned i) const {
21312130
return getPatternList()[i].getCaptureInfo();
21322131
}
21332132

2134-
void setCaptureInfo(unsigned i, CaptureInfo captures) {
2133+
void setCaptureInfo(unsigned i, const CaptureInfo &captures) {
21352134
getMutablePatternList()[i].setCaptureInfo(captures);
21362135
}
21372136

@@ -4774,8 +4773,6 @@ enum class PropertyWrapperSynthesizedPropertyKind {
47744773

47754774
/// VarDecl - 'var' and 'let' declarations.
47764775
class VarDecl : public AbstractStorageDecl {
4777-
NamedPattern *NamingPattern = nullptr;
4778-
47794776
public:
47804777
enum class Introducer : uint8_t {
47814778
Let = 0,
@@ -4789,6 +4786,10 @@ class VarDecl : public AbstractStorageDecl {
47894786
bool issCaptureList, SourceLoc nameLoc, Identifier name,
47904787
DeclContext *dc, StorageIsMutable_t supportsMutation);
47914788

4789+
TypeRepr *ParentRepr = nullptr;
4790+
4791+
Type typeInContext;
4792+
47924793
public:
47934794
VarDecl(bool isStatic, Introducer introducer, bool isCaptureList,
47944795
SourceLoc nameLoc, Identifier name, DeclContext *dc)
@@ -4805,10 +4806,26 @@ class VarDecl : public AbstractStorageDecl {
48054806
return hasName() ? getBaseName().getIdentifier().str() : "_";
48064807
}
48074808

4809+
/// Retrieve the TypeRepr corresponding to the parsed type of the parent
4810+
/// pattern, if it exists.
4811+
TypeRepr *getTypeRepr() const { return ParentRepr; }
4812+
void setTypeRepr(TypeRepr *repr) { ParentRepr = repr; }
4813+
4814+
bool hasType() const {
4815+
// We have a type if either the type has been computed already or if
4816+
// this is a deserialized declaration with an interface type.
4817+
return !typeInContext.isNull();
4818+
}
4819+
48084820
/// Get the type of the variable within its context. If the context is generic,
48094821
/// this will use archetypes.
48104822
Type getType() const;
48114823

4824+
/// Set the type of the variable within its context.
4825+
void setType(Type t);
4826+
4827+
void markInvalid();
4828+
48124829
/// Retrieve the source range of the variable type, or an invalid range if the
48134830
/// variable's type is not explicitly written in the source.
48144831
///
@@ -4847,14 +4864,6 @@ class VarDecl : public AbstractStorageDecl {
48474864
///
48484865
Pattern *getParentPattern() const;
48494866

4850-
/// Returns the parsed type of this variable declaration. For parameters, this
4851-
/// is the parsed type the user explicitly wrote. For variables, this is the
4852-
/// type the user wrote in the typed pattern that binds this variable.
4853-
///
4854-
/// Note that there are many cases where the user may elide types. This will
4855-
/// return null in those cases.
4856-
TypeRepr *getTypeReprOrParentPatternTypeRepr() const;
4857-
48584867
/// Return the statement that owns the pattern associated with this VarDecl,
48594868
/// if one exists.
48604869
///
@@ -4895,9 +4904,6 @@ class VarDecl : public AbstractStorageDecl {
48954904
Parent = v;
48964905
}
48974906

4898-
NamedPattern *getNamingPattern() const { return NamingPattern; }
4899-
void setNamingPattern(NamedPattern *Pat) { NamingPattern = Pat; }
4900-
49014907
/// If this is a VarDecl that does not belong to a CaseLabelItem's pattern,
49024908
/// return this. Otherwise, this VarDecl must belong to a CaseStmt's
49034909
/// CaseLabelItem. In that case, return the first case label item of the first
@@ -5152,8 +5158,6 @@ class ParamDecl : public VarDecl {
51525158
SourceLoc ArgumentNameLoc;
51535159
SourceLoc SpecifierLoc;
51545160

5155-
TypeRepr *TyRepr = nullptr;
5156-
51575161
struct StoredDefaultArgument {
51585162
PointerUnion<Expr *, VarDecl *> DefaultArg;
51595163
Initializer *InitContext = nullptr;
@@ -5199,10 +5203,6 @@ class ParamDecl : public VarDecl {
51995203

52005204
SourceLoc getSpecifierLoc() const { return SpecifierLoc; }
52015205

5202-
/// Retrieve the TypeRepr corresponding to the parsed type of the parameter, if it exists.
5203-
TypeRepr *getTypeRepr() const { return TyRepr; }
5204-
void setTypeRepr(TypeRepr *repr) { TyRepr = repr; }
5205-
52065206
DefaultArgumentKind getDefaultArgumentKind() const {
52075207
return static_cast<DefaultArgumentKind>(Bits.ParamDecl.defaultArgumentKind);
52085208
}
@@ -5237,12 +5237,12 @@ class ParamDecl : public VarDecl {
52375237

52385238
void setDefaultArgumentInitContext(Initializer *initContext);
52395239

5240-
CaptureInfo getDefaultArgumentCaptureInfo() const {
5240+
const CaptureInfo &getDefaultArgumentCaptureInfo() const {
52415241
assert(DefaultValueAndFlags.getPointer());
52425242
return DefaultValueAndFlags.getPointer()->Captures;
52435243
}
52445244

5245-
void setDefaultArgumentCaptureInfo(CaptureInfo captures);
5245+
void setDefaultArgumentCaptureInfo(const CaptureInfo &captures);
52465246

52475247
/// Extracts the text of the default argument attached to the provided
52485248
/// ParamDecl, removing all inactive #if clauses and providing only the
@@ -5814,8 +5814,8 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
58145814
/// Retrieve the source range of the function declaration name + patterns.
58155815
SourceRange getSignatureSourceRange() const;
58165816

5817-
CaptureInfo getCaptureInfo() const { return Captures; }
5818-
void setCaptureInfo(CaptureInfo captures) { Captures = captures; }
5817+
const CaptureInfo &getCaptureInfo() const { return Captures; }
5818+
void setCaptureInfo(const CaptureInfo &captures) { Captures = captures; }
58195819

58205820
/// Retrieve the Objective-C selector that names this method.
58215821
ObjCSelector getObjCSelector(DeclName preferredName = DeclName(),

trunk/include/swift/AST/DiagnosticsSema.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,9 +1509,6 @@ ERROR(pattern_binds_no_variables,none,
15091509
"%select{property|global variable}0 declaration does not bind any "
15101510
"variables",
15111511
(unsigned))
1512-
ERROR(variable_bound_by_no_pattern,none,
1513-
"variable %0 is not bound by any pattern",
1514-
(DeclName))
15151512

15161513
WARNING(optional_ambiguous_case_ref,none,
15171514
"assuming you mean '%0.%2'; did you mean '%1.%2' instead?",

trunk/include/swift/AST/Expr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3449,7 +3449,7 @@ class AbstractClosureExpr : public DeclContext, public Expr {
34493449
Bits.AbstractClosureExpr.Discriminator = Discriminator;
34503450
}
34513451

3452-
CaptureInfo getCaptureInfo() const { return Captures; }
3452+
const CaptureInfo &getCaptureInfo() const { return Captures; }
34533453
void setCaptureInfo(CaptureInfo captures) { Captures = captures; }
34543454

34553455
/// Retrieve the parameters of this closure.

trunk/include/swift/AST/Initializer.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,12 @@ class SerializedPatternBindingInitializer : public SerializedLocalDeclContext {
150150
/// A default argument expression. The parent context is the function
151151
/// (possibly a closure) for which this is a default argument.
152152
class DefaultArgumentInitializer : public Initializer {
153+
friend class ASTContext; // calls reset on unused contexts
154+
void reset(DeclContext *parent, unsigned index) {
155+
setParent(parent);
156+
SpareBits = index;
157+
}
158+
153159
public:
154160
explicit DefaultArgumentInitializer(DeclContext *parent, unsigned index)
155161
: Initializer(InitializerKind::DefaultArgument, parent) {

trunk/include/swift/SIL/MemoryLifetime.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,6 @@
2222

2323
namespace swift {
2424

25-
void printBitsAsArray(llvm::raw_ostream &OS, const SmallBitVector &bits);
26-
27-
inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS,
28-
const SmallBitVector &bits) {
29-
printBitsAsArray(OS, bits);
30-
return OS;
31-
}
32-
33-
void dumpBits(const SmallBitVector &bits);
34-
3525
/// The MemoryLocations utility provides functions to analyze memory locations.
3626
///
3727
/// Memory locations are limited to addresses which are guaranteed to

0 commit comments

Comments
 (0)