Skip to content

Merge tag 'swift-DEVELOPMENT-SNAPSHOT-2019-12-20-a' into tensorflow #28924

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

Merged
merged 209 commits into from
Dec 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
209 commits
Select commit Hold shift + click to select a range
cb85ecf
SymbolicValue is_pod -> is_trivial
Oct 3, 2019
f5677cb
add @nondiff to AnyFunctionType params
Nov 15, 2019
6e559ab
rename nondiff => noDerivative
Nov 16, 2019
1058a38
clang-format
Nov 16, 2019
e5e25a6
Merge branch 'master' of github.com:apple/swift into ast-nondiff
Nov 16, 2019
c484894
TBDGen: generate $ld$hide$os symbols for decls marked with @_original…
nkcsgexi Dec 11, 2019
fdcd506
IRGen: add a function suitable for emitting linker directive as globa…
nkcsgexi Dec 12, 2019
93a83d3
IRGen: reuse linker directives collected from tbd gen to emit these s…
nkcsgexi Dec 12, 2019
2537602
IRGen: keep emitting protocol witness table symbols for refactored pr…
nkcsgexi Dec 12, 2019
c31b966
[test] IRGen: add a test for generating linker directive symbols $ld$…
nkcsgexi Dec 12, 2019
5d9e7b9
[test] TBD: add a tbd gen test for generating linker directives
nkcsgexi Dec 13, 2019
f098448
test: add a linker directive test for ios
nkcsgexi Dec 13, 2019
66b4737
TBDGen: use active platform versions to genearate linker directives
nkcsgexi Dec 13, 2019
3a55c3c
Front-end: teach the compiler to generate a .c file for $ld$add$os sy…
nkcsgexi Dec 14, 2019
d0b4da6
test: mark linker directives tests as macosx only
nkcsgexi Dec 14, 2019
5e30d0e
sema: diagnose bad interactions between @available and @_originallyDe…
nkcsgexi Dec 15, 2019
03fab30
Merge branch 'master' into tbdgen-ld-hide
nkcsgexi Dec 15, 2019
c5747c3
[NFC] Refactor name parsing into `Parser::parseDeclNameRef()`
beccadax Dec 14, 2019
9fa4303
[NFC] Switch uses over to parseDeclNameRef()
beccadax Dec 14, 2019
b5f02c3
[NFC] Remove unused Parser::parseUnqualifiedDeclName methods
beccadax Dec 14, 2019
bed2ce4
[NFC] Improve wording and usage of subscript/deinit flag
beccadax Dec 16, 2019
23cc079
[Dynamic casting] Fix overrelease on unsuccessful cast to an Error type.
DougGregor Dec 16, 2019
cefc03f
[CS] Resolve callees for key path dynamic members
hamishknight Dec 12, 2019
c842fee
[AutoDiff upstream] Add `@transpose(of:)` attribute.
dan-zheng Dec 12, 2019
046c849
Add an option to disable ClangImporter imports form source.
adrian-prantl Dec 16, 2019
e7170bd
Add Qualified Lookup Requests
CodaFi Dec 1, 2019
f22fb81
Block additive lookup in directReferencesForQualifiedTypeLookup
CodaFi Dec 16, 2019
257c93a
Use -[NSSet getObjects:] instead of -[NSSet getObjects:count:] to mai…
Catfish-Man Dec 16, 2019
f7472e2
EscapeAnalysis: Add PointerKind and interior/reference flags
atrick Dec 17, 2019
5a27e5d
EscapeAnalysis: Make EscapeState and UsePoints a property of the cont…
atrick Dec 17, 2019
cec925c
EscapeAnalysis: Do not create defer edges for block arguemnts.
atrick Dec 17, 2019
c2c36d0
[Serialization] Fix reporting a dependency cycle with a missing clang…
xymus Dec 16, 2019
66c2429
[Typechecker] Fix a few regressions with @autoclosure (#28677)
theblixguy Dec 17, 2019
ea1d5ef
Merge pull request #28816 from CodaFi/you-know-my-name-lookup-up-my-n…
CodaFi Dec 17, 2019
ca693ee
Revert "SR-5289: Teach Mirror how to handle unowned/unmanaged referen…
shahmishal Dec 17, 2019
c89d6ad
Merge pull request #28821 from apple/revert-28368-SR-5289
shahmishal Dec 17, 2019
56265a2
[CS] Resolve callees for key path dynamic members (#28807)
hamishknight Dec 17, 2019
a46ea4b
Merge pull request #28817 from Catfish-Man/ducking-types
Catfish-Man Dec 17, 2019
1ebc78b
[RemoteAST] Using module names specified by @_originallyDefinedIn for…
nkcsgexi Dec 17, 2019
439d99c
Merge pull request #28801 from brentdax/im-not-qualified-for-this
beccadax Dec 17, 2019
f8dace5
[Typechecker] Fix a crash related to use of invalid @autoclosure para…
theblixguy Dec 17, 2019
a8f2f95
Merge pull request #28804 from DougGregor/error-cast-overrelease
DougGregor Dec 17, 2019
90a33fa
[run-test] Change default path for "lit.py" executable.
YOCKOW Dec 16, 2019
942aeca
[Type check] Consider dynamic casts to NSError and NSObject.
DougGregor Dec 17, 2019
46bc50d
Merge pull request #28827 from DougGregor/type-checker-cast-nserror
swift-ci Dec 17, 2019
f67ccf5
Unset IFS after its use in set_build_options_for_host (#28811)
edymtt Dec 17, 2019
a36fd6d
Merge pull request #28820 from xymus/fix-cycle-diag-crash
xymus Dec 17, 2019
d595213
Merge pull request #28813 from adrian-prantl/57880844
adrian-prantl Dec 17, 2019
fdb1926
[SR-5289] Teach Mirror how to handle unowned/unmanaged references (#2…
tbkka Dec 17, 2019
729609b
IRGen: Replace local utility function by existing function on IRGenMo…
aschwaighofer Dec 17, 2019
0ea3bb1
EscapeAnalysis: rewrite canEscapeToUsePoint.
atrick Dec 17, 2019
fa47f19
EscapeAnalysis: Add and update tests.
atrick Dec 17, 2019
12d148b
test: add a test for demangle moved type names during runtime
nkcsgexi Dec 17, 2019
cf79163
test: update test to combine @available with @_originallyDefinedIn
nkcsgexi Dec 17, 2019
b94c097
Clarify `@derivative(of:)` and `@transpose(of:)` attribute names.
dan-zheng Dec 17, 2019
aecf9a1
Fix qualified name parsing syntax verification errors.
dan-zheng Dec 17, 2019
624c2fc
test: move demangle metadata for moved symbols to a separate file
nkcsgexi Dec 17, 2019
54d67d9
Merge pull request #28822 from theblixguy/fix/SR-11939
theblixguy Dec 17, 2019
cd1400d
Merge branch 'master' of github.com:apple/swift into upstream-transpo…
dan-zheng Dec 17, 2019
bac5a64
Merge pull request #28831 from aschwaighofer/irgen_remove_asSizeConstant
aschwaighofer Dec 17, 2019
c874aa0
build: enable cross-compilation on Windows
compnerd Dec 17, 2019
6b072ec
[AutoDiff] NFC: gardening.
dan-zheng Dec 17, 2019
9b59996
Merge pull request #28691 from nkcsgexi/tbdgen-ld-hide
nkcsgexi Dec 17, 2019
2b5ada1
Correctly calculate extra inhabitants for no-payload enums (#28830)
tbkka Dec 17, 2019
38e577e
Merge pull request #28838 from dan-zheng/autodiff-cleanup
swift-ci Dec 17, 2019
c736938
Address parsing/syntax review feedback.
dan-zheng Dec 18, 2019
62078c7
[ASTPrinter/CodeCompletion] Stop printing base type when possible
rintaro Nov 9, 2019
6da2ca7
[ASTPrinter] Test case for moduleinterface with member typealiases
rintaro Dec 17, 2019
fa31c75
Create shared utility `Parser::canParseSimpleTypeIdentifier`.
dan-zheng Dec 18, 2019
80dbf7e
Add test case for https://bugs.swift.org/browse/SR-9868
rintaro Dec 18, 2019
d3949e7
Merge pull request #28836 from compnerd/x-windows
compnerd Dec 18, 2019
6eb6bbe
Revert "[ClangImporter] Hash content for validation when using clang …
bcardosolopes Dec 18, 2019
208ac45
TypeNodes.def -> TypeNodes.inc because of a random open-source request.
rjmccall Dec 18, 2019
3fdf6c8
Merge pull request #28800 from atrick/escapeflags
atrick Dec 18, 2019
80c45b4
build: add explicit architecture check
compnerd Dec 18, 2019
bb067f4
Revert "EscapeAnalysis: add node flags and change the meaning of "esc…
eeckstein Dec 18, 2019
ed068f0
Merge pull request #28844 from compnerd/x11
compnerd Dec 18, 2019
6f4d65b
Merge pull request #28848 from apple/revert-28800-escapeflags
swift-ci Dec 18, 2019
8d712af
[cmake] Add support for exporting frameworks/libraries into cmake exp…
gottesmm Dec 18, 2019
c146c65
Merge pull request #28165 from rintaro/astprinter-rdar57033931
rintaro Dec 18, 2019
899cc20
Merge pull request #28841 from bcardosolopes/master-revert-hash-input
bcardosolopes Dec 18, 2019
ee5ce77
[CS] Push callee resolution into finishApply
hamishknight Dec 6, 2019
40d1171
[CS] Use custom locator element for `callAsFunction`
hamishknight Dec 6, 2019
1d66571
[AutoDiff upstream] `@derivative` attribute type-checking fixes.
dan-zheng Dec 17, 2019
a9c9f26
Merge pull request #27545 from apple/transposing-attr
akyrtzi Dec 18, 2019
e18f166
Merge pull request #28850 from gottesmm/pr-1632740d4d2400f5193382e840…
gottesmm Dec 18, 2019
9356864
[SIL Optimization] Create a new utility InstructionDeleter to delete …
ravikandhadai Nov 22, 2019
37c6be8
Merge pull request #27521 from apple/marcrasi-patch-1
swift-ci Dec 18, 2019
b7532f9
[Property wrappers] Diagnose unavailable wrappedValue
DougGregor Dec 18, 2019
0823d8b
Check for nullptr inside NominalTypeDecl::isResilient
nkcsgexi Dec 18, 2019
1ddb916
[gardening] Eliminate dead variable.
gottesmm Dec 18, 2019
df6d25f
[gardening] Be more defensive around a potentially uninitialized Stor…
gottesmm Dec 18, 2019
6896000
[gardening] Remove unused variable.
gottesmm Dec 18, 2019
a6fd37e
[build] Remove make_relative_symlink from build-script-impl
bulbazord Dec 18, 2019
2acd425
Merge pull request #28857 from DougGregor/property-wrappers-unavailab…
swift-ci Dec 18, 2019
0ce856b
Add a test for incorrectly constructing a Set from an NSArray
Catfish-Man Dec 18, 2019
e1663c9
Merge pull request #28859 from nkcsgexi/58049956
nkcsgexi Dec 18, 2019
b64c620
Merge pull request #28860 from gottesmm/pr-ecaea6466ae4502fe6e1cf51ed…
swift-ci Dec 18, 2019
ddcb1d5
Merge pull request #28853 from dan-zheng/derivative-attr-type-checking
swift-ci Dec 18, 2019
2a79331
add -enable/disable-only-one-dependency-file flag, on by default
Dec 19, 2019
d2f7a27
[NFC] Const-ify Some ClangImporter Interfaces
CodaFi Dec 18, 2019
ac75f31
Drop unused argument to mirrored member importing
CodaFi Dec 18, 2019
a1b4514
Teach loadNamedMembers to import inherited constructors
CodaFi Dec 18, 2019
b654bc3
Force load all members of iterable contexts in the DWARF Importer
CodaFi Dec 19, 2019
3e47e23
[semantic-arc] Small cleanups + some comments. NFC.
gottesmm Dec 13, 2019
2b42671
[CS] Use custom locator element for callAsFunction (#28854)
hamishknight Dec 19, 2019
d0e9578
[NFC] Use CompoundDeclName for zero-arg names
beccadax Dec 19, 2019
6936d0d
Merge pull request #28863 from Catfish-Man/ducking-types-test
Catfish-Man Dec 19, 2019
72194c5
Merge branch 'master' into ast-nondiff
Dec 18, 2019
774af19
Merge pull request #28635 from ravikandhadai/oslog-dead-code-elim-patch1
ravikandhadai Dec 19, 2019
15bcf53
Merge pull request #28802 from YOCKOW/run-test-llvm-project-path
CodaFi Dec 19, 2019
9209e4f
Merge pull request #28840 from CodaFi/constrnation
swift-ci Dec 19, 2019
a50b940
Merge pull request #28865 from gottesmm/pr-0437ed0a25aba3ef32d53473cb…
swift-ci Dec 19, 2019
1de8934
Merge pull request #28861 from xiaobai/ded-code
compnerd Dec 19, 2019
36f467c
Merge pull request #28843 from rjmccall/swift-reaction
rjmccall Dec 19, 2019
f51f3b8
[SourceKit] Support VFS in 'typecontextinfo' and 'conformingmethods' req
rintaro Nov 18, 2019
cd284d1
[CodeCompletion] Align swiftCodeCompleteImpl() with other similar funcs
rintaro Nov 18, 2019
ff97c06
[CodeCompletion] Use offsets in the buffer for second pass state
rintaro Nov 20, 2019
62c4412
[SourceKit] Reuse compiler instance between multiple completion
rintaro Nov 18, 2019
c1530ee
[SourceKit] Add option to enable ASTContext reusing for code completion
rintaro Dec 11, 2019
a83c7e8
[SourceKit] Calculate CompilerInvocation hash
rintaro Dec 11, 2019
fcc7e41
[SourceKit] Add a test case for fast code completion
rintaro Dec 12, 2019
c3d5828
[SourceKit] Limit compiler instance reuse count for completions
rintaro Dec 12, 2019
2160134
[SourceKit] Add test file for fast completion
rintaro Dec 13, 2019
204ae49
[CodeCompletion] Add doc-comment for CompletionInstance
rintaro Dec 17, 2019
f2466de
[CodeCompletion] Rename getReusingCompilerInstance()
rintaro Dec 17, 2019
c5b1ada
[SourceKit] Hold CompletionInstance with std::shared_ptr
rintaro Dec 17, 2019
0f45267
[CodeCompletion] Use the arguments to check the equality of the invoc…
rintaro Dec 17, 2019
fcb50d6
[SourceKit] Add more test cases for fast completions
rintaro Dec 18, 2019
044477e
[SourceKit/CodeCompletion] Use callback function to run the second pass
rintaro Dec 18, 2019
fe07d44
[CodeCompletion] Pack cached instance information into single struct
rintaro Dec 18, 2019
2aec5d4
[CodeCompletionn] Block completions in other threads
rintaro Dec 19, 2019
370bd1d
Update mailmap for bitjammer
bitjammer Dec 19, 2019
4e71ce5
[IRGen] Canonicalize associated type witnesses.
DougGregor Dec 19, 2019
0291b36
off-by-default & fix tests
Dec 19, 2019
1a9bdaf
Refactor Direct Name Lookup
CodaFi Dec 18, 2019
8b926af
EscapeAnalysis: Add PointerKind and interior/reference flags
atrick Dec 17, 2019
7fb4e21
EscapeAnalysis: Make EscapeState and UsePoints a property of the cont…
atrick Dec 17, 2019
17ab0ad
EscapeAnalysis: Do not create defer edges for block arguemnts.
atrick Dec 17, 2019
3782d67
EscapeAnalysis: rewrite canEscapeToUsePoint.
atrick Dec 17, 2019
6dfbafb
EscapeAnalysis: Add and update tests.
atrick Dec 17, 2019
d59c23f
Merge pull request #28869 from DougGregor/assoc-type-witness-canon
DougGregor Dec 19, 2019
69d1060
Merge pull request #28867 from davidungar/enable-disable-off-by-default
Dec 19, 2019
4a590ce
Add missing ? in “did you mean …” diagnostics
ftchirou Dec 19, 2019
78c7eec
off-by-default & fix tests
Dec 19, 2019
b1f6a89
Change to defaulting on
Dec 19, 2019
233ad32
Merge pull request #28868 from bitjammer/acgarland/mailmap
bitjammer Dec 19, 2019
3a9b8bc
[Driver] Add unversioned triple to the output of -print-target-info.
DougGregor Dec 19, 2019
c03fbb5
Merge pull request #28743 from davidungar/enable-disable-on-by-default
Dec 19, 2019
5f0dd91
Merge pull request #28872 from ftchirou/SR-11919/fix-diagnostics
xedin Dec 19, 2019
393c6d3
Merge pull request #28874 from DougGregor/unversioned-triple
DougGregor Dec 19, 2019
2630be1
Merge pull request #28871 from atrick/escape-cycle
atrick Dec 19, 2019
aebfb53
Ast dump ignore wmo (#20596)
vinivendra Dec 19, 2019
8bcc192
[Diagnostics] Diagnose inability to infer (complex) closure return type
xedin Dec 19, 2019
a7bb827
[CSDiag] NFC: Remove obsolete `diagnoseAmbiguousMultiStatementClosure`
xedin Dec 19, 2019
eebcbf6
[SourceKit] Pass 'EnableASTCaching' flag as an argument
rintaro Dec 19, 2019
8e7c6a5
[Test] Disable reflect_Enum_(254|Two)CaseNoPayloads.swift when testin…
mikeash Dec 19, 2019
6cce47d
Merge pull request #28881 from mikeash/fix-new-enum-tests-back-deploy…
slavapestov Dec 19, 2019
216d02f
[test] Mark _Differentiable tests as unsupported in Swift-in-the-OS c…
lorentey Dec 19, 2019
576df04
Merge pull request #28882 from lorentey/master
slavapestov Dec 19, 2019
bab1239
Merge pull request #28866 from brentdax/raiding-the-compound
beccadax Dec 19, 2019
ec0a2ca
Merge pull request #28278 from marcrasi/ast-nondiff
swift-ci Dec 19, 2019
b03b356
Merge pull request #28880 from xedin/port-multi-stmt-closure-diags
xedin Dec 19, 2019
10936f6
Merge pull request #28727 from rintaro/sourcekit-completion-reuseinst…
rintaro Dec 19, 2019
980b1f0
[di] Hide some internal state and give some methods better names give…
gottesmm Dec 19, 2019
b268698
[ownership] Allow mark_uninitialized to only take owned/none ownershi…
gottesmm Dec 19, 2019
35a1906
[Clang importer] objc_direct methods/properties are unavailable in Sw…
MadCoder Dec 19, 2019
f5f3ccb
Merge pull request #28885 from gottesmm/pr-68358de07d2e4962213824f972…
swift-ci Dec 20, 2019
6508604
Merge pull request #28876 from gottesmm/pr-f24fe5098010cb44c8efa61698…
swift-ci Dec 20, 2019
2cb6cdc
Merge pull request #28886 from DougGregor/objc_direct
swift-ci Dec 20, 2019
637314a
[AutoDiff] factor derivative typechecking helper out of AttributeChecker
Dec 19, 2019
71697c3
Allow implicit self in escaping closures when self usage is unlikely …
Jumhyn Dec 20, 2019
f2ed81b
Revert "[test] Mark _Differentiable tests as unsupported in Swift-in-…
lorentey Dec 20, 2019
4a943ab
Merge pull request #28845 from CodaFi/a-little-looksie
CodaFi Dec 20, 2019
5ab6c46
Driver: mark test as XFAIL on windows
compnerd Dec 20, 2019
e47543c
Merge pull request #28879 from marcrasi/less-mutating-typechecking
swift-ci Dec 20, 2019
72018db
Parse: Remove some dead code
slavapestov Dec 18, 2019
1c2ac8e
Parse: Parse entire top level in one shot
slavapestov Dec 19, 2019
1904960
Sema: Fix a couple of problems with capture analysis and TopLevelCode…
slavapestov Dec 5, 2019
04bf432
SILGen: Diagnose invalid captures of top-level bindings
slavapestov Dec 5, 2019
8e6dc39
Parse: Keep track of top-level declarations that follow a 'guard' sta…
slavapestov Dec 20, 2019
e462626
AST: More consistent definition of a 'local capture'
slavapestov Dec 20, 2019
8214e18
SILGen: Clean up invariants around capture lists
slavapestov Dec 5, 2019
bdbe062
Sema: Tweak SanitizeExpr handling of AutoClosureExprs
slavapestov Dec 13, 2019
af07642
Sema: Remove TypeCheckExprFlags::SkipMultiStmtClosures
slavapestov Dec 15, 2019
4017a16
Revert "SILGen: Simplify SILGenFunction::emitClosure()"
slavapestov Dec 16, 2019
f994334
SILOptimizer: AllocBoxToStack preserves [transparent] bit in cloned f…
slavapestov Dec 16, 2019
3149d6d
IDE: Preparations for Sema building curry thunks
slavapestov Dec 17, 2019
3604b21
AST: Simplify Expr::getReferencedDecl()
slavapestov Dec 17, 2019
14ee6c5
[AutoDiff] Enable `@derivative` attribute qualified declaration names…
dan-zheng Dec 20, 2019
d61de7d
Merge pull request #28893 from apple/revert-28882-master
lorentey Dec 20, 2019
2692abb
[AutoDiff] Fix build error.
dan-zheng Dec 20, 2019
06014e6
Merge pull request #28897 from dan-zheng/derivative-attr-qualified-decl
rintaro Dec 20, 2019
0514248
Merge pull request #28596 from slavapestov/fun-with-guard-let
slavapestov Dec 20, 2019
a99f24f
Merge pull request #28895 from slavapestov/prep-for-sr-75
slavapestov Dec 20, 2019
ab04751
[CodeCompletion] Eliminate CodeCompletionCallbacks::completeExpr()
rintaro Dec 20, 2019
4062012
Merge pull request #28894 from compnerd/wunicode
shahmishal Dec 20, 2019
419240f
Make path suitable for Windows
Dec 20, 2019
3cda934
[Typechecker] Fix duplicate diagnostics when using attributes (#28888)
theblixguy Dec 20, 2019
d0e5270
Merge pull request #28898 from rintaro/ide-completion-rdar58102910
rintaro Dec 20, 2019
fb30e9e
[MSVC] Evaluate parameters in the right order.
drodriguez Dec 20, 2019
539d8da
Remove re-entrancy assertion
CodaFi Dec 20, 2019
2101029
Merge pull request #28906 from drodriguez/windows-explicit-parameter-…
shahmishal Dec 20, 2019
b644980
Merge pull request #28907 from CodaFi/rewind
slavapestov Dec 20, 2019
97a5690
Merge pull request #28902 from davidungar/windows-compatible-dummy-file
shahmishal Dec 20, 2019
621cd3e
Revert "Driver: mark test as XFAIL on windows"
compnerd Dec 20, 2019
2007515
Merge pull request #28909 from apple/revert-28894-wunicode
shahmishal Dec 20, 2019
821885f
Merge tag 'swift-DEVELOPMENT-SNAPSHOT-2019-12-20-a' into tensorflow
dan-zheng Dec 22, 2019
a34e259
Fix merge conflicts.
dan-zheng Dec 22, 2019
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
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Amr Aboelela <[email protected]> <[email protected]>
Ankit Aggarwal <[email protected]> <[email protected]>
Argyrios Kyrtzidis <[email protected]> <[email protected]>
Arsen Gasparyan <[email protected]> <[email protected]>
Ashley Garland <[email protected]> <[email protected]>
Ben Cohen <[email protected]>
Ben Cohen <[email protected]> <[email protected]>
Ben Cohen <[email protected]> <[email protected]>
Expand Down
14 changes: 10 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -970,10 +970,16 @@ if(SWIFT_BUILD_SYNTAXPARSERLIB OR SWIFT_BUILD_SOURCEKIT)
set(SWIFT_LIBDISPATCH_CXX_COMPILER ${CMAKE_CXX_COMPILER})
elseif(${CMAKE_SYSTEM_NAME} STREQUAL ${CMAKE_HOST_SYSTEM_NAME})
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
set(SWIFT_LIBDISPATCH_C_COMPILER
$<TARGET_FILE_DIR:clang>/clang-cl${CMAKE_EXECUTABLE_SUFFIX})
set(SWIFT_LIBDISPATCH_CXX_COMPILER
$<TARGET_FILE_DIR:clang>/clang-cl${CMAKE_EXECUTABLE_SUFFIX})
if(CMAKE_SYSTEM_PROCESSOR STREQUAL CMAKE_HOST_SYSTEM_PROCESSOR AND
TARGET clang)
set(SWIFT_LIBDISPATCH_C_COMPILER
$<TARGET_FILE_DIR:clang>/clang-cl${CMAKE_EXECUTABLE_SUFFIX})
set(SWIFT_LIBDISPATCH_CXX_COMPILER
$<TARGET_FILE_DIR:clang>/clang-cl${CMAKE_EXECUTABLE_SUFFIX})
else()
set(SWIFT_LIBDISPATCH_C_COMPILER clang-cl${CMAKE_EXECUTABLE_SUFFIX})
set(SWIFT_LIBDISPATCH_CXX_COMPILER clang-cl${CMAKE_EXECUTABLE_SUFFIX})
endif()
else()
set(SWIFT_LIBDISPATCH_C_COMPILER $<TARGET_FILE_DIR:clang>/clang)
set(SWIFT_LIBDISPATCH_CXX_COMPILER $<TARGET_FILE_DIR:clang>/clang++)
Expand Down
2 changes: 1 addition & 1 deletion include/swift/AST/ASTContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ class ASTContext final {
// same parameter indices but different derivative generic signatures.
llvm::DenseMap<
std::tuple<Decl *, IndexSubset *, AutoDiffDerivativeFunctionKind>,
DerivativeAttr *>
llvm::SmallPtrSet<DerivativeAttr *, 1>>
DerivativeAttrs;

private:
Expand Down
20 changes: 20 additions & 0 deletions include/swift/AST/ASTScope.h
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,10 @@ class ASTScopeImpl {
/// asked.
virtual Optional<NullablePtr<DeclContext>> computeSelfDCForParent() const;

/// Returns the context that should be used when a nested scope (e.g. a
/// closure) captures self explicitly.
virtual NullablePtr<DeclContext> capturedSelfDC() const;

protected:
/// Find either locals or members (no scope has both)
/// \param history The scopes visited since the start of lookup (including
Expand Down Expand Up @@ -692,6 +696,15 @@ class Portion {
/// to compute the selfDC from the history.
static NullablePtr<DeclContext>
computeSelfDC(ArrayRef<const ASTScopeImpl *> history);

/// If we find a lookup result that requires the dynamic implict self value,
/// we need to check the nested scopes to see if any closures explicitly
/// captured \c self. In that case, the appropriate selfDC is that of the
/// innermost closure which captures a \c self value from one of this type's
/// methods.
static NullablePtr<DeclContext>
checkNestedScopesForSelfCapture(ArrayRef<const ASTScopeImpl *> history,
size_t start);
};

/// Behavior specific to representing the trailing where clause of a
Expand Down Expand Up @@ -1449,6 +1462,13 @@ class ClosureParametersScope final : public AbstractClosureScope {
std::string getClassName() const override;
SourceRange
getSourceRangeOfThisASTNode(bool omitAssertions = false) const override;

/// Since explicit captures of \c self by closures enable the use of implicit
/// \c self, we need to make sure that the appropriate \c self is used as the
/// base decl for these uses (otherwise, the capture would be marked as
/// unused. \c ClosureParametersScope::capturedSelfDC() checks if we have such
/// a capture of self.
NullablePtr<DeclContext> capturedSelfDC() const override;

protected:
ASTScopeImpl *expandSpecifically(ScopeCreator &) override;
Expand Down
16 changes: 9 additions & 7 deletions include/swift/AST/Attr.def
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ TYPE_ATTR(noDerivative)
TYPE_ATTR(autodiff)
TYPE_ATTR(nondiff)
TYPE_ATTR(quoted)
// SWIFT_ENABLE_TENSORFLOW END

// SIL-specific attributes
TYPE_ATTR(block_storage)
Expand Down Expand Up @@ -545,27 +546,28 @@ DECL_ATTR(_implicitly_synthesizes_nested_requirement, ImplicitlySynthesizesNeste
ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove,
98)

DECL_ATTR(transpose, Transpose,
OnFunc | LongAttribute | AllowMultipleAttributes |
ABIStableToAdd | ABIBreakingToRemove | APIStableToAdd | APIBreakingToRemove,
99)

// SWIFT_ENABLE_TENSORFLOW
DECL_ATTR(quoted, Quoted,
OnFunc |
ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove,
99)
100)
// TODO(TF-999): Remove deprecated `@differentiating` attribute.
DECL_ATTR(differentiating, Differentiating,
OnFunc | LongAttribute | AllowMultipleAttributes |
ABIStableToAdd | ABIBreakingToRemove | APIStableToAdd | APIBreakingToRemove,
100)
101)
SIMPLE_DECL_ATTR(compilerEvaluable, CompilerEvaluable,
OnAccessor | OnFunc | OnConstructor | OnSubscript |
ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove |
NotSerialized, 101)
NotSerialized, 102)
SIMPLE_DECL_ATTR(noDerivative, NoDerivative,
OnVar |
ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove,
102)
DECL_ATTR(transpose, Transpose,
OnFunc | LongAttribute | AllowMultipleAttributes |
ABIStableToAdd | ABIBreakingToRemove | APIStableToAdd | APIBreakingToRemove,
103)
// SWIFT_ENABLE_TENSORFLOW END

Expand Down
57 changes: 37 additions & 20 deletions include/swift/AST/Attr.h
Original file line number Diff line number Diff line change
Expand Up @@ -1626,6 +1626,8 @@ class OriginallyDefinedInAttr: public DeclAttribute {
/// Indicates when the symbol was moved here.
const llvm::VersionTuple MovedVersion;

/// Returns true if this attribute is active given the current platform.
bool isActivePlatform(const ASTContext &ctx) const;
static bool classof(const DeclAttribute *DA) {
return DA->getKind() == DAK_OriginallyDefinedIn;
}
Expand Down Expand Up @@ -1844,19 +1846,19 @@ class DifferentiableAttr final
}
};

/// The `@derivative` attribute registers a function as a derivative of another
/// function-like declaration: a 'func', 'init', 'subscript', or 'var' computed
/// property declaration.
/// The `@derivative(of:)` attribute registers a function as a derivative of
/// another function-like declaration: a 'func', 'init', 'subscript', or 'var'
/// computed property declaration.
///
/// The `@derivative` attribute also has an optional `wrt:` clause specifying
/// the parameters that are differentiated "with respect to", i.e. the
/// differentiation parameters. The differentiation parameters must conform to
/// the `Differentiable` protocol.
/// The `@derivative(of:)` attribute also has an optional `wrt:` clause
/// specifying the parameters that are differentiated "with respect to", i.e.
/// the differentiation parameters. The differentiation parameters must conform
/// to the `Differentiable` protocol.
///
/// If the `wrt:` clause is unspecified, the differentiation parameters are
/// inferred to be all parameters that conform to `Differentiable`.
///
/// `@derivative` attribute type-checking verifies that the type of the
/// `@derivative(of:)` attribute type-checking verifies that the type of the
/// derivative function declaration is consistent with the type of the
/// referenced original declaration and the differentiation parameters.
///
Expand All @@ -1868,6 +1870,11 @@ class DerivativeAttr final
private llvm::TrailingObjects<DerivativeAttr, ParsedAutoDiffParameter> {
friend TrailingObjects;

/// The base type repr for the referenced original function. This field is
/// non-null only for parsed attributes that reference a qualified original
/// declaration. This field is not serialized; type-checking uses it to
/// resolve the original declaration, which is serialized.
TypeRepr *BaseTypeRepr;
/// The original function name.
DeclNameRefWithLoc OriginalFunctionName;
/// The original function declaration, resolved by the type checker.
Expand All @@ -1880,23 +1887,27 @@ class DerivativeAttr final
Optional<AutoDiffDerivativeFunctionKind> Kind = None;

explicit DerivativeAttr(bool implicit, SourceLoc atLoc, SourceRange baseRange,
DeclNameRefWithLoc original,
TypeRepr *baseTypeRepr, DeclNameRefWithLoc original,
ArrayRef<ParsedAutoDiffParameter> params);

explicit DerivativeAttr(bool implicit, SourceLoc atLoc, SourceRange baseRange,
DeclNameRefWithLoc original, IndexSubset *indices);
TypeRepr *baseTypeRepr, DeclNameRefWithLoc original,
IndexSubset *parameterIndices);

public:
static DerivativeAttr *create(ASTContext &context, bool implicit,
SourceLoc atLoc, SourceRange baseRange,
TypeRepr *baseTypeRepr,
DeclNameRefWithLoc original,
ArrayRef<ParsedAutoDiffParameter> params);

static DerivativeAttr *create(ASTContext &context, bool implicit,
SourceLoc atLoc, SourceRange baseRange,
TypeRepr *baseTypeRepr,
DeclNameRefWithLoc original,
IndexSubset *indices);
IndexSubset *parameterIndices);

TypeRepr *getBaseTypeRepr() const { return BaseTypeRepr; }
DeclNameRefWithLoc getOriginalFunctionName() const {
return OriginalFunctionName;
}
Expand Down Expand Up @@ -1940,12 +1951,19 @@ class DerivativeAttr final
// SWIFT_ENABLE_TENSORFLOW
// TODO(TF-999): Remove deprecated `@differentiating` attribute.
using DifferentiatingAttr = DerivativeAttr;
// SWIFT_ENABLE_TENSORFLOW END

/// Attribute that registers a function as a transpose of another function.
/// The `@transpose(of:)` attribute registers a function as a transpose of
/// another function-like declaration: a 'func', 'init', 'subscript', or 'var'
/// computed property declaration.
///
/// The `@transpose(of:)` attribute also has a `wrt:` clause specifying the
/// parameters that are transposed "with respect to", i.e. the transposed
/// parameters.
///
/// Examples:
/// @transpose(of: foo)
/// @transpose(of: +, wrt: (lhs, rhs))
/// @transpose(of: +, wrt: (0, 1))
class TransposeAttr final
: public DeclAttribute,
private llvm::TrailingObjects<TransposeAttr, ParsedAutoDiffParameter> {
Expand All @@ -1966,23 +1984,23 @@ class TransposeAttr final
IndexSubset *ParameterIndices = nullptr;

explicit TransposeAttr(bool implicit, SourceLoc atLoc, SourceRange baseRange,
TypeRepr *baseTypeRepr, DeclNameRefWithLoc original,
TypeRepr *baseType, DeclNameRefWithLoc original,
ArrayRef<ParsedAutoDiffParameter> params);

explicit TransposeAttr(bool implicit, SourceLoc atLoc, SourceRange baseRange,
TypeRepr *baseTypeRepr, DeclNameRefWithLoc original,
IndexSubset *indices);
TypeRepr *baseType, DeclNameRefWithLoc original,
IndexSubset *parameterIndices);

public:
static TransposeAttr *create(ASTContext &context, bool implicit,
SourceLoc atLoc, SourceRange baseRange,
TypeRepr *baseTypeRepr, DeclNameRefWithLoc original,
TypeRepr *baseType, DeclNameRefWithLoc original,
ArrayRef<ParsedAutoDiffParameter> params);

static TransposeAttr *create(ASTContext &context, bool implicit,
SourceLoc atLoc, SourceRange baseRange,
TypeRepr *baseTypeRepr, DeclNameRefWithLoc original,
IndexSubset *indices);
TypeRepr *baseType, DeclNameRefWithLoc original,
IndexSubset *parameterIndices);

TypeRepr *getBaseTypeRepr() const { return BaseTypeRepr; }
DeclNameRefWithLoc getOriginalFunctionName() const {
Expand Down Expand Up @@ -2018,7 +2036,6 @@ class TransposeAttr final
return DA->getKind() == DAK_Transpose;
}
};
// SWIFT_ENABLE_TENSORFLOW END

/// Attributes that may be applied to declarations.
class DeclAttributes {
Expand Down
6 changes: 4 additions & 2 deletions include/swift/AST/Builtins.def
Original file line number Diff line number Diff line change
Expand Up @@ -654,8 +654,10 @@ BUILTIN_MISC_OPERATION(PoundAssert, "poundAssert", "", Special)

/// globalStringTablePointer has type String -> Builtin.RawPointer.
/// It returns an immortal, global string table pointer for strings constructed
/// from string literals.
BUILTIN_MISC_OPERATION_WITH_SILGEN(GlobalStringTablePointer, "globalStringTablePointer", "", Special)
/// from string literals. We consider it effects as readnone meaning that it
/// does not read any memory (note that even though it reads from a string, it
/// is a pure value and therefore we can consider it as readnone).
BUILTIN_MISC_OPERATION_WITH_SILGEN(GlobalStringTablePointer, "globalStringTablePointer", "n", Special)

#undef BUILTIN_MISC_OPERATION_WITH_SILGEN

Expand Down
Loading