Commit Graph

800 Commits

Author SHA1 Message Date
Arnold Schwaighofer
9286ece71c Revert "Enable import of the _Concurrency module by default." 2021-04-09 13:20:30 -07:00
Egor Zhdan
6650a891f1 ClangImporter: run Clang with a proper executable path
Clang deduces its installation directory from the `argv[0]` parameter (see clang/lib/Frontend/CreateInvocationFromCommandLine.cpp), and the default include search paths are computed based on the installation directory.

This change allows compiling Swift code that imports the C++ stdlib without having to manually specify the include search path of `std` headers.
2021-04-07 21:54:12 +03:00
Doug Gregor
95fd3ede09 Update tests and testing tools for implicit _Concurrency import 2021-04-06 14:08:41 -07:00
Becca (née Brent) Royal-Gordon
3df5ca6636 Merge pull request #36409 from beccadax/behave-yourself
Soften errors for invalid @objc attributes added by access notes
2021-03-25 15:44:22 -07:00
Saleem Abdulrasool
714eaefc78 Importer: remove ImportAsMember support
This functionality is not actively in use and the last usage of this has
been removed.  Remove the infrastructure that is no longer in need.
2021-03-22 08:53:56 -07:00
Becca Royal-Gordon
d7c385571f [NFC] Add -access-notes-path to swift-ide-test 2021-03-18 17:22:57 -07:00
David Ungar
a4d32f9ced update swift-ide-test.cpp and sourceinfo.swift
Fix sourceinfo.swift
2021-02-27 09:24:34 -08:00
Rintaro Ishizaki
bb45b2a822 [CodeCompletion] Lazily populate 'BasicSourceFileInfo' 2021-02-25 14:56:55 -08:00
David Ungar
6e034cac4e Revert "[NFC; Incremental] Rename BasicSourceFileInfo.InterfaceHash" 2021-02-25 09:06:53 -08:00
David Ungar
cbd92e65ff Rename BasicSourceFileInfo.InterfaceHash 2021-02-24 09:13:22 -08:00
Arnold Schwaighofer
084db0d38f Revert "Merge pull request #34848 from aschwaighofer/make_prespecialization_experimental"
This reverts commit 3aec862e62, reversing
changes made to 158427bd5b.
2021-02-12 10:12:01 -08:00
Ben Barham
cc699d3db6 Merge pull request #35572 from bnbarham/async-refactorings
[Refactoring] Add async refactorings
2021-02-04 13:56:37 +10:00
Ben Barham
aa7d010c79 [Gardening] Remove mostly unused (but confusing) field in ResolvedCursorInfo 2021-02-03 15:54:45 +10:00
Robert Widmann
58d91e28bc Print Module Fingerprints in swift-ide-test 2021-02-02 09:59:39 -08:00
Varun Gandhi
f9570b2d34 [NFC] Pass full convention printing boolean for types etc.
When -experimental-print-full-convention is set, we should be printing
the full convention in diagnostics, doc comments etc.
2021-01-25 18:47:39 -08:00
Slava Pestov
4c72128372 IRGen: Plumb through a GenericSignature when mangling types for debug info
The generic signature isn't used for a whole lot, so this all mostly
worked before; the test case I have hits the code path for mangling
a retroactive conformance.

Fixes <https://bugs.swift.org/browse/SR-14016> / <rdar://problem/72865083>.
2021-01-19 17:25:28 -05:00
Rintaro Ishizaki
a9a044c6e3 [Serialization] Serialize fingerprint, mtime, size of the source files 2021-01-13 11:49:52 -08:00
Rintaro Ishizaki
1b6e7857c2 [Serialization] Serialize/deserialize source file list 2021-01-13 11:49:52 -08:00
Slava Pestov
4337899ded Merge pull request #35334 from slavapestov/remove-evaluator-type-erasers
Remove request evaluator's AnyRequest and AnyValue type erasers
2021-01-11 14:44:54 -05:00
Slava Pestov
28e7ed03d0 AST: Remove the 'legacy' request dependency graph implementation 2021-01-08 23:17:12 -05:00
Doug Gregor
8c123e8505 [Concurrency] Hard-code support for importing @MainActor.
Our name lookup rules for the resolution of custom attributes don't
allow for them to find MainActor within the _Concurrency library.
Therefore, hardcode @MainActor to map to _Concurrency.MainActor.

While here, make sure we drop concurrency-specific attributes that
show up in Clang attributes when we aren't in concurrency mode.
2021-01-08 17:03:50 -08:00
Arnold Schwaighofer
8346bf7e90 Pre-specialization: This is an experimental feature
Only enable if explicitly required.
2020-11-20 09:13:16 -08:00
Slava Pestov
5808d9beb9 Parse: Remove parse-time name lookup 2020-11-16 22:39:44 -05:00
Slava Pestov
74e72a6cd7 swift-ide-test: Disable parser lookup 2020-11-16 16:52:50 -05:00
Rintaro Ishizaki
65f3133ba9 [CodeCompletion] Add XFAIL to swift-ide-test
In -batch-code-completion mode, add a token parameter 'xfail={reason}'.
When 'FileCheck' succeeds on the token, it is considered "unexpected
pass", and the test fails.

rdar://problem/71021285
2020-11-04 15:20:06 -08:00
Brent Royal-Gordon
b440ab7331 [NFC] Move several types/functions to Import.h
To help consolidate our various types describing imports, this commit moves the following types and methods to Import.h:

* ImplicitImports
* ImplicitStdlibKind
* ImplicitImportInfo
* ModuleDecl::ImportedModule
* ModuleDecl::OrderImportedModules (as ImportedModule::Order)
* ModuleDecl::removeDuplicateImports() (as ImportedModule::removeDuplicates())
* SourceFile::ImportFlags
* SourceFile::ImportOptions
* SourceFile::ImportedModuleDesc

This commit is large and intentionally kept mechanical—nothing interesting to see here.
2020-10-09 18:57:07 -07:00
Varun Gandhi
d3369f7711 [NFC] Rename ImportFilterKind cases to be clearer. 2020-09-23 12:50:20 -07:00
Robert Widmann
9fd5918786 Swap InputFileKind for ParseInputMode
Tying InputFile to this option meant that every input that was not one of the explictly-blessed kinds was modeled as a Swift file.

With the new InputFile that infers file kinds, we no longer need CompilerInvocation::setInputKind
2020-09-11 22:28:58 -06:00
Robert Widmann
513d108a0e [NFC] Drop SourceFileKind from getMainSourceFile
The parameter here was derived from the CompilerInvocation-level parsing bits, which doesn't make any sense. This state is going away soon, so drop the parameter.
2020-09-11 21:11:58 -06:00
Brent Royal-Gordon
cce0411000 [NFC] Add ASTContext::getModuleByIdentifier()
This is a reasonably common operation.
2020-09-10 19:08:29 -07:00
Brent Royal-Gordon
61f716d5a8 [NFC] Get rid of ASTContext::getModuleByName dups
This method was reimplemented three times in various source tools.
2020-09-10 19:08:29 -07:00
Brent Royal-Gordon
cff4ddf13a [NFC] Adopt new ImportPath types and terminology
# Conflicts:
#	lib/IDE/CodeCompletion.cpp
2020-09-10 19:07:49 -07:00
Rintaro Ishizaki
77b4f75608 [SourceKit] Reorgantize code completion options
* Abolish 'reuseastcontext' per-request option
* Add 'MaxASTContextReuseCount' global configuration
2020-09-03 19:30:05 -07:00
Matei Oprea
6ae04f749b [NFC] Remove ModuleDecl::isClangModule in favor of isNonSwiftModule. (#33202)
Fixes SR-13237.
2020-08-03 20:01:17 -07:00
Slava Pestov
b4ea644910 IDE: Replace some calls to getDeclaredType() with getDeclaredInterfaceType() 2020-07-31 13:39:02 -04:00
Doug Gregor
84f4cc034f [Concurrency] Finish and add tests for ban on async with @objc. 2020-07-28 16:41:17 -07:00
Rintaro Ishizaki
0b5dbb111a [swift-ide-test] Add indicator of "reusing ASTContext" to the result 2020-07-09 16:48:45 -07:00
Rintaro Ishizaki
2f89469eac Merge pull request #28946 from rintaro/ide-completion-batchtest-rdar16025703
[CodeCompletion] Batch code completion test
2020-06-18 20:38:42 -07:00
Rintaro Ishizaki
f99fa56f9d [CodeCompletion] Add batch ocompletion test utility
Utilize fast-completion in swift-ide-test
2020-06-18 16:26:41 -07:00
Xi Ge
1cb4eda4b6 test: add an IDE test for loading modules from explict module map 2020-06-17 14:02:50 -07:00
Saleem Abdulrasool
e57d37599f build: do not assume that XML2 should be enabled
Allow user control over libxml2 usage via `LLVM_ENABLE_LIBXML2` rather
than assuming that if it is found, it should be enabled.
2020-06-14 13:36:35 -07:00
Hamish Knight
1ed810653c [Frontend] Remove performParseOnly
Most clients were only using it to populate the
main module with files, which is now done by
`getMainModule`. Instead, they can now just rely
on parsing happening lazily.
2020-06-08 12:44:15 -07:00
Hamish Knight
5d72c464eb [Frontend] Remove parsing option params from performParseOnly
Lift the `DisablePoundIfEvaluation` parsing option
into `LangOptions` to subsume the need for the
`EvaluateConditionals` parameter, and sink the
computation of `CanDelayBodies` down into
`createSourceFileForMainModule`.
2020-06-08 12:44:13 -07:00
Ben Langmuir
fadfb6c945 Merge pull request #31874 from benlangmuir/driver-tmp-sad
[driver/sourcekit] Avoid creating temporary output files in TMPDIR
2020-06-05 13:43:23 -07:00
Hamish Knight
d26f4148a9 [CodeCompletion] Replace main module instead of file
Rather than replacing the code completion file
on the `CompilerInstance` whenever we do a cached
top-level completion, let's set a new main module
instead.

This allows us to properly update the
`LoadedModules` map, and allows the retrieval of
the code completion file to be turned into a
request.
2020-06-02 14:25:28 -07:00
Owen Voorhees
45bc578ae5 [SourceManager] Rename line and column APIs for clarity 2020-05-21 12:54:07 -05:00
Ben Langmuir
cccb21aca6 [driver] Add test for new behaviour in createCompilerInvocation
Test for "ForceNoOutputs" flag.
2020-05-19 13:58:05 -07:00
Hamish Knight
72bb47ee90 [Frontend] Remove InputFileKind::SwiftREPL 2020-05-07 11:00:02 -07:00
Hamish Knight
dac52cb610 [Frontend] Move initial REPL file creation logic
Move the logic out of the frontend and into its
only client, swift-ide-test.
2020-05-07 11:00:02 -07:00
Slava Pestov
b81c0d63d1 AST: Remove SourceFileKind::REPL 2020-05-07 02:04:05 -04:00