Commit Graph

4362 Commits

Author SHA1 Message Date
swift-ci
c4b6f8912a Merge pull request #31003 from zoecarver/sil-parser/move-lib 2020-04-13 20:14:17 -07:00
zoecarver
6f339f800d [SIL] [Parser] Move ParserSIL into SIL library.
Move the source files from ParserSIL into the SIL library and remove the
ParserSIL library. ParsersSIL doesn't need to be its own library and this change will
simplify our builds.
2020-04-13 17:23:08 -07:00
Dario Rexin
20b2fec8a9 Merge pull request #30978 from compnerd/variants
build: duplicate and rename the `_add_variant_*` functions
2020-04-13 13:55:47 -07:00
Nathan Hawes
b3b7aa8ecf Merge pull request #30964 from nathawes/syntactic-rename-for-callAsFunction
[IDE][Refactoring] Handle 'callAsFunction' specially in syntactic rename
2020-04-13 11:36:53 -07:00
Slava Pestov
ab45d517d5 Merge pull request #29931 from theblixguy/fix/SR-12178
[Typechecker] Fix _modify for wrapped properties with observers
2020-04-12 22:11:10 -04:00
Nathan Hawes
bce68fa4e5 [IDE][Refactoring] Handle 'callAsFunction' specially in syntactic rename.
This change makes us treat it exactly as we do 'init'. We don't allow renaming the base name,
and don't fail if the basename doesn't match for calls.

Also:
  - explicit init calls/references like `MyType.init(42)` are now reported with
    'init' as a keywordBase range, rather than nothing.
  - cursor info no longer reports rename as available on init/callAsFunction
    calls without arguments, as there's nothing to rename in that case.
  - Improved detection of when a referenced function is a call (rather than
    reference) across syntactic rename, cursor-info, and indexing.

Resolves rdar://problem/60340429
2020-04-12 17:14:15 -07:00
Xi Ge
0c9c901c94 Merge pull request #30983 from nkcsgexi/61644469
ABI-checker: diagnose missing available attributes for members of extensions instead of the extensions themselves
2020-04-11 20:59:05 -07:00
Xi Ge
140a151de1 ABI-checker: diagnose missing available attributes for members of extensions instead of the extensions themselves
rdar://61644469
2020-04-11 19:00:49 -07:00
Saleem Abdulrasool
87cbb3132d build: duplicate and rename the _add_variant_* functions
This allows us to start splitting up the swift and C/C++ specific paths.
2020-04-11 13:24:31 -07:00
Rintaro Ishizaki
fbb7bfce60 Merge pull request #30929 from rintaro/sourcekit-setcustombuffer-avoidmemcopy
[SourceKit] Avoid one memcpy on potentially big sourcekit response data
2020-04-10 13:15:15 -07:00
Rintaro Ishizaki
69971af173 [SourceKit] Avoid one memcpy on potentially big sourcekit response data
A kind indicator is needed before the actual data when custom data are
storeed as xpc dictionary values. Instead of prepending the kind bit by
copying data to another buffer, let the data producers include it in the
created data.
2020-04-10 18:29:12 +00:00
Brian Gesiak
9208154c16 Document what a "subcommand" is
There are a few references to "subcommands" in the repository, but no
explanation of what they are. Beef up the docblock for
`shouldRunAsSubcommand()` to make things a little clearer.
Specifically, I'd like to make the difference between driver jobs and
driver subcomnmands clearer.

In addition, remove a double negative comment, "If we are not run as
'swift', don't do anything special", and replace it with something a
little clearer (in my opinion).
2020-04-09 16:42:15 -07:00
Suyash Srijan
84f8e41dee [Typechecker] Add an hasObservers() convenience method and simplify some code 2020-04-10 00:26:52 +01:00
Rintaro Ishizaki
4870d1c017 [SourceKit] Don't use diagnostics to indicate fast-completion
Add 'key.reusingastcontext: 1' to the response instead.
Using diagnostics can be a noise to indexing log clients.

rdar://problem/61367416
2020-04-07 16:26:00 -07:00
Rintaro Ishizaki
31e7873704 Merge pull request #30767 from rintaro/sourcekit-completion-annotateddesc-rdar60801189
[SourceKit/CodeCompletion] Add an option to emit annotated description
2020-04-07 11:33:21 -07:00
Rintaro Ishizaki
d54e70cd70 [CodeCompletion] Option to swift-ide-test to test annotated results 2020-04-07 00:50:43 -07:00
Rintaro Ishizaki
773a464e83 [CodeCompletion] Add an option to emit annotated description 2020-04-07 00:46:14 -07:00
Rintaro Ishizaki
979906cce2 [CodeCompletion] Don't manually handle Equal opeerator 2020-04-06 13:49:43 -07:00
Nathan Hawes
af0509e106 [SourceKit/DocSupport] List generic requirements from contextual where clauses in doc info request
We previously didn't report the requirements in the where clause of 'boxes'
below because it didn't have generic parameters of its own:

public struct Box<Wrapped> {
    public func boxes() -> [Box<Wrapped.Element>] where Wrapped: Sequence { fatalError() }
}

Resolves rdar://problem/60658263
2020-04-06 11:43:14 -07:00
Nathan Hawes
9f6f76308e Add method to ModuleDecl to lazily compute the underlying module for cross-import overlays
Also update code completion, indexing, interface generation and doc info to use it.
2020-04-03 16:04:32 -07:00
Saleem Abdulrasool
023380189e Merge pull request #30732 from allevato/update-deps
Add dependencies where targets depend on inclusions from unspecified targets.
2020-04-01 09:23:48 -07:00
Saleem Abdulrasool
291f432069 Merge pull request #30561 from 3405691582/OpenBSD_Iconv_AdditionalIncludePath
[tools] Add include path for iconv on OpenBSD.
2020-03-31 16:14:23 -07:00
tbkka
efa1a01a5a Fix test crash in swift-reflection-dump rdar://60966825 (#30737)
Return a 32-bit or 64-bit ptrauth mask appropriate for the target.  This should correct a crash when a 64-bit swift-reflection-dump executable was used to inspect a 32-bit target binary.

Resolves rdar://60966825
2020-03-31 15:14:52 -07:00
Tony Allevato
5284cb6f99 Add dependencies where targets depend on inclusions from unspecified targets.
A follow-up PR adds a flag to control an inline namespace that allows
symbols in libDemangling to be distinguished between the runtime and
the compiler. These dependencies ensure that the flag is plumbed
through for inclusions of Demangling headers that aren't already
covered by existing `target_link_libraries`.
2020-03-31 09:19:41 -07:00
Robert Widmann
58e63f7185 Merge pull request #28313 from owenv/verifier-consumer
[DiagnosticVerifier] Make DiagnosticVerifier a DiagnosticConsumer
2020-03-30 17:46:30 -07:00
Owen Voorhees
465bab002f [DiagnosticVerifier] Make Diagnostic Verifier a DiagnosticConsumer subclass
Update DiagnosticVerifier to respect color flags

Improve DiagnosticVerifier test coverage

verifier updates to support new llvm stable branch
2020-03-28 12:29:53 -07:00
Rintaro Ishizaki
49d72d77d1 Merge pull request #30653 from rintaro/sourcekit-completion-optionalsort-rdar60799439
[SourceKit] Add an option to sort completion result
2020-03-27 09:26:56 -07:00
Rintaro Ishizaki
429467288e [SourceKit] Add an option to sort completion result
Defaults to false

rdar://problem/60799439
2020-03-26 17:39:36 -07:00
Nathan Hawes
4ccc95f9b2 Merge pull request #30636 from nathawes/cross-import-indexing
[Index] Add index support for cross import overlays.
2020-03-26 09:22:07 -07:00
Nathan Hawes
8b03b05f1d [Index] Add index support for cross import overlays.
Resolves rdar://problem/59445445
2020-03-25 10:04:41 -07:00
Rintaro Ishizaki
3841250898 Merge pull request #30515 from rintaro/sourcekit-modulevalidation-rdar59567281
[SourceKit] Save clang module validation time
2020-03-24 17:23:01 -07:00
3405691582
c9098c66f3 [tools] Add include path for iconv on OpenBSD.
swift-ide-test depends on libxml2. On OpenBSD, libxml2 is configured to
use iconv out of the box, but unlike other platforms, iconv is not part
of the base installation; it is a separate package, and so resides in
/usr/local/include. This should be added to the search path on this
platform to ensure correct header resolution.
2020-03-24 19:27:09 -04:00
Rintaro Ishizaki
22f048e637 [SourceKit] Save clang module validation time
Pass '-fbuild-session-timestamp' and '-fmodules-validate-once-per-build-sessio'
to ClangImporter so that module validation happens only once for the
SourceKit lifetime.

rdar://problem/59567281
2020-03-24 13:38:57 -07:00
Nathan Hawes
9aafadd090 [SourceKit/DocSupport] Report the required bystander modules on symbols from cross-import overlays.
Resolves rdar://problem/59446044
2020-03-24 10:31:08 -07:00
Nathan Hawes
a7e1cb3925 [SourceKit] Update cursor info to report symbols from cross-import overlays as coming from the underylying module.
Also refactor some of the interface generation cross-import support code to be
shared.
2020-03-20 21:49:51 -07:00
Robert Widmann
21cfcfef2c Merge pull request #30505 from CodaFi/ligated-legacy
[NFC] Remove the Legacy Semantic Queries Bit
2020-03-19 13:45:27 -07:00
Robert Widmann
6d60d01420 [NFC] Remove the Legacy Semantic Queries Bit
Clients that wish to avoid semantic requests should decline to register
those requests.
2020-03-19 11:04:12 -07:00
martinboehme
fa7155073d Don't import C++ class members that are protected or private (#30233)
* Don't import C++ class members that are protected or private.

We omit protected members in addition to private members because Swift
structs can't inherit from C++ classes, so there's effectively no way to
access them.

* Check access specifiers centrally in importDeclImpl().

* Fix macOS build by using <stddef.h> instead of <cstddef>.

Apparently, the macOS toolchain doesn't provide <cstddef>.

<stddef.h> is used in test/Inputs/clang-importer-sdk/usr/include/macros.h,
so I'm assuming it will be OK. (I don't unfortunately have a macOS
machine to test on.)

* Add comment explaining why we skip private and protected C++ class
members.
2020-03-19 08:20:36 -07:00
Argyrios Kyrtzidis
08f7028446 Merge pull request #30482 from apple/syntax-incremental-parse-diagnostic
[Parse] Fix issue with incremental re-parsing for SwiftSyntax emitting bogus parsing error
2020-03-18 20:17:27 -07:00
Nathan Hawes
fd82d87db0 Merge pull request #30402 from nathawes/cross-import-code-completion
[IDE/CodeCompletion] Add code completion support for cross import overlays.
2020-03-18 18:16:03 -07:00
Argyrios Kyrtzidis
791309155d [Parse] Fix issue with incremental re-parsing for SwiftSyntax emitting bogus parsing error
rdar://60232712
2020-03-18 16:00:04 -07:00
Nathan Hawes
63636100be [IDE/CodeCompletion] Add code completion support for cross import overlays.
If a cross-import overlay shadows another module and has a name starting with
'_', don't present that overlay in places where module name completions are
offered and present symbols comining from that module as if they came from
the shadowed module instead.

Resolves rdar://problem/59445688
2020-03-18 12:02:20 -07:00
Argyrios Kyrtzidis
1882b50555 [libSyntax] Enhance incremental re-parsing testing to also check whether unexpected diagnostics were emitted
Enhances `swift-syntax-test` to output the parser diagnostics so we can verify that
if the incremental parse resulted in parser diagnostics, those diagnostics were also emitted during the full parse.
2020-03-18 11:52:21 -07:00
Argyrios Kyrtzidis
b3b3cd3f81 [SourceKit] Avoid calling AbstractStorageDecl::isSettable during syntactic operations
`isSettable` can trigger typechecking and cause crashes during pure syntactic requests.

rdar://60441208
2020-03-17 18:30:33 -07:00
Dmitri Gribenko
841eeb05b0 Merge pull request #30403 from MForster/forster/string-fixes
Cherry-pick StringRef->std::string conversion fixes into `master`
2020-03-17 12:09:36 +01:00
Robert Widmann
70b6bbcb13 Remove swift::createTypeChecker
Replace it with the "legacy semantic queries" bit. The remaining client
of this bit is SourceKit, which appears to require this bit be set
conditionally so certain semantic property wrapper requests return
a sentinel value.

We should migrate these requests to a syntactic interface as soon as
possible.

rdar://60516325
2020-03-16 19:20:22 -07:00
Saleem Abdulrasool
8e80abf4a3 swift-syntax-parser-tool: tweak the build rules
Adjust the build rules to add a build RPATH into the executable to
ensure that `lib_InternalSwiftSyntaxParser.so` is properly found when
running the tests.  This also should ensure that we always use the
correct version, irrespective of the setting of `LD_LIBRARY_PATH`.  This
RPATH is marked as a `BUILD_RPATH` and will be stripped if the tool is
installed.

Adjust the dependencies to be clearer using generator expressions and
use the `target_compile_options` rather than the more fragile
`set_target_properties` to add `-fblocks` to the compilation.  This is
now possible as we are ensured that we are using CMake 3.15+.
2020-03-13 22:38:05 +00:00
Michael Forster
345a9147ec Explicit SmallString->std::string conversion.
This is only needed temporarily until commit d7049213 from upstream
LLVM hits the swift/master branch.
2020-03-13 19:16:49 +01:00
Puyan Lotfi
8132596e83 Handling strict conversion criteria for StringRef to std::string from TOT llvm. 2020-03-13 19:08:22 +01:00
Shoaib Meenai
f769d638c7 [SourceKit] Adjust for LLVM StringRef change (#29625)
StringRef needs an explicit conversion to std::string now.
2020-03-13 19:08:22 +01:00