Commit Graph

3682 Commits

Author SHA1 Message Date
Alex Hoppen
8310056714 Merge pull request #18887 from ahoppen/exp-growth-stream
[SourceKit] Use an exponentially growing appending binary stream to serialize the syntax tree
2018-08-24 08:13:27 -07:00
Alex Hoppen
c50729badf [swiftSyntax] Remove validate methods
The methods were never executed because DEBUG was never defined in
normal builds and the only way to create nodes is through generated
factory methods which provide the same safety `validate` was supposed to
ensure at the interface level.
2018-08-23 09:12:14 -07:00
Alex Hoppen
49f2e14094 [swiftBasic] Use a SmallVector as the underlying storage for ExponentialGrowthAppendingBinaryByteStream 2018-08-23 09:00:27 -07:00
Alex Hoppen
491b11c73c [SourceKit] Use the exponential growth binary stream to write the syntax tree 2018-08-23 08:14:02 -07:00
Alex Hoppen
34a89d45e2 [libSyntax] Make the ByteTree format forwards-compatible 2018-08-22 12:07:57 -07:00
Saleem Abdulrasool
df208b370c build: honour the libdispatch build type
When configuring libdispatch as part of the swift build on Linux with SourceKit
enabled, we would default to a release build.  However, that results in known
leaks being reported with LSAN when building with a debug standard library.
Pass along the `LIBDISPATCH_BUILD_TYPE` into the CMake build and map that to the
CMAKE_BUILD_TYPE for the project.
2018-08-22 11:16:03 -07:00
Alex Hoppen
7720f55688 Merge pull request #18735 from ahoppen/incremental-serialization
[libSyntax] Add support for incremental (de)serialisation of ByteTree syntax trees
2018-08-21 20:28:29 -07:00
Alex Hoppen
b735673e97 Merge pull request #18848 from ahoppen/remove-reuse-regions
[SourceKit] Remove option to regions reused as part of incremental parsing
2018-08-21 13:52:11 -07:00
Alex Hoppen
da7cdbb122 [libSyntax] Add test cases for ByteTree serialization and deserialization 2018-08-21 10:55:15 -07:00
Alex Hoppen
9eb0208bb5 [libSyntax] Add support for incremental serialization of ByteTrees 2018-08-21 10:55:15 -07:00
Alex Hoppen
114b3aef1b [swiftSyntax] Add support for deserialising incremental ByteTrees 2018-08-21 09:08:09 -07:00
Xi Ge
c4ff67957c cmake/sourcekitd: disable SwiftLang on linux. rdar://43165161 2018-08-20 18:03:03 -07:00
Xi Ge
1b601f83fe swift-module-differ: refactor node definition to a separate file. NFC
The original implementation file contains both nodes definition and detection
logics. This patch splits the two parts.
2018-08-20 13:16:57 -07:00
Alex Hoppen
750e7e8f73 [SourceKit] Remove option to regions reused as part of incremental parsing 2018-08-20 11:15:50 -07:00
Xi Ge
492a73c8e2 Merge branch 'apple-master' into api-digester-match-kind 2018-08-17 17:48:09 -07:00
Xi Ge
9138b0228b swift-api-digester: detect type to type alias change up-front to remove bogus dignostics. rdar://43425867 2018-08-17 17:46:26 -07:00
Xi Ge
697ba85dda swift-api-digester: add a new enum class describing why two SDKNodes are matched, NFC. 2018-08-17 17:32:55 -07:00
Xi Ge
37a7dce793 remove dead code.NFC 2018-08-17 17:00:21 -07:00
swift-ci
eafbf43365 Merge pull request #18807 from eeckstein/fix-non-determinism 2018-08-17 16:58:18 -07:00
Xi Ge
c069090afe Merge pull request #18788 from brentdax/indigestion
Add some proper diagnostics to the API digester
2018-08-17 15:55:51 -07:00
Erik Eckstein
9a71a0b533 SourceKit: fix a missing cmake dependency of swiftLang on Darwin 2018-08-17 15:47:23 -07:00
Jordan Rose
537954fb93 [AST] Rename several DeclContext methods to be clearer and shorter (#18798)
- getAsDeclOrDeclExtensionContext -> getAsDecl

This is basically the same as a dyn_cast, so it should use a 'getAs'
name like TypeBase does.

- getAsNominalTypeOrNominalTypeExtensionContext -> getSelfNominalTypeDecl
- getAsClassOrClassExtensionContext -> getSelfClassDecl
- getAsEnumOrEnumExtensionContext -> getSelfEnumDecl
- getAsStructOrStructExtensionContext -> getSelfStructDecl
- getAsProtocolOrProtocolExtensionContext -> getSelfProtocolDecl
- getAsTypeOrTypeExtensionContext -> getSelfTypeDecl (private)

These do /not/ return some form of 'this'; instead, they get the
extended types when 'this' is an extension. They started off life with
'is' names, which makes sense, but changed to this at some point.  The
names I went with match up with getSelfInterfaceType and
getSelfTypeInContext, even though strictly speaking they're closer to
what getDeclaredInterfaceType does. But it didn't seem right to claim
that an extension "declares" the ClassDecl here.

- getAsProtocolExtensionContext -> getExtendedProtocolDecl

Like the above, this didn't return the ExtensionDecl; it returned its
extended type.

This entire commit is a mechanical change: find-and-replace, followed
by manual reformatted but no code changes.
2018-08-17 14:05:24 -07:00
Brent Royal-Gordon
004ada98bc Add errors for other invalid strings in digester
Specifically, TypeAttrKinds, DeclAttrKinds, and DeclKinds.
2018-08-17 04:16:20 -07:00
Brent Royal-Gordon
8a192eaaf7 Refactor away some digester diagnostic boilerplate 2018-08-17 00:29:21 -07:00
Brent Royal-Gordon
88ac6f11a2 Add error for invalid SDKNodeKind 2018-08-17 00:27:38 -07:00
Brent Royal-Gordon
ec87277e56 Add error for unknown API KeyKind 2018-08-16 23:52:06 -07:00
Brent Royal-Gordon
fbe05ea817 Use swift::SourceManager/DiagnosticEngine 2018-08-16 23:46:35 -07:00
Brent Royal-Gordon
55d54923d4 [NFC] Move SourceMgr into SDKContext 2018-08-16 19:24:31 -07:00
Xi Ge
bc79f3011a swift-api-digester: diagnose removal/addition of dynamic attribute under abi mode. 2018-08-16 16:50:10 -07:00
Xi Ge
2152d0bde0 swift-api-digester: remove some dead code. NFC 2018-08-16 16:22:53 -07:00
Xi Ge
11cdd41bf0 swift-api-digester: simplify some code. NFC. 2018-08-16 13:16:57 -07:00
Xi Ge
07e002ce5e swift-api-digester: diagnose generic signature change for any declarations. 2018-08-16 11:32:43 -07:00
Xi Ge
7f2fff6cac Merge pull request #18739 from nkcsgexi/abi-flag
swift-api-digester: diagnose the addition and removal of @objc, @_fixed_layout and @_frozen under ABI mode.
2018-08-15 19:03:06 -07:00
Xi Ge
17b9a4edf9 swift-api-digester: diagnose the addition and removal of @objc, @_fixed_layout and @_frozen under ABI mode. 2018-08-15 17:49:01 -07:00
Alex Hoppen
e8dc5055d6 Merge pull request #18715 from ahoppen/gen-tokenkinds
[libSyntax] Generate TokenKinds.def from gyb_syntax_support
2018-08-15 13:27:43 -07:00
Xi Ge
2ac57cf948 swift-api-digester: add a flag to diagnostics indicating whether it's abi-specific. 2018-08-15 12:02:22 -07:00
Alex Hoppen
e9e7d5cf68 [libSyntax] Generate TokenKinds.def from gyb_syntax_support 2018-08-15 11:11:27 -07:00
Alex Hoppen
8177868000 Merge pull request #18673 from ahoppen/swift-syntax-xcode
[swiftSyntax] Fix issue where swiftc was not found when swiftSyntax is build via Xcode
2018-08-15 11:09:17 -07:00
Alex Hoppen
353473327a [swiftSyntax] Fix issue where swiftc was not found when swiftSyntax is build via Xcode 2018-08-14 17:16:01 -07:00
Xi Ge
b9703c9ef0 cmake/sourcekitd: teach SwiftLang to depend on the actual framework. (#18713)
Tentatively fixing rdar://43165161
2018-08-14 15:51:49 -07:00
Alex Hoppen
bc46175cde Merge pull request #18706 from ahoppen/box-absolute-position
[swiftSyntax] Make AbsolutePosition a value type
2018-08-14 14:11:15 -07:00
Xi Ge
45f9e4437d swift-api-digester: add a new flag to indicate whether the tool is checking ABI stability. (#18707)
When this flag turns on, all type nodes and generic signatures are canonicalized.
2018-08-14 14:10:59 -07:00
Alex Hoppen
7f8e46c7e9 [swiftSyntax] Make AbsolutePosition a value type
AbsolutePosition had value semantics anyway, the only reason it was a
reference type was so that we can use it in AtomicCache. But that can be
worked around by boxing it into a reference type.
2018-08-14 11:51:05 -07:00
Alex Hoppen
d962c8394b Merge pull request #18690 from ahoppen/syntax-tree-as-bytetree
[libSyntax] Support serializing the syntax tree as ByteTree
2018-08-14 11:11:49 -07:00
Xi Ge
5ea6eae2a3 swift-api-digester: include generic signature printing in the module dump. (#18686) 2018-08-14 08:01:23 -07:00
Slava Pestov
31a570d53c AST: Replace TypeBase::getRValueInstanceType() with getMetatypeInstanceType()
That is, don't look through InOutType anymore, and update callers to
call getInOutObjectType() as well (or not, where it was obvious to me
that InOutType could not appear).

This surfaces more remaining uses of getInOutObjectType() directly.
2018-08-13 21:13:10 -07:00
Alex Hoppen
4cda5cbeb0 [libSyntax] Support serializing the syntax tree as ByteTree 2018-08-13 20:03:47 -07:00
Alex Hoppen
4369b36f21 Merge pull request #18497 from ahoppen/bytetree-infrastructure
[libSyntax] Add a binary serialization format for syntax trees
2018-08-13 15:41:30 -07:00
Saleem Abdulrasool
061ecc48f3 Merge pull request #18638 from compnerd/SwiftSyntax-port
SwiftSyntax: some basic changes needed for Linux support
2018-08-13 12:08:32 -07:00
Ted Kremenek
fb6b24f1c1 Revert "build: extract libdispatch build for swift" 2018-08-13 10:06:45 -07:00