Skip to content

Commit 0069049

Browse files
committed
---
yaml --- r: 349103 b: refs/heads/master c: 185d3bc h: refs/heads/master i: 349101: 36375b1 349099: ed5b1e7 349095: 899386d 349087: b44ac4d
1 parent 8e63318 commit 0069049

File tree

130 files changed

+1088
-2004
lines changed

Some content is hidden

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

130 files changed

+1088
-2004
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: e4504af618c33caaf4cf23d69c036c0c1c95498f
2+
refs/heads/master: 185d3bcec4d3be462b01cfab03b9652b228336f8
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 & 2 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}")

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/cmake/modules/SwiftSource.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,11 @@ function(_compile_swift_files
333333
"-emit-module-interface-path" "${interface_file}")
334334
endif()
335335

336+
if (NOT SWIFTFILE_IS_STDLIB_CORE)
337+
list(APPEND swift_module_flags
338+
"-Xfrontend" "-experimental-skip-non-inlinable-function-bodies")
339+
endif()
340+
336341
# If we have extra regexp flags, check if we match any of the regexps. If so
337342
# add the relevant flags to our swift_flags.
338343
if (SWIFT_EXPERIMENTAL_EXTRA_REGEXP_FLAGS OR SWIFT_EXPERIMENTAL_EXTRA_NEGATIVE_REGEXP_FLAGS)

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/ASTContext.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ namespace swift {
109109
class TypeAliasDecl;
110110
class VarDecl;
111111
class UnifiedStatsReporter;
112-
class IndexSubset;
113112

114113
enum class KnownProtocolKind : uint8_t;
115114

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: 47 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -369,14 +369,21 @@ class alignas(1 << DeclAlignInBits) Decl {
369369
IsPropertyWrapperBackingProperty : 1
370370
);
371371

372-
SWIFT_INLINE_BITFIELD(ParamDecl, VarDecl, 1+2+NumDefaultArgumentKindBits,
372+
SWIFT_INLINE_BITFIELD(ParamDecl, VarDecl, 1+2+1+NumDefaultArgumentKindBits,
373373
/// Whether we've computed the specifier yet.
374374
SpecifierComputed : 1,
375375

376376
/// The specifier associated with this parameter. This determines
377377
/// the storage semantics of the value e.g. mutability.
378378
Specifier : 2,
379379

380+
/// True if the type is implicitly specified in the source, but this has an
381+
/// apparently valid typeRepr. This is used in accessors, which look like:
382+
/// set (value) {
383+
/// but need to get the typeRepr from the property as a whole so Sema can
384+
/// resolve the type.
385+
IsTypeLocImplicit : 1,
386+
380387
/// Information about a symbolic default argument, like #file.
381388
defaultArgumentKind : NumDefaultArgumentKindBits
382389
);
@@ -2021,8 +2028,8 @@ class PatternBindingEntry {
20212028
/// from the source range.
20222029
SourceRange getSourceRange(bool omitAccessors = false) const;
20232030

2024-
CaptureInfo getCaptureInfo() const { return Captures; }
2025-
void setCaptureInfo(CaptureInfo captures) { Captures = captures; }
2031+
const CaptureInfo &getCaptureInfo() const { return Captures; }
2032+
void setCaptureInfo(const CaptureInfo &captures) { Captures = captures; }
20262033

20272034
private:
20282035
SourceLoc getLastAccessorEndLoc() const;
@@ -2126,11 +2133,11 @@ class PatternBindingDecl final : public Decl,
21262133
return getPatternList()[i].getInitContext();
21272134
}
21282135

2129-
CaptureInfo getCaptureInfo(unsigned i) const {
2136+
const CaptureInfo &getCaptureInfo(unsigned i) const {
21302137
return getPatternList()[i].getCaptureInfo();
21312138
}
21322139

2133-
void setCaptureInfo(unsigned i, CaptureInfo captures) {
2140+
void setCaptureInfo(unsigned i, const CaptureInfo &captures) {
21342141
getMutablePatternList()[i].setCaptureInfo(captures);
21352142
}
21362143

@@ -2978,6 +2985,9 @@ class TypeAliasDecl : public GenericTypeDecl {
29782985
/// Retrieve a sugared interface type containing the structure of the interface
29792986
/// type before any semantic validation has occured.
29802987
Type getStructuralType() const;
2988+
2989+
/// Set the interface type of this typealias declaration from the underlying type.
2990+
void computeType();
29812991

29822992
bool isCompatibilityAlias() const {
29832993
return Bits.TypeAliasDecl.IsCompatibilityAlias;
@@ -3166,6 +3176,10 @@ class AssociatedTypeDecl : public AbstractTypeParamDecl {
31663176
TrailingWhere = trailingWhereClause;
31673177
}
31683178

3179+
/// Set the interface type of this associated type declaration to a dependent
3180+
/// member type of 'Self'.
3181+
void computeType();
3182+
31693183
/// Retrieve the associated type "anchor", which is the associated type
31703184
/// declaration that will be used to describe this associated type in the
31713185
/// ABI.
@@ -3355,6 +3369,10 @@ class NominalTypeDecl : public GenericTypeDecl, public IterableDeclContext {
33553369
Bits.NominalTypeDecl.AddedImplicitInitializers = true;
33563370
}
33573371

3372+
/// Set the interface type of this nominal type to the metatype of the
3373+
/// declared interface type.
3374+
void computeType();
3375+
33583376
/// getDeclaredType - Retrieve the type declared by this entity, without
33593377
/// any generic parameters bound if this is a generic type.
33603378
Type getDeclaredType() const;
@@ -4786,7 +4804,8 @@ class VarDecl : public AbstractStorageDecl {
47864804
bool issCaptureList, SourceLoc nameLoc, Identifier name,
47874805
DeclContext *dc, StorageIsMutable_t supportsMutation);
47884806

4789-
TypeRepr *ParentRepr = nullptr;
4807+
/// This is the type specified, including location information.
4808+
TypeLoc typeLoc;
47904809

47914810
Type typeInContext;
47924811

@@ -4806,10 +4825,8 @@ class VarDecl : public AbstractStorageDecl {
48064825
return hasName() ? getBaseName().getIdentifier().str() : "_";
48074826
}
48084827

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; }
4828+
TypeLoc &getTypeLoc() { return typeLoc; }
4829+
TypeLoc getTypeLoc() const { return typeLoc; }
48134830

48144831
bool hasType() const {
48154832
// We have a type if either the type has been computed already or if
@@ -5184,8 +5201,10 @@ class ParamDecl : public VarDecl {
51845201
Identifier argumentName, SourceLoc parameterNameLoc,
51855202
Identifier parameterName, DeclContext *dc);
51865203

5187-
/// Create a new ParamDecl identical to the first except without the interface type.
5188-
static ParamDecl *cloneWithoutType(const ASTContext &Ctx, ParamDecl *PD);
5204+
/// Clone constructor, allocates a new ParamDecl identical to the first.
5205+
/// Intentionally not defined as a typical copy constructor to avoid
5206+
/// accidental copies.
5207+
ParamDecl(ParamDecl *PD, bool withTypes);
51895208

51905209
/// Retrieve the argument (API) name for this function parameter.
51915210
Identifier getArgumentName() const { return ArgumentName; }
@@ -5202,7 +5221,10 @@ class ParamDecl : public VarDecl {
52025221
SourceLoc getParameterNameLoc() const { return ParameterNameLoc; }
52035222

52045223
SourceLoc getSpecifierLoc() const { return SpecifierLoc; }
5205-
5224+
5225+
bool isTypeLocImplicit() const { return Bits.ParamDecl.IsTypeLocImplicit; }
5226+
void setIsTypeLocImplicit(bool val) { Bits.ParamDecl.IsTypeLocImplicit = val; }
5227+
52065228
DefaultArgumentKind getDefaultArgumentKind() const {
52075229
return static_cast<DefaultArgumentKind>(Bits.ParamDecl.defaultArgumentKind);
52085230
}
@@ -5237,12 +5259,12 @@ class ParamDecl : public VarDecl {
52375259

52385260
void setDefaultArgumentInitContext(Initializer *initContext);
52395261

5240-
CaptureInfo getDefaultArgumentCaptureInfo() const {
5262+
const CaptureInfo &getDefaultArgumentCaptureInfo() const {
52415263
assert(DefaultValueAndFlags.getPointer());
52425264
return DefaultValueAndFlags.getPointer()->Captures;
52435265
}
52445266

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

52475269
/// Extracts the text of the default argument attached to the provided
52485270
/// ParamDecl, removing all inactive #if clauses and providing only the
@@ -5473,6 +5495,10 @@ class SubscriptDecl : public GenericContext, public AbstractStorageDecl {
54735495
TypeLoc &getElementTypeLoc() { return ElementTy; }
54745496
const TypeLoc &getElementTypeLoc() const { return ElementTy; }
54755497

5498+
/// Compute the interface type of this subscript from the parameter and
5499+
/// element types.
5500+
void computeType();
5501+
54765502
/// Determine the kind of Objective-C subscripting this declaration
54775503
/// implies.
54785504
ObjCSubscriptKind getObjCSubscriptKind() const;
@@ -5814,8 +5840,8 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
58145840
/// Retrieve the source range of the function declaration name + patterns.
58155841
SourceRange getSignatureSourceRange() const;
58165842

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

58205846
/// Retrieve the Objective-C selector that names this method.
58215847
ObjCSelector getObjCSelector(DeclName preferredName = DeclName(),
@@ -6343,6 +6369,10 @@ class EnumElementDecl : public DeclContext, public ValueDecl {
63436369
return hasName() ? getBaseName().getIdentifier().str() : "_";
63446370
}
63456371

6372+
/// Set the interface type of this enum element to the constructor function
6373+
/// type; (Self.Type) -> Self or (Self.Type) -> (Args...) -> Self.
6374+
void computeType();
6375+
63466376
Type getArgumentInterfaceType() const;
63476377

63486378
void setParameterList(ParameterList *params);

trunk/include/swift/AST/DiagnosticsCommon.def

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,6 @@ ERROR(circular_protocol_def,none,
163163
NOTE(kind_declname_declared_here,none,
164164
"%0 %1 declared here", (DescriptiveDeclKind, DeclName))
165165

166-
WARNING(warn_property_wrapper_module_scope,none,
167-
"ignoring associated type %0 in favor of module-scoped property "
168-
"wrapper %0; please qualify the reference with %1",
169-
(DeclName, Identifier))
170-
171166
#ifndef DIAG_NO_UNDEF
172167
# if defined(DIAG)
173168
# undef DIAG

trunk/include/swift/AST/DiagnosticsSema.def

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,8 @@ ERROR(cannot_convert_argument_value,none,
381381
(Type,Type))
382382

383383
NOTE(candidate_has_invalid_argument_at_position,none,
384-
"candidate expects %select{|in-out }2value of type %0 for parameter #%1",
385-
(Type, unsigned, bool))
384+
"candidate expects value of type %0 for parameter #%1",
385+
(Type, unsigned))
386386

387387
ERROR(cannot_convert_array_to_variadic,none,
388388
"cannot pass array of type %0 as variadic arguments of type %1",
@@ -4533,6 +4533,8 @@ ERROR(property_wrapper_wrong_initial_value_init, none,
45334533
(DeclName, Type, Type))
45344534
ERROR(property_wrapper_failable_init, none,
45354535
"%0 cannot be failable", (DeclName))
4536+
ERROR(property_wrapper_ambiguous_default_value_init, none,
4537+
"property wrapper type %0 has multiple default-value initializers", (Type))
45364538
ERROR(property_wrapper_type_requirement_not_accessible,none,
45374539
"%select{private|fileprivate|internal|public|open}0 %1 %2 cannot have "
45384540
"more restrictive access than its enclosing property wrapper type %3 "

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.

0 commit comments

Comments
 (0)