Commit Graph

3682 Commits

Author SHA1 Message Date
Xi Ge
08c8cf14e5 swift-module-digester: diagnose adding/removing protocol conformances as API breakages. 2018-09-20 15:24:19 -07:00
Xi Ge
f1b43ab66e swift-module-digester: diagnose removing default argument as API breakage. 2018-09-19 17:40:00 -07:00
Xi Ge
b2a159dbf9 swift-module-digester: diagnose adding variables with fixed binary order.
Removing these variables should be detected as API breakages already.
2018-09-19 13:17:08 -07:00
Xi Ge
971755d5a3 swift-module-digester: under ABI checking mode, include private decls with fixed binary order. 2018-09-19 12:10:00 -07:00
Xi Ge
05e15927a3 swift-module-digester: diagnose reordering of members in a fixed layout type under ABI mode. 2018-09-19 09:36:09 -07:00
Xi Ge
0eb756f2f4 swift-module-digester: serialize whether a declaration is implicit. 2018-09-18 12:59:16 -07:00
Ben Langmuir
a8d549326a [sourcekit] Fix a race between AST processing and reopening a document
When a document is opened twice without closing it we re-initialize its
internal data. Make sure we don't race with code that accesses that data.

Found by TSan!
2018-09-13 14:39:46 -07:00
Xi Ge
c0d52fd70e swift-ide-test: input complete test is for REPL. 2018-09-12 12:42:41 -07:00
Jordan Rose
37ec248823 Add ModuleDecl::ReverseFullNameIterator
Package up the logic that generates a full Clang module name, so that
(a) we don't have to deal with clang::Module in quite as many places
in the /Swift/ compiler, and (b) we can avoid the cost of a temporary
string in a few places.

The main places where this is /not/ adopted is where we don't just
want to know the parent module name, but actually the module itself.
This is mostly indexing-related queries, which use the very similar
ModuleEntity class also defined in Module.h. I didn't quite see an
obvious way to unify these, but that might be where we want to go.

No functionality change.
2018-09-06 19:53:59 -07:00
Slava Pestov
8801aa67d3 Merge pull request #19133 from slavapestov/access-level-cleanup
Access level cleanup
2018-09-06 16:46:40 -07:00
Xi Ge
b4356d4f93 Merge pull request #19104 from nkcsgexi/parser-laziness
Parser: lazily parse members in extension decls.
2018-09-06 15:24:17 -07:00
Saleem Abdulrasool
9fc6b29e90 tools: remove swift-test-utils
This seems to have been introduced for SwiftSyntax which is no longer in
the tree.  No additional dependencies exist.  Clean up the dead code
which prevents cross-compilation of just the host tools.
2018-09-05 20:20:24 -07:00
Xi Ge
24b0eac9a4 Parser: parse members in extension decls incrementally. 2018-09-05 17:00:39 -07:00
Slava Pestov
c51f884879 SourceKit: Just always call getFormalAccess() 2018-09-05 16:51:20 -07:00
Saleem Abdulrasool
5931d96d96 build: repair the swift component installation for cross-compilation
When compiling the swift compiler from Linux to Windows, the
CMAKE_EXECUTABLE_SUFFIX is set to `.exe`.  The tool symlinks and the tools are
generated with the suffix, however, the installation does not honour the suffix,
failing to install the component.
2018-09-05 14:29:40 -07:00
Davide Italiano
1289b49615 [Parse] Store local typealiases, they matter for type reconstruction.
Fixes <rdar://problem/42446693>

(Thanks to Jordan for pointing out the solution)
2018-09-04 17:00:01 -07:00
Mishal Shah
76aa3edd10 Merge pull request #19061 from ahoppen/swiftsyntax-new-repo
[master] Move SwiftSyntax to its own repository
2018-08-30 14:24:18 -07:00
Jordan Rose
2f6b4cdbe8 Merge pull request #19054 from jrose-apple/nocturnal
Honor #sourceLocation filenames in several more places
2018-08-30 13:02:50 -07:00
Alex Hoppen
3801bb0e42 [SwiftSyntax] Remove SwiftSyntax from the main swift repository
It has moved to its own repository at https://github.com/apple/swift-syntax
2018-08-30 11:46:22 -07:00
Brent Royal-Gordon
4d7046f95a [SourceKitSwiftLang] Avoid call with null this
If an imported Objective-C method had no owning clang module, passCursorInfoForDecl() would call clang::Module::getFullModuleName() on a null instance. The current implementation of this method happens to terminate its loop immediately and return an empty string, but it’s best not to depend on this. Fixes a UBSan error in SourceKit/Mixed/cursor_mixed_header.swift.
2018-08-29 22:53:40 -07:00
Brent Royal-Gordon
461a213441 [SourceKit] Perform unaligned access safely
CompactArrayReader has a bad habit of doing type-punning in ways that could cause unaligned memory accesses. 21 tests trigger a UBSan assertion because of this. Use memcpy instead to avoid the issue.
2018-08-29 22:53:40 -07:00
swift-ci
6e16e29aa1 Merge pull request #19024 from adrian-prantl/40241256 2018-08-29 17:28:43 -07:00
Alex Hoppen
5f341999e5 Merge pull request #18905 from ahoppen/semantic-version-number
[libSyntax] Make the ByteTree protocol version consist of a major and minor component
2018-08-29 16:40:08 -07:00
Alex Hoppen
49d0d5b7a3 [libSyntax] Make the ByteTree protocol version consist of a major and minor component 2018-08-29 13:40:50 -07:00
Jordan Rose
63cd1258ea Stop using SourceManager::getBufferIdentifierForLoc to find buffer IDs
The right way is findBufferContainingLoc. getBufferIdentifierForLoc is
both slower and wrong in the presence of #sourceLocation.

I couldn't come up with a test for the change in IDE/Utils.cpp because
refactoring still seems to be broken around #sourceLocation. I'll file
bugs for that.
2018-08-29 11:46:41 -07:00
Jordan Rose
9a794531c7 [SourceKit] Honor #sourceLocation in reporting diagnostics 2018-08-29 11:46:41 -07:00
Jordan Rose
c06dc63654 [IDE] Honor #sourceLocation in swift-ide-test's comment printing 2018-08-29 11:46:41 -07:00
Xi Ge
9f7e2f7610 swift-syntax-test: teach the test driver to accept RequestEvaluatorGraphVizPath. 2018-08-29 11:13:42 -07:00
Xi Ge
30e73ec995 swift-ide-test: teach the test driver to accept RequestEvaluatorGraphVizPath. 2018-08-29 11:13:22 -07:00
Alex Hoppen
f50ddf9c39 Merge pull request #18888 from ahoppen/swiftsyntax-performance-improvments
[swiftSyntax] Performance improvements for deserialising ByteTrees
2018-08-29 08:54:17 -07:00
Adrian Prantl
97cbd3b1cf Deserialize Swift compatibility version in CompilerInvocation::loadFromSerializedAST()
LLDB needs the -swift-version because the -D__swift__ macro affects
how Clang modules are built. This currently has the really odd effect
that when debugging a Swift program that is not using the very latest
Swift version, the first "po" takes several seconds, because the
module cache needs to be rebuilt.

rdar://problem/40241256
2018-08-28 13:04:27 -07:00
Jordan Rose
e4e4f3e4f5 Break Driver's dep on Frontend: make createCompilerInvocation uglier
But not even that much uglier; at all three call sites this will save
an allocation, and for the most important one (SourceKit) we can now
avoid creating a temporary CompilerInvocation just to copy into a
longer-lived one.

With this change, Driver no longer depends on Frontend, which means...
well, slightly faster builds of the compiler itself, but not much
else.
2018-08-27 20:47:58 -07:00
John McCall
140ee562d3 Merge pull request #18840 from rjmccall/dematerializeForSet
Replace materializeForSet with the modify coroutine
2018-08-27 21:02:24 -04:00
Alex Hoppen
209ba2d691 Merge pull request #18955 from ahoppen/optimized-fixed-data
[byteTree] Write fixed sized data using an optimized form
2018-08-27 15:27:14 -07:00
Alex Hoppen
d41af616f1 [swiftSyntax] Store userInfo inside ByteTreeReader as an UnsafePointer 2018-08-27 15:18:06 -07:00
Alex Hoppen
94731828c1 [swiftSyntax] Pass userInfo as UnsafePointer 2018-08-27 15:18:06 -07:00
Alex Hoppen
93f77e1f45 [swiftSyntax] Make ByteTreeReader a struct 2018-08-27 15:18:06 -07:00
Alex Hoppen
708d88f181 [swiftSyntax] Make ByteTreeObjectReader a struct 2018-08-27 14:32:02 -07:00
Alex Hoppen
9af44314dd [swiftSyntax] Pass ByteTreeObjectReader as UnsafeMutablePointer 2018-08-27 14:32:02 -07:00
Alex Hoppen
c982fb2951 [swiftSyntax] Make RawSyntaxData a direct enum 2018-08-27 14:31:09 -07:00
Alex Hoppen
24207a103b [swiftSyntax] Make SourceLength a struct 2018-08-27 14:31:09 -07:00
John McCall
b80618fc80 Replace materializeForSet with the modify coroutine.
Most of this patch is just removing special cases for materializeForSet
or other fairly mechanical replacements.  Unfortunately, the rest is
still a fairly big change, and not one that can be easily split apart
because of the quite reasonable reliance on metaprogramming throughout
the compiler.  And, of course, there are a bunch of test updates that
have to be sync'ed with the actual change to code-generation.

This is SR-7134.
2018-08-27 03:24:43 -04:00
Xi Ge
47228bc17b swift-module-digester: remove unnecessary node annotations. NFC (#18975) 2018-08-24 21:44:40 -07:00
Xi Ge
6adac7a1e3 DiagnosticEngine: require clients to explicitly specify source locations when emitting diagnostics. NFC (#18962) 2018-08-24 16:14:16 -07:00
Alex Hoppen
33d86d5cb6 [byteTree] Write fixed sized data using an optimized form
If we know the size of a type at compile time (like we do for all the
integer types), it is cheaper to assign the data buffer directly instead
of using a memcpy.
2018-08-24 15:27:23 -07:00
swift-ci
4d88cd77cf Merge pull request #18921 from ahoppen/remove-swiftsyntax-validate 2018-08-24 14:16:44 -07:00
Robert Widmann
832307c30a Merge pull request #17764 from CodaFi/irreconcilable-spatial-differences
[Space Engine] Remove the @_downgrade_exhaustivity_check hack
2018-08-24 14:00:33 -07:00
Xi Ge
e4388af6be swift-module-digester: refactor the ABI/API diagnostics to use DiagnosticEngine. NFC (#18957)
Before this patch, we used to define tooling-specific diagnostics. With adding more
checking logics, we found this mechanism hard to extend. This patch
eliminates the home-made diagnostics model to use the one from compiler, which provides
several benefits: less boiler-templates, better integration with DiagnosticConsumer,
and easy ordering of detected issues.
2018-08-24 13:11:32 -07:00
Robert Widmann
2fb5afb755 Remove the @_downgrade_exhaustivity_check hack
This hack was only needed for Swift 3 mode in a narrow case.  Flush it out of the compiler so we can simplify the space engine.
2018-08-24 10:54:43 -07:00
Alex Hoppen
f97d13d984 Merge pull request #18889 from ahoppen/bytetree-forward-compatible
[libSyntax] Make the ByteTree format forwards-compatible
2018-08-24 10:47:26 -07:00