Commit Graph

1419 Commits

Author SHA1 Message Date
Nathan Hawes
0516c3b74f Merge pull request #29857 from nathawes/avoid-mangling-in-document-structure-request
[SourceKit] Don't report the ObjC runtime name without @objc(Name)
2020-02-17 15:27:26 -08:00
Saleem Abdulrasool
edbe22b63c swift-lang: shuffle the source directory structure (NFC)
This moves the swift-lang library out of the tools/SourceKit directory
and into the stdlib directory.  As it stands, the library required that
the standard library and the SDK overlay was being built.  This is
implicitly done when building the stdlib subdirectory.  Furthermore, it
had an odd tie between the flags for Swift and SourceKit which now have
the logic separated.  This clearly delineates the host and target
components in the repository.
2020-02-16 19:12:47 -08:00
Nathan Hawes
2420b6d28b [SourceKit] Don't report the ObjC runtime name without @objc(Name)
We used to compute the mangled name in other cases, but document structure is
a syntactic request and can't guarantee that the class/protocol we're getting
the mangled name of is valid in any way so it often breaks assumptions in the
mangler and causes it to crash. It's not clear if the runtime_name is actually
being used anymore, so this change restricts reporting it to just the cases
where we don't need to mangle.

rdar://problem/40956377
2020-02-14 11:40:09 -08:00
Ben Langmuir
18455e6aec Merge pull request #29558 from ahoppen/sema-enabled-notificaiton
[sourcekitd] Send a notification when semantic functionality is enabled again
2020-02-14 07:10:56 -08:00
swift-ci
da0853040a Merge remote-tracking branch 'origin/master' into master-rebranch 2020-02-07 16:44:33 -08:00
Nathan Hawes
e200165251 Merge pull request #29702 from johnfairh/cursorinfo-module-name
[SourceKit] Fix cursorinfo key.modulename with sourceinfo
2020-02-07 16:29:36 -08:00
John Fairhurst
0e8f4d4f32 [SourceKit] Fix cursorinfo.modulename with sourceinfo 2020-02-07 12:24:16 +00:00
swift-ci
23021d96fc Merge remote-tracking branch 'origin/master' into master-rebranch 2020-02-06 11:04:29 -08:00
Rintaro Ishizaki
cc8d4965f8 [CodeCompletion] Ensure cached results have 'unknown' type relation 2020-02-05 17:05:23 -08:00
Rintaro Ishizaki
c31bfaeeed [CodeCompletion] Introduce 'Unknown' type relation
Now

* NotApplicable: The result is not relevant for type relation (e.g.
  keywords, and overloads)
* Unknown: the relation was not calculated (e.g. cached results), or the
  context type is unknown.
* Invalid: The result type is invalid for this context (i.e. 'Void' for
  non-'Void' context)
* Unrelated: The result type has no relation to the context type
* Convertible: The result type is convertible to the context type
* Identical: The result type is identical to the context type
2020-02-05 14:23:59 -08:00
Rintaro Ishizaki
17abedf1ef [CodeCompletion] Introduce 'NotApplicable' type relation
For keywords, and overrides.
2020-02-05 14:23:59 -08:00
swift-ci
895294a7d1 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-02-05 11:03:43 -08:00
Rintaro Ishizaki
c722b1aa5b Merge pull request #29624 from rintaro/sourcekit-typerelation-rdar59066560
[SourceKit] Expose 'ExpectedTypeRelation' for the completion results
2020-02-05 10:51:09 -08:00
swift-ci
bc7bebadc9 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-02-04 08:02:45 -08:00
Daniel Rodríguez Troitiño
713e6360e6 Merge pull request #29454 from buttaface/skd-test
[sourcekitd-test] Remove LLVM Core static library that is getting linked twice
2020-02-04 07:56:01 -08:00
Rintaro Ishizaki
1e74c39956 [SourceKit] Expose ExpectedTypeRelation for the completion results
So that clients can sort the results using this.

rdar://problem/59066560
2020-02-03 15:57:43 -08:00
swift-ci
ba49f06221 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-30 17:03:10 -08:00
Alex Hoppen
cb26625f5d [sourcekitd] Send a notification when semantic functionality is enabled again 2020-01-30 15:47:13 -08:00
Rintaro Ishizaki
e121cb09cd Revert "[SourceKit] Disable module system headers validation"
This reverts commit 951b85359a.
2020-01-30 15:04:07 -08:00
Butta
1d747bc351 [sourcekitd-test] Remove redundant LLVMCore static library
This library is already supplied by the LLVM CMake config, so adding it here
sometimes causes the CommandLine option parser to fail, as it registers the
same option twice.
2020-01-29 11:32:37 +05:30
swift-ci
0373bc26c1 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-28 08:03:20 -08:00
Saleem Abdulrasool
a1c971907b build: repair the Windows build
This should repair the Windows build after #29451.  The quoting
behaviour was incorrect and was constructing an invalid compiler
invocation.  Solve the issue by using `target_include_directories`
instead.  However, since this needs the target, hoist the flag
computation to the local sites.  This replicates more logic because of
the custom build trying to replicate the CMake build logic in CMake.
2020-01-27 22:35:28 -08:00
swift-ci
8c23dec23e Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-27 09:04:20 -08:00
Saleem Abdulrasool
d8b3b626fe build: use modern target property handling
Use specific operations for setting the compile flags, link flags,
linked libraries, and library search paths.  This allows us to use CMake
more effectively, simplifies the logic, and will ensure that flags are
not duplicated.
2020-01-25 16:08:51 -08:00
swift-ci
ca63366ce1 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-24 14:04:24 -08:00
Ben Langmuir
f8ebc98483 [sourcekitd-test] When setting -fmodules-cache-path also set -fmodules
When doing header interface generation, we interpret clang command-line
arguments in `initInvocationByClangArguments` and attempt to setup a
matching Swift compiler invocation. One important argument is the module
cache, but clang will only interpret `-fmodules-cache-path` if modules
are enabled (typically with `-fmodules`). While the header itself might
not need modules, Swift will import its own shims module and during
testing this needs to honour lit's provided cache. So we add -fmodules
in sourcekitd-test anytime we add -fmodules-cache-path.

rdar://58836540
2020-01-24 11:45:23 -08:00
Mike Ash
cd2b54f74e Merge branch 'master' into master-rebranch 2020-01-24 11:30:32 -05:00
Saleem Abdulrasool
d3f72155d8 Merge pull request #29399 from compnerd/sk-rpath
build: move the RPATH handling to the executables
2020-01-24 08:19:27 -08:00
Saleem Abdulrasool
9d8d013ade Merge pull request #29383 from compnerd/exclude-exclusion
build: remove support for `EXCLUDE_FROM_ALL` (NFC)
2020-01-24 08:17:45 -08:00
Saleem Abdulrasool
04affa2b9f build: use the new libedit imported library
Use the imported library to track header search path and library search
paths and dependencies rather than replicating that knowledge.
2020-01-23 14:24:06 -08:00
Saleem Abdulrasool
bc21d4ff46 build: move the RPATH handling to the executables
This moves the handling of the RPATH and the exported symbol to the
binary themselves.  The exported symbol is needed due to the use of the
exported symbol list.  This makes the small difference that `_main` is
always exported on Darwin which is not strictly needed in ASAN as ASAN
provides the entry point.

The RPATH is only setup on installation which is sufficient for testing
purposes as CMake ensures that the libraries are fully linked and will
be loaded properly when run from the build tree.
2020-01-23 13:38:22 -08:00
Saleem Abdulrasool
1f961414a5 build: remove support for EXCLUDE_FROM_ALL (NFC)
This parameter is unused.  Simply remove the option from the
`add_swift_sourcekit_executable`.
2020-01-23 12:44:28 -08:00
swift-ci
d31da5d08d Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-22 14:03:45 -08:00
Ben Langmuir
a989b8a978 Merge pull request #29357 from benlangmuir/lit-subst-mcp-sourcekit
[sourcekit] Add global -module-cache-path to test executables
2020-01-22 13:45:56 -08:00
Ben Langmuir
8b8ec5372e [sourcekit] Add global -module-cache-path to test executables
Add a global -module-cache-path option to `sourcekitd-test` and
`complete-test` and have lit provide the default module cache in its
substitutions. Previously many tests have explicitly provided the
`%mcp_opt` option, but this is easy to forget when writing new tests.

The module cache is inserted into the compiler arguments at the
beginning so that it's still possible for a test to override it with a
per-test cache if desired.

rdar://58752842
2020-01-22 11:04:52 -08:00
Erik Eckstein
bbfaccda4b Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-22 08:25:23 +01:00
Devin Coughlin
082421048a [AST/Sema] Add availability attributes for macCatalyst
Add a platform kind and availability attributes for macCatalyst. macCatalyst
uses iOS version numbers and inherits availability from iOS attributes unless
a macCatalyst attribute is explicitly provided.
2020-01-21 20:27:14 -08:00
Erik Eckstein
1b312a85bd Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-16 10:39:20 +01:00
Brent Royal-Gordon
0c478b6be6 Revert "Merge pull request #28665 from CodaFi/the-phantom-menace"
This reverts commit 43a3ab7e35, reversing
changes made to 4f39d9c749.

# Conflicts:
#	include/swift/AST/Attr.def
#	lib/AST/Attr.cpp
#	lib/Serialization/Deserialization.cpp
#	lib/Serialization/ModuleFormat.h
#	lib/Serialization/Serialization.cpp
2020-01-15 15:28:42 -08:00
Rintaro Ishizaki
951b85359a [SourceKit] Disable module system headers validation
in all SourceKit requests.
This validation may call many stat(2). Since we don't expect system files
are edited. Disable it for SourceKit requests. Even if they are edited,
manual builds can validates and updates them.

rdar://problem/58550697
2020-01-14 13:06:57 -08:00
swift-ci
bc5eca8388 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-10 16:43:42 -08:00
Shoaib Meenai
e606f52ae8 [build] Check for unicode functions in libedit
Some versions of libedit may have histedit.h but not the Unicode
functions. Explicitly check for the Unicode functions in the found
libedit to ensure the check is accurate.

I considered making this a component of the LibEdit package in our find
module, but CMake's documentation [1] says "Packages that find multiple
semi-independent parts (like bundles of libraries) should search for the
components...", and the "multiple semi-independent parts" definitely
isn't the case here; we're just interested in determining if the found
library supports a particular feature.

[1] https://cmake.org/cmake/help/v3.16/manual/cmake-developer.7.html#find-modules
2020-01-10 09:40:18 -08:00
Arnold Schwaighofer
43c24be5cd Merge remote-tracking branch 'upstream/master' into master-next 2020-01-08 06:41:34 -08:00
Varun Gandhi
022314a640 Merge pull request #28643 from kitaisreal/using-located-instead-of-pair
[Compiler]: Using Located<T> instead of std::pair<SourceLoc, T>
2020-01-06 14:22:29 -08:00
swift_jenkins
615101cbb5 Merge remote-tracking branch 'origin/master' into master-next 2020-01-02 16:39:11 -08:00
Saleem Abdulrasool
dbc3b433ad build: synchronise with LLDB's version of FindLibEdit
The current FOUND_VAR for FindLibEdit is libedit_FOUND but wasn't set by
find_package_handle_standard_args. However this isn't valid for the
package name.

  The argument for FOUND_VAR is "libedit_FOUND", but only
  "LibEdit_FOUND" and "LIBEDIT_FOUND" are valid names.

This fixes all the variables set by FindLibEdit to match the desired
naming scheme.

Thanks to Jonas for fixing the variable names!
2020-01-02 14:16:58 -08:00
swift_jenkins
81c0ed297a Merge remote-tracking branch 'origin/master' into master-next 2020-01-02 10:19:08 -08:00
Saleem Abdulrasool
1b850a2afd build: improve libedit handling for builds
Use the FindLibEdit.cmake module from LLDB to properly control where
the libedit libraries are searched for and linked from as well as where
the headers come from. This uses the standard mechanisms which allows
users to control where libedit is pulled from (which is important for
cross-compilation).

This second version is more aggressive about pruning the libedit
handling.  The Ubuntu 14.04 version of libedit does not have
`histedit.h`, and the intent is to rely on that to determine if we have
unicode support or not.
2019-12-29 16:32:49 -08:00
Kita, Maksim
c88ac85b3f SR-11889: Fixed code review issues
1. Removed two braces {{ usage of Located initialization
2. Wrapped documentation into 80 characters
2019-12-20 17:18:59 +03:00
Kita, Maksim
b7cb3b67bf SR-11889: Using Located<T> instead of std::pair<SourceLoc, T> 2019-12-20 17:18:58 +03:00