Commit Graph

933 Commits

Author SHA1 Message Date
Michael Gottesman
ba3fa2f5d3 Merge pull request #18500 from compnerd/swift-syntax-dependency
build: extract libdispatch build for swift
2018-08-09 14:38:49 -07:00
Saleem Abdulrasool
f140734584 build: extract libdispatch build for swift
Extract the ExternalProject handling for libdispatch needed to build
SourceKit on Linux into a separate CMake list.  This will allow us to
pull in a dependency on Foundation as well to allow building SwiftSyntax
on Linux which requires Foundation.  Foundation has a dependency on
libdispatch requiring that the external project handling is centralised.
2018-08-08 13:41:49 -07:00
Slava Pestov
b67752a15f Minor NFC cleanups 2018-08-08 10:18:49 -07:00
Jordan Rose
061204c704 Remove "IFK_" prefix from enum class InputFileKind
I suspect this was converted from a non-scoped enum in the past.
No functionality change.
2018-08-07 08:54:31 -07:00
Jordan Rose
fc9ea1e329 Add Lexer::IsHashbangAllowed, drop SourceManager::getHashbangBufferID (#18534)
Having this be a single buffer hardcoded in the SourceManager and set
by all clients is silly. SourceFiles with the 'Main' kind are allowed
to have hashbang lines (`#!`), other files are not. And anyone
manually setting up a Lexer can decide for themselves.

No intended behavioral change.
2018-08-07 08:25:05 -07:00
Huon Wilson
7753383223 [AST] Add @_hasInitialValue to var/lets that have initializers.
The information about whether a variable/property is initialized is lost in the
public interface, but is, unfortunately, required because it results in a symbol
for the initializer (if a class/struct `init` is inlined, it will call
initializers for properties that it doesn't initialize itself). This is
important to preserve for TBD file generation.

Using an attribute rather than just a bit on the VarDecl means this fits into
the scheme for module interfaces: textual/valid Swift.
2018-08-07 09:54:35 +10:00
Mishal Shah
772d07e6f8 Merge pull request #18504 from shahmishal/master-next
Merge master-next into master branch to support stable-next
2018-08-06 13:07:08 -07:00
Xi Ge
7542f991c1 Re-apply "SourceKit: make SwiftLang build in linux. (#18455)" (#18506) 2018-08-06 11:37:09 -07:00
swift-ci
71f0248b0a Merge remote-tracking branch 'origin/master' into master-next 2018-08-06 11:07:55 -07:00
Doug Gregor
199bf6eabf Merge pull request #18425 from DougGregor/extended-nominal
[Name lookup] Introduce a request for "extended nominal type decl"
2018-08-06 08:23:36 -07:00
swift-ci
67e4f3d49d Merge remote-tracking branch 'origin/master' into master-next 2018-08-03 11:29:48 -07:00
Doug Gregor
bd5f5d80e4 [AST] Add ExtensionDecl::getExtendedNominal().
Introduce ExtensionDecl::getExtendedNominal() to provide the nominal
type declaration that the extension declaration extends. Move most
of the existing callers of the callers to getExtendedType() over to
getExtendedNominal(), because they don’t need the full type information.

ExtensionDecl::getExtendedNominal() is itself not very interesting yet,
because it depends on getExtendedType().
2018-08-03 11:26:48 -07:00
Xi Ge
960d7642cf Revert "SourceKit: make SwiftLang build in linux. (#18455)"
We revert it for failures in

https://ci.swift.org/job/oss-swift_tools-RA_stdlib-RD_test-simulator/1237/consoleFull#-20795171483122a513-f36a-4c87-8ed7-cbc36a1ec144
2018-08-03 11:24:51 -07:00
swift-ci
e35eb8a5a4 Merge remote-tracking branch 'origin/master' into master-next 2018-08-02 19:09:51 -07:00
Xi Ge
084286eb5a SourceKit: make SwiftLang build in linux. (#18455) 2018-08-02 18:49:01 -07:00
swift-ci
08a913e7ac Merge remote-tracking branch 'origin/master' into master-next 2018-08-02 17:29:47 -07:00
Alex Hoppen
b75dd68180 [SourceKit] Pass reused node IDs by reference 2018-08-02 14:33:55 -07:00
Alex Hoppen
729e0e23fc [libSyntax] Add logging for how long syntax tree serialization took 2018-08-02 14:32:12 -07:00
Alex Hoppen
85f1c5e7a1 [incrParse] Fix issue because of which the syntax tree always got serialized completely 2018-08-02 14:31:35 -07:00
Alex Hoppen
082a9878d1 [SourceKit] Reserve 4KB for the syntax tree buffer
Heuristics have shown that this prevents several new mallocs and speeds
incremental syntax tree transfer up.
2018-08-02 14:30:58 -07:00
Alex Hoppen
15b1559e06 [SourceKit] Move syntax tree serialization to separate function
This will allow us to experiment with other serialization formats in the
future more easily.
2018-08-02 14:30:58 -07:00
swift-ci
ade797f277 Merge remote-tracking branch 'origin/master' into master-next 2018-08-02 10:10:04 -07:00
Alex Hoppen
99b1ce7ab7 Merge pull request #18416 from ahoppen/editorconsumer-return-values
[SourceKit] Change return value of functions in EditorConsumer to void
2018-08-02 09:53:44 -07:00
Alex Hoppen
38c62cf766 Merge pull request #18426 from ahoppen/sourcekit-raw-data
[sourcekitd] Add support for transferring raw data
2018-08-02 09:52:41 -07:00
swift-ci
b60e24a162 Merge remote-tracking branch 'origin/master' into master-next 2018-08-01 18:29:04 -07:00
Rintaro Ishizaki
335e913bed Merge pull request #18439 from rintaro/sourcekit-editoffset-rdar34206143
[SourceKit] Defensive guard for invalid offset and length in edit request
2018-08-02 10:19:33 +09:00
Rintaro Ishizaki
399fece7f5 [SourceKit] Dedicated error message for 'offset' + 'length' out of range 2018-08-02 09:29:28 +09:00
Alex Hoppen
9bbe441160 [SourceKit] Change return value of functions in EditorConsumer to void
We were always returning true from those functions in  SKEditorConsumer
and false in the test consumers. On the client side we would then ignore
the return value. So it's clearer to have the functions not return
anything.
2018-08-01 15:17:13 -07:00
Alex Hoppen
d920a664be [sourcekitd] Add support for transferring raw data
We will need this to transfer a binary encoded syntax tree in the future
2018-08-01 14:34:30 -07:00
swift-ci
89b25738be Merge remote-tracking branch 'origin/master' into master-next 2018-08-01 12:29:14 -07:00
Alex Hoppen
a38d7c525e [SourceKit] Fix compile error on Ubuntu 14 2018-08-01 10:30:16 -07:00
swift-ci
506def6dc1 Merge remote-tracking branch 'origin/master' into master-next 2018-08-01 09:49:54 -07:00
Rintaro Ishizaki
930d4342cd [SourceKit] Defensive guard for invalid offset and length in edit request
Otherwise, hits assertion, or crashes in no-assertion build.

Added 'EditableTextBuffer::getSize()' for getting size after previous updates
without actually applying them.

rdar://problem/34206143
2018-08-01 20:02:15 +09:00
Alex Hoppen
b48f740712 [SourceKit] Serialize the syntax tree in the EditorConsumer
This will allow us to switch to a more efficient serialization format in
the future.
2018-07-31 13:51:16 -07:00
swift-ci
287ce7bbbd Merge remote-tracking branch 'origin/master' into master-next 2018-07-30 15:10:04 -07:00
Alex Hoppen
749a13a6fe [libSyntax] Remove the C++ SyntaxClassifier
The recommended way forward is to use the SyntaxClassifier on the Swift
side.

By removing the C++ SyntaxClassifier, we can also eliminate the
-force-libsyntax-based-processing option that was used to bootstrap
incremental parsing and would generate the syntax map from a syntax
tree.
2018-07-30 09:26:18 -07:00
swift-ci
d7e358f80f Merge remote-tracking branch 'origin/master' into master-next 2018-07-25 17:49:26 -07:00
Alex Hoppen
4d16a64651 Merge pull request #18238 from ahoppen/01b-fix-compile-error
[SourceKit] Fix compile error
2018-07-25 17:46:00 -07:00
Alex Hoppen
7ad81a88b9 [SourceKit] Fix compile error 2018-07-25 16:31:40 -07:00
swift-ci
879a10aa57 Merge remote-tracking branch 'origin/master' into master-next 2018-07-25 15:29:05 -07:00
Alex Hoppen
c8fc286428 Merge pull request #18152 from ahoppen/01-incr-tree-transfer
[libSyntax] Incremental syntax tree transfer
2018-07-25 15:26:57 -07:00
Bob Wilson
e7478ea91f Merge pull request #18178 from bob-wilson/master-next-r334221
[master-next] Update some recent code for LLVM r334221
2018-07-24 00:11:13 -07:00
Bob Wilson
965c47ccb3 [master-next] Update some recent code for LLVM r334221
The LLVM change happened a while ago, but some new uses of the old
F_RW flag were introduced recently in 57ccdd89b6.
2018-07-23 20:52:35 -07:00
swift-ci
685b007c3f Merge remote-tracking branch 'origin/master' into master-next 2018-07-23 20:39:45 -07:00
John McCall
7a4aeed570 Implement generalized accessors using yield-once coroutines.
For now, the accessors have been underscored as `_read` and `_modify`.
I'll prepare an evolution proposal for this feature which should allow
us to remove the underscores or, y'know, rename them to `purple` and
`lettuce`.

`_read` accessors do not make any effort yet to avoid copying the
value being yielded.  I'll work on it in follow-up patches.

Opaque accesses to properties and subscripts defined with `_modify`
accessors will use an inefficient `materializeForSet` pattern that
materializes the value to a temporary instead of accessing it in-place.
That will be fixed by migrating to `modify` over `materializeForSet`,
which is next up after the `read` optimizations.

SIL ownership verification doesn't pass yet for the test cases here
because of a general fault in SILGen where borrows can outlive their
borrowed value due to being cleaned up on the general cleanup stack
when the borrowed value is cleaned up on the formal-access stack.
Michael, Andy, and I discussed various ways to fix this, but it seems
clear to me that it's not in any way specific to coroutine accesses.

rdar://35399664
2018-07-23 18:59:58 -04:00
Alex Hoppen
57196f8902 [libSyntax] Enable serialization of syntax trees for incremental transfer 2018-07-23 12:32:49 -07:00
swift-ci
c0d6b81349 Merge remote-tracking branch 'origin/master' into master-next 2018-07-23 00:49:34 -07:00
Slava Pestov
5213f80e7e IDE: Remove uses of AbstractFunctionDecl::getParameterLists() 2018-07-22 20:56:56 -07:00
swift-ci
770b29634b Merge remote-tracking branch 'origin/master' into master-next 2018-07-19 14:50:16 -07:00
Alex Hoppen
c8226d1507 [libSyntax] Make a typealias to unsigned to represent SyntaxNodeIds 2018-07-19 13:57:08 -07:00