Skip to content

[pull] swiftwasm from apple:master #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 104 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
c97a0cf
[sil.rst] Clarify documentation around partial_apply closure contexts…
gottesmm Jan 22, 2020
42345da
SymbolGraph: Move pathComponents up and include interfaceLanguage
bitjammer Jan 28, 2020
37e403d
Compile libraries in testcases with -parse-as-library (NFC)
adrian-prantl Jan 29, 2020
f2c61d8
Bug fixes for type fingerprints
Jan 28, 2020
bbffc09
Tests for type fingerprints are enabled.
Jan 28, 2020
b0786e7
Fix propagation of guaranteed phi args during DiagnoseUnreachable.
atrick Jan 29, 2020
1af49ec
Fix an EscapeAnalysis assert to handle recent changes.
atrick Jan 29, 2020
f70f60b
Merge pull request #29526 from atrick/fix-guaranteed-phi
atrick Jan 29, 2020
b2083db
[ConstraintSystem] Add a fix to allow conversion between non-class ty…
xedin Jan 29, 2020
ec3b783
[Diagnostics] Improve diagnostic for invalid conversion to AnyObject
xedin Jan 29, 2020
7710ee8
Merge pull request #29527 from atrick/fix-escape-assert
swift-ci Jan 29, 2020
dd09401
Merge pull request #29528 from xedin/anyobject-conversion-diagnostics
xedin Jan 29, 2020
ffa6bf4
Fix memory leaks in ThreadBarriers.swift (#12212)
chrisamanse Jan 29, 2020
9676625
Merge pull request #29522 from adrian-prantl/test-update
adrian-prantl Jan 29, 2020
7351bfc
[CSFix] Add a fix to add a missing qualifier to shadowed top-level na…
xedin Jan 4, 2020
c9c20af
[Diagnostics] Port name shadowing diagnostics
xedin Jan 4, 2020
78fda9e
[ConstraintSystem] Use new fix/diagnostic for name shadowing
xedin Jan 6, 2020
ec95397
[CSDiag] NFC: Remove obsolete name shadowing diagnostics
xedin Jan 6, 2020
217c343
[Diagnostics] NFC: Fix name shadowing diagnostic comment to refer to …
xedin Jan 6, 2020
93c2321
[TypeChecker] Add types nested in protocol to lookup results
xedin Jan 7, 2020
4bd1ffc
Serialize whether a VarDecl is a top-level global.
adrian-prantl Jan 28, 2020
15c1b4e
Compile libraries in testcases with -parse-as-library (NFC)
adrian-prantl Jan 29, 2020
3fff5dd
[ConstraintSystem] Extend metatype instance type mismatch coverage
xedin Jan 29, 2020
0bd1e61
[build][gardening] adjust one more framework path (#29529)
edymtt Jan 29, 2020
17d9d20
Improve one of the comments in COWArrayOpts.
atrick Jan 29, 2020
0440e91
Try setting mod times explicitly to fix unreproducible ci failure.
Jan 29, 2020
4028ac2
EscapeAnalysis: add support for access markers.
atrick Jan 29, 2020
5b8ba88
Merge pull request #29525 from davidungar/type-prints-off-by-default2
Jan 29, 2020
f7b0cbc
Merge pull request #29531 from xedin/diag-all-metatype-mismatches
xedin Jan 29, 2020
b896013
Add source annotation to SILPrinter under flag -sil-print-sourceinfo …
meg-gupta Jan 29, 2020
454b30d
Merge pull request #29532 from atrick/comment-cow-array
swift-ci Jan 29, 2020
3c86061
Sema: Fix module interface printing of inherited generic initializers
slavapestov Jan 29, 2020
5661bff
Merge pull request #29533 from davidungar/putative-fix-for-rdar-58959…
swift-ci Jan 29, 2020
2e1e428
Added ability to add fingerprint via #
Jan 29, 2020
2c39aa1
Merge pull request #29534 from atrick/escape-access-marker
atrick Jan 29, 2020
b872052
Merge pull request #29535 from slavapestov/inherited-init-sugar-fix
slavapestov Jan 29, 2020
e13ea48
Private method should be for non-Windows only
Jan 29, 2020
2d59365
Merge pull request #29414 from bitjammer/acgarland/rdar-58853310-inte…
bitjammer Jan 29, 2020
d2ad3dc
[NFC] Commit a regression test for rdar://58960414
CodaFi Jan 29, 2020
286781f
Add a unit test for an individual node change, & add ability to set f…
Jan 30, 2020
30709ce
Merge pull request #29539 from davidungar/type-fingerprints-off-by-de…
Jan 30, 2020
6f6d786
Merge pull request #29536 from chrisamanse/fixWindows
compnerd Jan 30, 2020
9bd6385
Sema: Fix duplicate diagnostic spam with 'Self' in properties
slavapestov Jan 29, 2020
f4a5301
Sema: Fix crash when property type references type alias with unsatis…
slavapestov Jan 30, 2020
be37141
Revert "build: simplify version tracking logic"
shahmishal Jan 30, 2020
f0b7fb9
Merge pull request #29542 from slavapestov/self-diagnostic-spam
slavapestov Jan 30, 2020
dcaa950
[CSDiag] Removing unused FailureDiagnosis::visitTryExpr
LucianoPAlmeida Jan 30, 2020
2d10a8a
[ConstraintSystem] Extend function type conversion mismatch coverage
xedin Jan 30, 2020
d171b30
Allow fine-grained-dependency-include-intrafile in tests for compatib…
Jan 30, 2020
458ae7b
Use -fine-grained-dependency-include-intrafile for compatibility with…
Jan 30, 2020
6debe3d
[ConstraintSystem] Don't produce conformance fixes for mismatches ass…
xedin Jan 30, 2020
836d88f
Merge pull request #29546 from LucianoPAlmeida/visit-try-expr
xedin Jan 30, 2020
4ef4cd6
Merge pull request #29544 from slavapestov/conditional-requirements-c…
slavapestov Jan 30, 2020
9511295
Merge pull request #29548 from davidungar/type-fingerprints-off-by-de…
Jan 30, 2020
38f599d
Turn type-body-fingerprints on-by-default
Jan 30, 2020
a572c4b
Merge pull request #29549 from xedin/diag-all-function-type-mismatches
xedin Jan 30, 2020
a34b044
Merge pull request #29545 from apple/revert-29040-version-control
shahmishal Jan 30, 2020
3375b36
Search nested types tables in parent modules
CodaFi Jan 30, 2020
e121cb0
Revert "[SourceKit] Disable module system headers validation"
rintaro Jan 30, 2020
cb20d0e
Revert "[CodeCompletion] Disable module system headers validation"
rintaro Jan 30, 2020
82ec36d
Update tsan-emptyarraystorage.swift to run on remote_run
shahmishal Jan 30, 2020
a56cd12
Merge pull request #29554 from CodaFi/module-scope-context-is-king
swift-ci Jan 31, 2020
59fd697
Merge pull request #29538 from CodaFi/heavy-industrial-runoff
CodaFi Jan 31, 2020
b3e4ac8
Merge pull request #29555 from rintaro/revert-sourcekit-rdar58550697
rintaro Jan 31, 2020
ad1ad43
Generalize SolutionApplicationTarget and use it more widely.
DougGregor Jan 28, 2020
98db6e6
[Constraint solver] Don’t mark a moved-from instance as “diagnosed”.
DougGregor Jan 28, 2020
e3124dc
[Constraint system] Expand SolutionApplicationTarget for expressions.
DougGregor Jan 28, 2020
eb2862e
[Constraint system] Collapse applySolutionImpl() into applySolution().
DougGregor Jan 28, 2020
56aeac5
[Constraint system] Push SolutionApplicationTarget into the solveImpl
DougGregor Jan 28, 2020
54ac78d
[Constrsint solver] Remove ExprTypeCheckListener::constraintGeneratio…
DougGregor Jan 28, 2020
754afff
[Constraint solver] Remove ExprTypeCheckListener::preCheckFailed().
DougGregor Jan 28, 2020
f8fd197
[Constraint solver] Remove ExprTypeCheckListener::applySolutionFailed.
DougGregor Jan 28, 2020
5c6608f
[Constraint solver] Remove the FallbackDiagnosticListener.
DougGregor Jan 28, 2020
40ca1ef
[Constraint solver] Eliminate ExprTypeCheckListener::foundSolution()
DougGregor Jan 28, 2020
e0702d9
[Constraint solver] Generalize solve() for arbitrary solution targets.
DougGregor Jan 31, 2020
ce35731
[Constraint solver] Reinstate the fallback diagnostic, just in case.
DougGregor Jan 31, 2020
f0173b3
Merge pull request #29557 from apple/shahmishal/enable-tsan-test-remo…
shahmishal Jan 31, 2020
5c956ba
[AST/ASTDumper] Fix linker error for `SWIFT_BUILD_ONLY_SYNTAXPARSERLI…
akyrtzi Jan 31, 2020
a4dbe67
Merge pull request #29440 from gottesmm/pr-1b807b886ce5cba8ed0e399f6a…
gottesmm Jan 31, 2020
a7d6cd8
[Build System: build-script] Adds a new cache_utils module to build_s…
Jan 31, 2020
a0fbeb9
Merge pull request #29565 from akyrtzi/parser-only-build-fix-link-error
swift-ci Jan 31, 2020
fce335b
SILGen: Fix withoutActuallyEscaping of 'c' closures
aschwaighofer Jan 31, 2020
3e4e078
Merge pull request #29563 from DougGregor/generalize-solve
DougGregor Jan 31, 2020
d24537f
Merge pull request #29024 from xedin/diagnose-shadowing
xedin Jan 31, 2020
c4bd50c
Merge pull request #29569 from aschwaighofer/silgen_fix_withoutActual…
aschwaighofer Jan 31, 2020
8d20c1f
Merge pull request #29567 from Rostepher/cache-utils
Rostepher Jan 31, 2020
de9ffcb
Merge pull request #29551 from davidungar/type-fingerprints-on-by-def…
Jan 31, 2020
6b9c570
build: correct the handling for the static variants
compnerd Jan 31, 2020
950c73f
[Serialization] Bump module format version.
DougGregor Feb 1, 2020
95e98d9
Merge pull request #29584 from DougGregor/bump-top-level-var-module-v…
Catfish-Man Feb 1, 2020
a92724b
AST: Fix computeSelfParam() to respect __consuming on class methods
slavapestov Jan 31, 2020
62ca2aa
SIL: Fix an old FIXME
slavapestov Jan 31, 2020
bf124b8
[Type checker] Use typeCheckCondition() rather than fake it.
DougGregor Feb 1, 2020
4b0e7b2
[Type checker] Sink logic for @autoclosure default parameters into th…
DougGregor Feb 1, 2020
7cabef8
Merge pull request #29579 from slavapestov/no-ethical-consumption-of-…
slavapestov Feb 1, 2020
8c8f5b1
Merge pull request #29588 from DougGregor/silence-the-listeners
swift-ci Feb 1, 2020
e056d46
[Type checker] Remove unused overload of typeCheckExpression().
DougGregor Feb 1, 2020
9fa03cd
[Type checker] Eliminate TypeCheckExprFlags::ConvertTypeIsOnlyAHint.
DougGregor Feb 1, 2020
25c2e02
[Type checker] Eliminate TypeCheckExprFlags::DisableStructuralChecks.
DougGregor Feb 1, 2020
8beb904
Merge pull request #29580 from compnerd/indirection
compnerd Feb 1, 2020
a493004
[Type checker] Remove unused IsInOutYield flag.
DougGregor Feb 1, 2020
c5ed8d6
[Constraint solver] Fix tautological assert.
DougGregor Feb 1, 2020
3190433
[Constraint system] Give SolutionApplicationTarget purpose.
DougGregor Feb 1, 2020
b6d9dcc
Merge pull request #29589 from DougGregor/expr-type-check-flag-cleanups
swift-ci Feb 1, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cmake/modules/AddSwift.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2133,7 +2133,10 @@ function(add_swift_target_library name)

list(APPEND swiftlib_swift_compile_flags_all "-Fsystem" "${ios_support_frameworks_path}")
list(APPEND swiftlib_c_compile_flags_all "-iframework" "${ios_support_frameworks_path}")
list(APPEND swiftlib_link_flags_all "-F" "${ios_support_frameworks_path}")
# We collate -F with the framework path to avoid unwanted deduplication
# of options by target_compile_options -- this way no undesired
# side effects are introduced should a new search path be added.
list(APPEND swiftlib_link_flags_all "-F${ios_support_frameworks_path}")
endif()

if(sdk IN_LIST SWIFT_APPLE_PLATFORMS AND SWIFTLIB_IS_SDK_OVERLAY)
Expand Down
90 changes: 50 additions & 40 deletions docs/SIL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3495,46 +3495,8 @@ partial_apply
// %r will be of the substituted thick function type $(Z'...) -> R'

Creates a closure by partially applying the function ``%0`` to a partial
sequence of its arguments. In the instruction syntax, the type of the callee is
specified after the argument list; the types of the argument and of the defined
value are derived from the function type of the callee. If the ``partial_apply``
has an escaping function type (not ``[on_stack]``) the closure context will be
allocated with retain count 1 and initialized to contain the values ``%1``,
``%2``, etc. The closed-over values will not be retained; that must be done
separately before the ``partial_apply``. The closure does however take ownership
of the partially applied arguments (except for ``@inout_aliasable`` parameters);
when the closure reference count reaches zero, the contained values will be
destroyed. If the ``partial_apply`` has a ``@noescape`` function type
(``partial_apply [on_stack]``) the closure context is allocated on the stack and
initialized to contain the closed-over values. The closed-over values are not
retained, lifetime of the closed-over values must be managed separately. The
lifetime of the stack context of a ``partial_apply [on_stack]`` must be
terminated with a ``dealloc_stack``.

If the callee is generic, all of its generic parameters must be bound by the
given substitution list. The arguments are given with these generic
substitutions applied, and the resulting closure is of concrete function
type with the given substitutions applied. The generic parameters themselves
cannot be partially applied; all of them must be bound. The result is always
a concrete function.

If an address argument has ``@inout_aliasable`` convention, the closure
obtained from ``partial_apply`` will not own its underlying value.
The ``@inout_aliasable`` parameter convention is used when a ``@noescape``
closure captures an ``inout`` argument.

TODO: The instruction, when applied to a generic function,
currently implicitly performs abstraction difference transformations enabled
by the given substitutions, such as promoting address-only arguments and returns
to register arguments. This should be fixed.

By default, ``partial_apply`` creates a closure whose invocation takes ownership
of the context, meaning that a call implicitly releases the closure. The
``[callee_guaranteed]`` change this to a caller-guaranteed model, where the
caller promises not to release the closure while the function is being called.

This instruction is used to implement both curry thunks and closures. A
curried function in Swift::
sequence of its arguments. This instruction is used to implement both curry
thunks and closures. A curried function in Swift::

func foo(_ a:A)(b:B)(c:C)(d:D) -> E { /* body of foo */ }

Expand Down Expand Up @@ -3607,6 +3569,54 @@ lowers to an uncurried entry point and is curried in the enclosing function::
return %ret : $Int
}

**Ownership Semantics of Closure Context during Invocation**: By default, an
escaping ``partial_apply`` (``partial_apply`` without ``[on_stack]]`` creates a
closure whose invocation takes ownership of the context, meaning that a call
implicitly releases the closure. If the ``partial_apply`` is marked with the
flag ``[callee_guaranteed]`` the invocation instead uses a caller-guaranteed
model, where the caller promises not to release the closure while the function
is being called.

**Captured Value Ownership Semantics**: In the instruction syntax, the type of
the callee is specified after the argument list; the types of the argument and
of the defined value are derived from the function type of the callee. Even so,
the ownership requirements of the partial apply are not the same as that of the
callee function (and thus said signature). Instead:

1. If the ``partial_apply`` has a ``@noescape`` function type (``partial_apply
[on_stack]``) the closure context is allocated on the stack and is
initialized to contain the closed-over values without taking ownership of
those values. The closed-over values are not retained and the lifetime of the
closed-over values must be managed by other instruction independently of the
``partial_apply``. The lifetime of the stack context of a ``partial_apply
[on_stack]`` must be terminated with a ``dealloc_stack``.

2. If the ``partial_apply`` has an escaping function type (not ``[on_stack]``)
then the closure context will be heap allocated with a retain count of 1. Any
closed over parameters (except for ``@inout`` parameters) will be consumed by
the partial_apply. This ensures that no matter when the ``partial_apply`` is
called, the captured arguments are alive. When the closure context's
reference count reaches zero, the contained values are destroyed. If the
callee requires an owned parameter, then the implicit partial_apply forwarder
created by IRGen will copy the underlying argument and pass it to the callee.

3. If an address argument has ``@inout_aliasable`` convention, the closure
obtained from ``partial_apply`` will not own its underlying value. The
``@inout_aliasable`` parameter convention is used when a ``@noescape``
closure captures an ``inout`` argument.

**NOTE:** If the callee is generic, all of its generic parameters must be bound
by the given substitution list. The arguments are given with these generic
substitutions applied, and the resulting closure is of concrete function type
with the given substitutions applied. The generic parameters themselves cannot
be partially applied; all of them must be bound. The result is always a concrete
function.

**TODO:** The instruction, when applied to a generic function, currently
implicitly performs abstraction difference transformations enabled by the given
substitutions, such as promoting address-only arguments and returns to register
arguments. This should be fixed.

builtin
```````
::
Expand Down
11 changes: 9 additions & 2 deletions include/swift/AST/Decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ class alignas(1 << DeclAlignInBits) Decl {
IsStatic : 1
);

SWIFT_INLINE_BITFIELD(VarDecl, AbstractStorageDecl, 1+1+1+1+1+1+1,
SWIFT_INLINE_BITFIELD(VarDecl, AbstractStorageDecl, 1+1+1+1+1+1+1+1,
/// Encodes whether this is a 'let' binding.
Introducer : 1,

Expand All @@ -358,7 +358,10 @@ class alignas(1 << DeclAlignInBits) Decl {
IsLazyStorageProperty : 1,

/// Whether this is the backing storage for a property wrapper.
IsPropertyWrapperBackingProperty : 1
IsPropertyWrapperBackingProperty : 1,

/// Whether this is a lazily top-level global variable from the main file.
IsTopLevelGlobal : 1
);

SWIFT_INLINE_BITFIELD(ParamDecl, VarDecl, 1+2+NumDefaultArgumentKindBits,
Expand Down Expand Up @@ -5084,6 +5087,10 @@ class VarDecl : public AbstractStorageDecl {
Bits.VarDecl.IsLazyStorageProperty = IsLazyStorage;
}

/// True if this is a top-level global variable from the main source file.
bool isTopLevelGlobal() const { return Bits.VarDecl.IsTopLevelGlobal; }
void setTopLevelGlobal(bool b) { Bits.VarDecl.IsTopLevelGlobal = b; }

/// Retrieve the custom attributes that attach property wrappers to this
/// property. The returned list contains all of the attached property wrapper attributes in source order,
/// which means the outermost wrapper attribute is provided first.
Expand Down
29 changes: 21 additions & 8 deletions include/swift/AST/DiagnosticsSema.def
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,10 @@ ERROR(cannot_convert_initializer_value,none,
"cannot convert value of type %0 to specified type %1", (Type,Type))
ERROR(cannot_convert_initializer_value_protocol,none,
"value of type %0 does not conform to specified type %1", (Type,Type))
ERROR(cannot_convert_initializer_value_anyobject,none,
"value of type %0 expected to be instance of class or "
"class-constrained type",
(Type, Type))
ERROR(cannot_convert_initializer_value_nil,none,
"'nil' cannot initialize specified type %0", (Type))

Expand All @@ -346,6 +350,10 @@ ERROR(cannot_convert_to_return_type,none,
(Type,Type))
ERROR(cannot_convert_to_return_type_protocol,none,
"return expression of type %0 does not conform to %1", (Type,Type))
ERROR(cannot_convert_return_type_to_anyobject,none,
"return expression of type %0 expected to be an instance of "
"a class or class-constrained type",
(Type, Type))
ERROR(cannot_convert_to_return_type_nil,none,
"'nil' is incompatible with return type %0", (Type))

Expand Down Expand Up @@ -440,7 +448,10 @@ NOTE(candidate_performs_illegal_ephemeral_conv,none,

ERROR(cannot_convert_argument_value_protocol,none,
"argument type %0 does not conform to expected type %1", (Type, Type))

ERROR(cannot_convert_argument_value_anyobject,none,
"argument type %0 expected to be an instance of "
"a class or class-constrained type",
(Type, Type))
ERROR(cannot_convert_argument_value_nil,none,
"'nil' is not compatible with expected argument type %0", (Type))

Expand Down Expand Up @@ -536,6 +547,10 @@ NOTE(assign_protocol_conformance_fix_it,none,
ERROR(cannot_convert_assign_protocol,none,
"value of type %0 does not conform to %1 in assignment",
(Type, Type))
ERROR(cannot_convert_assign_anyobject,none,
"value of type %0 expected to be an instance of "
"a class or class-constrained type in assignment",
(Type, Type))
ERROR(cannot_convert_assign_nil,none,
"'nil' cannot be assigned to type %0", (Type))

Expand Down Expand Up @@ -1138,14 +1153,12 @@ NOTE(candidate_expected_different_labels,none,
"incorrect labels for candidate (have: '%0', expected: '%1')",
(StringRef, StringRef))

ERROR(member_shadows_function,none,
"use of %0 refers to %1 rather than %2 %3",
(DeclNameRef, DescriptiveDeclKind, DescriptiveDeclKind, DeclName))
ERROR(member_shadows_global_function,none,
"use of %0 refers to %1 %2 rather than %3 %4 in %5 %6",
(DeclNameRef, DescriptiveDeclKind, DeclName, DescriptiveDeclKind,
DeclName, DescriptiveDeclKind, DeclName))
ERROR(member_shadows_global_function_near_match,none,
"use of %0 nearly matches %3 %4 in %5 %6 rather than %1 %2",
(DeclNameRef, DescriptiveDeclKind, DeclName, DescriptiveDeclKind,
DeclName, DescriptiveDeclKind, DeclName))
"use of %0 refers to %1 rather than %2 %3 in module %4",
(DeclNameRef, DescriptiveDeclKind, DescriptiveDeclKind, DeclName, DeclName))

ERROR(instance_member_use_on_type,none,
"instance member %1 cannot be used on type %0; "
Expand Down
1 change: 1 addition & 0 deletions include/swift/AST/FineGrainedDependencies.h
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,7 @@ class SourceFileDepGraph {
compoundNamesByRDK);

static constexpr char noncascadingOrPrivatePrefix = '#';
static constexpr char nameFingerprintSeparator = ',';

static std::string noncascading(std::string name);

Expand Down
2 changes: 1 addition & 1 deletion include/swift/Basic/LangOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ namespace swift {
/// the interface hash, hash them into per-iterable-decl-context
/// fingerprints. Fine-grained dependency types won't dirty every provides
/// in a file when the user adds a member to, e.g., a struct.
bool EnableTypeFingerprints = false;
bool EnableTypeFingerprints = true;

/// When using fine-grained dependencies, emit dot files for every swiftdeps
/// file.
Expand Down
3 changes: 3 additions & 0 deletions include/swift/Basic/SourceManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,9 @@ class SourceManager {
llvm::Optional<unsigned> resolveOffsetForEndOfLine(unsigned BufferId,
unsigned Line) const;

/// Get the length of the line
llvm::Optional<unsigned> getLineLength(unsigned BufferId, unsigned Line) const;

SourceLoc getLocForLineCol(unsigned BufferId, unsigned Line, unsigned Col) const {
auto Offset = resolveFromLineCol(BufferId, Line, Col);
return Offset.hasValue() ? getLocForOffset(BufferId, Offset.getValue()) :
Expand Down
2 changes: 1 addition & 1 deletion include/swift/Driver/FineGrainedDependencyDriverGraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ class ModuleDepGraph {
/// Call \p fn for each node whose key matches \p key.
void
forEachMatchingNode(const DependencyKey &key,
function_ref<void(const ModuleDepGraphNode *)>) const;
function_ref<void(ModuleDepGraphNode *)>) const;

void forEachNodeInJob(StringRef swiftDeps,
function_ref<void(ModuleDepGraphNode *)>) const;
Expand Down
2 changes: 1 addition & 1 deletion include/swift/Option/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ HelpText<"Emit dot files every time driver imports an fine-grained swiftdeps fil

def fine_grained_dependency_include_intrafile :
Flag<["-"], "fine-grained-dependency-include-intrafile">,
InternalDebugOpt,
Flags<[FrontendOption, HelpHidden]>,
HelpText<"Include within-file dependencies.">;

def emit_fine_grained_dependency_sourcefile_dot_files :
Expand Down
2 changes: 1 addition & 1 deletion include/swift/SILOptimizer/Analysis/EscapeAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ class EscapeAnalysis : public BottomUpIPAnalysis {

/// Sets the outgoing points-to edge. The \p To node must be a Content node.
void setPointsToEdge(CGNode *To) {
assert(!To->mergeTo);
assert(!To->isMerged);
assert(To->Type == NodeType::Content &&
"Wrong node type for points-to edge");
pointsToIsEdge = true;
Expand Down
7 changes: 2 additions & 5 deletions lib/AST/ASTContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2431,7 +2431,8 @@ AnyFunctionType::Param swift::computeSelfParam(AbstractFunctionDecl *AFD,
if (isInitializingCtor) {
// initializing constructors of value types always have an implicitly
// inout self.
selfAccess = SelfAccessKind::Mutating;
if (!containerTy->hasReferenceSemantics())
selfAccess = SelfAccessKind::Mutating;
} else {
// allocating constructors have metatype 'self'.
isStatic = true;
Expand Down Expand Up @@ -2459,10 +2460,6 @@ AnyFunctionType::Param swift::computeSelfParam(AbstractFunctionDecl *AFD,
if (isStatic)
return AnyFunctionType::Param(MetatypeType::get(selfTy, Ctx));

// Reference types have 'self' of type T.
if (containerTy->hasReferenceSemantics())
return AnyFunctionType::Param(selfTy);

auto flags = ParameterTypeFlags();
switch (selfAccess) {
case SelfAccessKind::Consuming:
Expand Down
4 changes: 4 additions & 0 deletions lib/AST/ASTDumper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3762,6 +3762,10 @@ void Type::dump() const {
}

void Type::dump(raw_ostream &os, unsigned indent) const {
#if SWIFT_BUILD_ONLY_SYNTAXPARSERLIB
return; // not needed for the parser library.
#endif

PrintType(os, indent).visit(*this, "");
os << "\n";
}
Expand Down
7 changes: 2 additions & 5 deletions lib/AST/Decl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5312,6 +5312,7 @@ VarDecl::VarDecl(DeclKind kind, bool isStatic, VarDecl::Introducer introducer,
Bits.VarDecl.IsLazyStorageProperty = false;
Bits.VarDecl.HasNonPatternBindingInit = false;
Bits.VarDecl.IsPropertyWrapperBackingProperty = false;
Bits.VarDecl.IsTopLevelGlobal = false;
}

Type VarDecl::getType() const {
Expand Down Expand Up @@ -5410,11 +5411,7 @@ bool VarDecl::isLazilyInitializedGlobal() const {

// Top-level global variables in the main source file and in the REPL are not
// lazily initialized.
auto sourceFileContext = dyn_cast<SourceFile>(getDeclContext());
if (!sourceFileContext)
return true;

return !sourceFileContext->isScriptMode();
return !isTopLevelGlobal();
}

SourceRange VarDecl::getSourceRange() const {
Expand Down
Loading