Commit Graph

1419 Commits

Author SHA1 Message Date
Saleem Abdulrasool
ff601ad06d SourceKit: inline single-use variable (NFC)
Inline the unnecessary use of the variable for creating the
SourceKitSupport library.
2019-11-14 09:39:15 -08:00
swift-ci
5fc88311d0 Merge remote-tracking branch 'origin/master' into master-next 2019-11-13 10:09:52 -08:00
Gwen Mittertreiner
e587c3255c Convert NT paths to DOSPath when resolving Symlinks
GetFinalPathNameByHandleW returns NTPaths (\\?\ Paths) which is an issue
as they don't match the paths stored in the internal dictionaries which
are DOS paths.
2019-11-12 19:57:11 -08:00
swift-ci
d9223a7d16 Merge remote-tracking branch 'origin/master' into master-next 2019-11-12 13:30:45 -08:00
Hamish Knight
cd3ada5abb getInterfaceType() always returns a type (#28210)
getInterfaceType() always returns a type
2019-11-12 13:24:05 -08:00
Robert Widmann
48805b1d44 Give ASTContext TypeCheckerOptions
Strip TypeChecker of all of this state.
2019-11-12 09:56:01 -08:00
Hamish Knight
ed77b86c24 getInterfaceType() always returns a type 2019-11-12 07:50:29 -08:00
swift-ci
eb702cfbbc Merge remote-tracking branch 'origin/master' into master-next 2019-11-12 04:49:51 -08:00
Rintaro Ishizaki
2564a6e494 [CodeCompletion] Avoid typechecking all toplevel decls in the current file
- Use `performParseAndResolveImportsOnly()` to invoke the frontend
- Do `bindExtensions()` in `ide::typeCheckContextUntil()`
- Typecheck preceding `TopLevelCodeDecl`s only if the compleiton is in
  a `TopLevelCodeDecl`
- Other related tweaks

rdar://problem/56636747
2019-11-12 12:57:18 +09:00
swift-ci
36da3cab70 Merge remote-tracking branch 'origin/master' into master-next 2019-10-30 16:49:48 -07:00
Robert Widmann
0267384e11 Fixup SourceKit and Tests
Patch up all the places that are making a syntactic judgement about the
isInvalid() bit in a ValueDecl.  They may continue to use that query,
but most guard themselves on whether the interface type has been set.
2019-10-30 15:09:14 -07:00
swift-ci
ae278ae961 Merge remote-tracking branch 'origin/master' into master-next 2019-10-30 14:50:00 -07:00
Jordan Rose
5c2185f395 Merge pull request #27868 from owenv/diag-info-refactor
[Diagnostics] Refactor DiagnosticConsumer interface to remove unnecessary params
2019-10-30 14:49:11 -07:00
swift-ci
1377c0387a Merge remote-tracking branch 'origin/master' into master-next 2019-10-30 13:49:48 -07:00
Ben Langmuir
c864eab859 [edit] Fix racy access to SemanticInfo
Specifically, if the document was re-opened, we would drop the reference
and the call to readSemanticInfo could use-after-free the array of
diagnostics. This manifested as a very rare crash while testing
sourcekit-lsp.
2019-10-29 16:33:36 -07:00
Owen Voorhees
8a6711769e [Diagnostics] Refactor DiagnosticConsumer interface
DiagnosticInfo now holds all the information needed to consume
a diagnostic, so remove unneeded parameters from handleDiagnostic.
2019-10-29 13:52:12 -07:00
Xi Ge
64c0680686 Merge remote-tracking branch 'apple/master' into master-next 2019-10-28 10:19:36 -07:00
Saleem Abdulrasool
2dbb7fae96 build: add a dependency on the just built clang (NFC)
When building in a unified build and building the host tools with a
non-clang compiler, we switch compilers.  In such a case, we need to
actually add an explicit dependency on the new compiler.
2019-10-26 17:17:41 -07:00
Adrian Prantl
468b74bd70 Update Swift master-next for upstream llvm.org changes. 2019-10-21 13:31:31 -07:00
Xi Ge
19b0a8a06a Merge pull request #27633 from nkcsgexi/get-loc-return-serialized-loc
AST: teach Decl::getLoc() to return serialized source loc.
2019-10-16 17:16:20 -07:00
Xi Ge
fd280d7746 sourcekitd-test: ignore .swiftsourcefile when invoking sourcekitd from sourcekitd-test 2019-10-16 14:13:48 -07:00
Varun Gandhi
903add2c3f [Frontend] Make the module trace emission more robust.
✔ More informative error messages in case of crashes.
✔ Handling and documenting different cases.
✔ Test cases for different cases.
✔ Make SDKDependencies.swift pass again.
2019-10-15 15:44:26 -07:00
swift-ci
e4cbf824ae Merge remote-tracking branch 'origin/master' into master-next 2019-10-11 15:10:04 -07:00
Robert Widmann
060cbb293f [NFC] Downgrade The TypeLoc in VarDecl to a TypeRepr
TypeCheckPattern used to splat the interface type into this, and
different parts of the compiler would check one or the other.   There is
now one source of truth: The interface type.  The type repr is now just
a signal that the user has written an explicit type annotation on
a parameter.  For variables, we will eventually be able to just grab
this information from the parent pattern.
2019-10-11 11:15:51 -07:00
swift-ci
84f192ddce Merge remote-tracking branch 'origin/master' into master-next 2019-10-10 13:50:08 -07:00
Xi Ge
dd33540231 AST: rename printDeclUSRForModuleDoc to printDeclUSR. NFC 2019-10-09 15:29:52 -07:00
Xi Ge
e9dfdea6fd SerializeLoc: serialize basic decl source location information to .swiftsourceinfo file
After setting up the .swiftsourceinfo file, this patch starts to actually serialize
and de-serialize source locations for declaration. The binary format of .swiftsourceinfo
currently contains these three records:

BasicDeclLocs: a hash table mapping from a USR ID to a list of basic source locations. The USR id
could be retrieved from the following DeclUSRs record using an actual decl USR. The basic source locations
include a file ID and the results from Decl::getLoc(), ValueDecl::getNameLoc(), Decl::getStartLoc() and Decl::getEndLoc().
The file ID could be used to retrieve the actual file name from the following SourceFilePaths record.
Each location is encoded as a line:column pair.

DeclUSRS: a hash table mapping from USR to a USR ID used by location records.

SourceFilePaths: a hash table mapping from a file ID to actual file name.

BasicDeclLocs should be sufficient for most diagnostic cases. If additional source locations
are needed, we could always add new source location records without breaking the backward compatibility.
When de-serializing the source location from a module-imported decl, we calculate its USR, retrieve the USR ID
from the DeclUSRS record, and use the USR ID to look up the basic location list in the BasicDeclLocs record.

For more details about .swiftsourceinfo file: https://forums.swift.org/t/proposal-emitting-source-information-file-during-compilation
2019-10-09 15:29:51 -07:00
Mishal Shah
2f86d67500 Merge pull request #27396 from shahmishal/master-rebranch
Update master to support apple/stable/20190619 branch for LLVM projects
2019-10-01 10:50:49 -07:00
swift-ci
5e50242b5e Merge remote-tracking branch 'origin/master' into master-next 2019-09-30 16:09:53 -07:00
Robert Widmann
5a8d0744c3 [NFC] Adopt TypeBase-isms for GenericSignature
Structurally prevent a number of common anti-patterns involving generic
signatures by separating the interface into GenericSignature and the
implementation into GenericSignatureBase.  In particular, this allows
the comparison operators to be deleted which forces callers to
canonicalize the signature or ask to compare pointers explicitly.
2019-09-30 14:04:36 -07:00
swift-ci
6945d6192d Merge remote-tracking branch 'origin/master' into master-next 2019-09-26 09:29:43 -07:00
swift-ci
f809a8790c Merge remote-tracking branch 'origin/master' into master-rebranch 2019-09-26 09:25:07 -07:00
Jordan Rose
8ff1dac381 [AST] Break some header dependencies for faster rebuilds (#27374)
DiagnosticEngine.h no longer depends on Attr.h.
Expr.h no longer depends on TypeRepr.h.

No functionality change.
2019-09-26 09:17:10 -07:00
swift-ci
388697b23c Merge remote-tracking branch 'origin/master' into master-next 2019-09-23 22:50:12 -07:00
swift-ci
ed72643d1b Merge remote-tracking branch 'origin/master' into master-rebranch 2019-09-23 22:44:27 -07:00
Robert Widmann
1233cdf596 Update SourceKit for getInterfaceType() changes 2019-09-23 17:24:18 -07:00
swift-ci
c8df9251de Merge remote-tracking branch 'origin/master' into master-rebranch 2019-09-18 11:04:08 -07:00
swift-ci
dce64e93ee Merge remote-tracking branch 'origin/master' into master-next 2019-09-18 10:49:47 -07:00
Nathan Hawes
54defbc7f7 [code-completion] Remove special handling for completion on the RHS of an assignment
This simplifies the code and prevents an assertion failure this code was
hitting computing the type relations between the result types and what it
determined as the expected type.

Resolves rdar://problem/53958454
2019-09-17 18:59:33 -07:00
Brent Royal-Gordon
8734092923 Merge branch 'master' into master-rebranch
# Conflicts:
#	lib/IRGen/GenExistential.cpp
2019-09-11 20:12:03 -07:00
swift-ci
42faf00579 Merge remote-tracking branch 'origin/master' into master-next 2019-09-11 13:57:43 -07:00
Harlan Haskins
37382fe83d Merge pull request #27065 from harlanhaskins/type-and-circumstance
[ModuleInterfaces] Escape `Type` and `Protocol` when module-qualifying
2019-09-11 13:54:57 -07:00
Harlan Haskins
2893d96927 [ModuleInterfaces] Escape Type and Protocol when module-qualifying
If we see `MyModule.Type`, the parser thinks this is a metatype type.
Escape the name `Type` so the parser can recognize it's a type name.

Fixes [SR-11422](https://bugs.swift.org/browse/SR-11422) rdar://55094784
2019-09-09 17:20:27 -07:00
Mike Ash
f5e7ab866c Merge branch 'master' into master-next 2019-09-09 12:11:25 -04:00
swift-ci
397ff4ce05 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-09-06 23:23:36 -07:00
Slava Pestov
01e65e18c4 SIL: Share TypeConverter between SILModules in batch mode 2019-09-06 21:50:15 -04:00
Jordan Rose
eefb0d0644 Merge remote-tracking branch 'origin/master' into master-next 2019-09-04 14:01:43 -07:00
swift-ci
0eaa4e1ad9 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-09-04 11:23:50 -07:00
Saleem Abdulrasool
9c9f0bd440 Merge pull request #26918 from xiaobai/sur-la-tablegen
[CMake][SourceKit] SwiftLang should depend on clang-tablegen-targets
2019-09-04 11:15:53 -07:00
swift-ci
f1318a890a Merge remote-tracking branch 'origin/master' into master-next 2019-08-29 14:10:41 -07:00