Commit Graph

3682 Commits

Author SHA1 Message Date
swift-ci
4d15dc1dad Merge remote-tracking branch 'origin/master' into master-next 2018-06-29 17:29:11 -07:00
Slava Pestov
1a8a70e3f0 Merge pull request #17643 from DougGregor/evaluator-indirect-evaluation
[Evaluator] Separate formation of a request from evaluation of that request
2018-06-29 17:09:34 -07:00
Xi Ge
967beefffc swift-api-digester: teach the tool to detect member variables change to global ones. rdar://41658300 2018-06-29 16:33:22 -07:00
Doug Gregor
a6f46584ec [Evaluator] Indirect evaluation of uncached requests through a separate table.
The bundling of the form of a request (e.g., the storage that makes up a request)
with the function that evaluates the request value requires us to perform
ad hoc indirection to address the AST —> Sema layering violation. For
example, ClassDecl::getSuperclass() calls through the LazyResolver (when
available) to form the appropriate request. This means that we cannot
use the the request-evaluator’s cache when LazyResolver is null, forcing
all cached state into the AST.

Provide the evaluator with a zone-based registration system, where each
request “zone” (e.g., the type checker’s requests) registers
callbacks to evaluate each kind of request within that zone. The
evaluator indirects through this table of function pointers, allowing
the request classes themselves to be available at a lower level (AST)
than the functions that perform the computation when the value isn’t
in the cache (e.g., Sema).

We are not taking advantage of the indirection yet; that’ll come in a
follow-up commit.
2018-06-29 15:41:55 -07:00
Bob Wilson
b254041121 Merge remote-tracking branch 'origin/master' into master-next 2018-06-28 23:23:29 -07:00
Alex Hoppen
2b7e14824a Merge pull request #17612 from ahoppen/001-editor-consumer-options
[SourceKit] Move all options into a common options struct
2018-06-28 21:38:06 -07:00
Alex Hoppen
6e12a634a1 [SourceKit] Move all options into a common options struct
With more options coming for incremental syntax parsing, the list of
arguments will grow way to large and unhandy, so just extract them into
one common struct.
2018-06-28 20:26:05 -07:00
Bob Wilson
8025e37fb5 Merge pull request #17507 from bob-wilson/pr16362-fix-followup
[master-next] NFC: Rename variable from PR #17494
2018-06-26 22:49:27 -07:00
swift-ci
73dfb54717 Merge remote-tracking branch 'origin/master' into master-next 2018-06-26 18:10:02 -07:00
swift-ci
1e5155d08b Merge pull request #17509 from DougGregor/mangle-generic-typealias 2018-06-26 18:04:32 -07:00
swift-ci
6137bc2142 Merge remote-tracking branch 'origin/master' into master-next 2018-06-26 15:09:25 -07:00
swift-ci
18fc42d6c6 Merge pull request #17527 from DougGregor/swift-api-dump-fixes 2018-06-26 14:55:04 -07:00
swift-ci
0111c9498a Merge remote-tracking branch 'origin/master' into master-next 2018-06-26 14:29:38 -07:00
Doug Gregor
7a6ad36c7f [lldb-moduleimport-test] Add support for -resource-dir option. 2018-06-26 13:48:13 -07:00
Doug Gregor
b41e98ef02 [swift-ide-test] Emit a diagnostic if we can't find the module to print.
Fixes rdar://problem/41048812.
2018-06-26 13:35:30 -07:00
Argyrios Kyrtzidis
4179ceb4f9 Add a comment for the AddSwiftSourceKit.cmake change 2018-06-26 10:57:01 -07:00
Argyrios Kyrtzidis
7f6afa0357 [SourceKit/CMake] Make sure the XPC service executable isn't linked with an absolute build directory rpath
rdar://40462455
2018-06-26 10:47:11 -07:00
Bob Wilson
397ace0ac6 [master-next] NFC: Rename variable from PR #17494
Jordan reviewed my change and suggested using a better variable name
to avoid potential confusion between "args" and "argv".
2018-06-25 23:43:13 -07:00
Bob Wilson
ad9098fca0 [master-next] Fix up the driver's use of PROGRAM_START after PR #16362
On the master-next branch, the InitLLVM class used by the PROGRAM_START
macro can modify the argc/argv values (currently only on Windows).
Expanding response files before initializing the stack trace also modifies
the arguments so use a separate SmallVector for each copy of the argument
vector.
2018-06-25 17:01:01 -07:00
Bob Wilson
44712233c3 Merge remote-tracking branch 'origin/master' into master-next 2018-06-21 23:36:03 -07:00
Jordan Rose
7d8e40b0bb Merge pull request #16362 from dabelknap/frontend_responsefile
Wrap Command Line Arguments in a Response File if System Limits are Exceeded

https://bugs.swift.org/browse/SR-4517
2018-06-21 16:31:20 -07:00
Austin Belknap
be229fc173 Use subCommandArgs instead of argv within subcommand if block. 2018-06-20 15:24:37 -07:00
swift-ci
c034f16f39 Merge remote-tracking branch 'origin/master' into master-next 2018-06-20 14:50:48 -07:00
Michael Gottesman
cdbaf9074f [demangle] Add a new tool called swift-demangle-yamldump.
This is a separate tool so we can use all of LLVM without worrying about
creating a dependency from the demangler on LLVM's libsupport.

I am going to use it to fix cmpcodesize for the new mangling by eliminating
cmpcodesize's usage of regex to classify symbols. Instead, we can just read in
the yaml version of the symbol trees for each demangled node and process that
instead.

rdar://41146023
2018-06-20 13:47:25 -07:00
swift-ci
6ea84f6406 Merge remote-tracking branch 'origin/master' into master-next 2018-06-19 10:49:58 -07:00
Ben Langmuir
0b795c19db Merge pull request #17241 from benlangmuir/pop-less
[sourcekit] Do not dequeue AST consumers expecting newer snapshots
2018-06-19 10:33:06 -07:00
swift-ci
2da98ed3ea Merge remote-tracking branch 'origin/master' into master-next 2018-06-18 14:49:03 -07:00
Vedant Kumar
d910e5a5c2 [SourceKit] Disable expensive SIL options (#17306)
Disable the sanitizers and code coverage when building a swift
invocation for the purpose of collecting diagnostics.

This should speed up diagnostic generation and reduce exposure to
compiler bugs.

rdar://40955900
2018-06-18 14:43:27 -07:00
Ben Langmuir
68b829a065 [sourcekit] Do not dequeue AST consumers expecting newer snapshots
When adding to the AST consumer queue, keep track of the snapshots
expected and only run such AST consumers when a new enough AST is built.
Progress is ensured because we always run the AST consumer that
triggered the build.

This prevents cases where enqueuing a consumer during an AST build has
different behaviour than enqueuing it after the AST has finished.

rdar://40340631
2018-06-18 13:01:23 -07:00
swift-ci
2a0e83dc0d Merge remote-tracking branch 'origin/master' into master-next 2018-06-18 11:00:19 -07:00
Fred Riss
ec1ca50d8a Change the component of lldb-moduleimport-test so that it gets installed in toolchians
rdar://problem/39112397
2018-06-17 18:46:55 -07:00
swift-ci
83abedeaed Merge remote-tracking branch 'origin/master' into master-next 2018-06-15 15:29:02 -07:00
swift-ci
a700e235a6 Merge pull request #17191 from CodaFi/tuplet-rudiments 2018-06-15 15:19:21 -07:00
swift-ci
3227e07d18 Merge remote-tracking branch 'origin/master' into master-next 2018-06-15 13:29:06 -07:00
Xi Ge
42127d9f68 swift-api-digester: emit the diff items for changing from RawRepresentable struct to a type alias of raw type.
related: rdar://39498127
2018-06-15 11:55:09 -07:00
Robert Widmann
f208886a32 [Experiment] Drop null input type check 2018-06-15 11:48:36 -07:00
Bob Wilson
5df3d1f100 Merge remote-tracking branch 'origin/master' into master-next 2018-06-14 20:51:48 -07:00
John McCall
e97fde0a32 Merge pull request #17212 from rjmccall/generalize-accessor-kinds
Rename accessor kinds from IsGetter -> IsGet, etc.
2018-06-14 18:06:39 -04:00
John McCall
9022b5152f Rename accessor kinds from IsGetter -> IsGet, etc.
Introduce some metaprogramming of accessors and generally prepare
for storing less-structured accessor lists.

NFC except for a change to the serialization format.
2018-06-14 17:08:55 -04:00
Jordan Rose
fb8c815c80 [SourceKit] Enable PrettyStackTrace printing (#17205)
In particular, this will result in PrettyStackTrace messages being
included in crash logs when SourceKit crashes on Apple platforms.
2018-06-14 13:54:58 -07:00
Robert Widmann
1beb75583a Push FunctionTypeRepr Input Invariants Up
Validation of the input side of FunctionTypeRepr was previously being done in Sema because of expression folding.  If we instead push the invariant that the input TypeRepr should always be a TupleTypeRepr into the AST a number of nice cleanups fall out:

- The SIL Parser no longer accepts Swift 2-style type declarations
-  Parse is more cleanly able to reject invalid FunctionTypeReprs
- Clients of the AST can be assured the input type is always a TupleType so we can flush Swift 2 hacks
2018-06-13 18:41:20 -07:00
swift-ci
8bdb69ca68 Merge remote-tracking branch 'origin/master' into master-next 2018-06-13 12:49:07 -07:00
Ben Langmuir
4b48f4d6fb Merge pull request #17145 from benlangmuir/notification-test-non-determinism
[sourcekit] Fix non-deterministic failure in CompileNotifications tests
2018-06-13 12:34:17 -07:00
Ben Langmuir
8902562e24 [sourcekit] Fix a race in sourcekitdInProc's notification handling
Setting the notification handler was racing with calling it; now both
happen on the same queue. Only affected the in-process sourcekitd.
2018-06-13 11:32:18 -07:00
Ben Langmuir
a88c73fe60 [sourcekit] Fix non-deterministic failure in CompileNotifications tests
This is a test-only change except for the introduction of a new request
that is only used by tests.

Our notifications are dispatched in the XPC event handler, which is not
synchronized with replies to explicit XPC send_message_with_reply calls.
This is fine for most users of sourcekitd, since the notifications are
already enqueued on the client side, but for testing we need a way to
guarantee that all notifications are passed to the client-side handler
before we exit. This commit introduces a new request for testing that
triggers a notification, allowing the client to wait on that
notification to ensure all previously posted notifications have been
handled.

Note: the non-deterministic test failures can be triggered by adding a
sleep of ~100 ms in the event handler before the notification is
dispatched to the main queue.

rdar://40311995
2018-06-13 11:32:18 -07:00
swift-ci
76c31aff88 Merge remote-tracking branch 'origin/master' into master-next 2018-06-12 19:09:17 -07:00
Austin Belknap
8e6abee651 Pass ArrayRefs by value. 2018-06-12 18:00:30 -07:00
Bob Wilson
c3e02955bb [master-next] Adjust for VersionTuple moving from clang to llvm.
LLVM r334399 (and related Clang changes) moved clang::VersionTuple to
llvm::VersionTuple. Update Swift to match.

Patch by Jason Molenda.
rdar://problem/41025046
2018-06-12 16:44:11 -07:00
Bob Wilson
e1cbc560f9 [master-next] More changes to adapt to new LLVM flags in r334221
My previous change for this issue (033b884de6) did not fix all the
affected code. This gets the rest of them. Thanks for Jason Molenda
for helping with this. rdar://problem/41025365
2018-06-12 14:55:40 -07:00
Adrian Prantl
bab3000069 Use depth and index to lookup type metadata artificial variables
instead of using name and decl context.

The advantages of this approach are three-fold:
- This is necessary to support inlined generic functions.
- We can retire the debugger-specific type name manfgling mode for archetypes.
- This saves 270kb of debug information in the x86_64 libSwiftCore.dylib alone.

<rdar://problem/38306256>
2018-06-12 12:48:15 -07:00