Commit Graph

316 Commits

Author SHA1 Message Date
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
swift_jenkins
511931489c Merge remote-tracking branch 'origin/master' into master-next 2019-12-20 07:19:11 -08:00
Slava Pestov
72018dbe6a Parse: Remove some dead code 2019-12-19 23:46:01 -05:00
swift_jenkins
6b53fd184c Merge remote-tracking branch 'origin/master' into master-next 2019-12-11 11:00:08 -08:00
Brent Royal-Gordon
6a8598a99c [NFC] Remove DeclNameRef staging calls 2019-12-11 00:55:18 -08:00
Brent Royal-Gordon
da88512eda [NFC] Take DeclNameRef in UnqualifiedLookup and lookupQualified() 2019-12-11 00:55:17 -08:00
Brent Royal-Gordon
9a57554bdf [NFC] DeclNameRef-ify qualified and unqualified lookup 2019-12-11 00:55:17 -08:00
swift_jenkins
2a8c94a938 Merge remote-tracking branch 'origin/master' into master-next 2019-11-18 18:19:58 -08:00
Hamish Knight
2853615880 Add type to package inputs to UnqualifiedLookupRequest
This allows us use an OptionSet parameter for
the request (as currently we can't directly use it
as a parameter due to not having an == definition
for it). It also allows us to regain default
arguments for the source loc and flag parameters.
2019-11-15 16:35:14 -08:00
swift_jenkins
b9f998ffa4 Merge remote-tracking branch 'origin/master' into master-next 2019-11-15 15:56:48 -08:00
Hamish Knight
3aa7158d6c Switch UnqualifiedLookup callers over to UnqualifiedLookupRequest 2019-11-15 14:25:42 -08:00
Robert Widmann
fcf4703c18 Strip PCMacro of its TopLevelContext 2019-11-13 15:28:23 -08:00
swift-ci
5fc1d17bf9 Merge remote-tracking branch 'origin/master' into master-next 2019-11-13 09:10:56 -08:00
Robert Widmann
f4d333d066 Sink a bunch of semantic options into TypeCheckerOptions
Sink
- DebugConstraintSolver
- DebugConstraintSolverAttempt
- DebugConstraintSolverOnLines
- DebugGenericSignatures
- DebugForbidTypecheckPrefix
- SolverMemoryThreshold
- SolverBindingThreshold
- SolverShrinkUnsolvedThreshold
- SolverDisableShrink
- EnableOperatorDesignatedTypes
- DisableConstraintSolverPerformanceHacks
- SolverEnableOperatorDesignatedTypes
2019-11-12 22:39:49 -08:00
swift-ci
d9223a7d16 Merge remote-tracking branch 'origin/master' into master-next 2019-11-12 13:30:45 -08:00
Robert Widmann
8ff60abf6f Remove unused TypeCheckers 2019-11-12 11:33:13 -08:00
Robert Widmann
48805b1d44 Give ASTContext TypeCheckerOptions
Strip TypeChecker of all of this state.
2019-11-12 09:56:01 -08:00
Mike Ash
f5e7ab866c Merge branch 'master' into master-next 2019-09-09 12:11:25 -04:00
Slava Pestov
01e65e18c4 SIL: Share TypeConverter between SILModules in batch mode 2019-09-06 21:50:15 -04:00
Erik Eckstein
34c88a95f6 Merge remote-tracking branch 'origin/master' into master-next 2019-09-01 10:08:17 +02:00
Doug Gregor
11969847c4 Simplify lazy parsing of nominal and extension members.
Lazy parsing for the members of nominal types and extensions depends
only on information already present in
`IterableDeclContext`. Eliminate the use of PersistentParserState as
an intermediary and have the member-parsing request construct a new
`Parser` instance itself to handle parsing. Make this possible even
for ill-formed nominal types/extensions to simplify the code path.

Eliminate `LazyMemberParser` and all of its uses, because it was only
present for lazy member parsing, which no longer needs it.
2019-08-30 08:29:43 -07:00
swift-ci
c97950d7da Merge remote-tracking branch 'origin/master' into master-next 2019-08-19 21:30:00 -07:00
Slava Pestov
80ccbe5116 AST: Stop passing around a LazyResolver in name lookup
Note that in all cases it was either nullptr or ctx.getLazyResolver().
While passing in nullptr might appear at first glance to mean something
("don't type check anything"), in practice we would check for a nullptr
value and pull out ctx.getLazyResolver() instead. Furthermore, with
the lazy resolver going away (at least for resolveDeclSignature() calls),
it won't make sense to do that anymore anyway.
2019-08-19 23:00:57 -04:00
Jonas Devlieghere
29b5711ef7 Update Swift for r367649
We now need an explicit cast from `Colors` to `char`.
2019-08-07 10:25:11 -07:00
Daniel Rodríguez Troitiño
50fd6eae97 [windows] Use unprefixed library name for immediate mode.
The library does not have the lib prefix in Windows, so the immediate
mode was not finding the file. This was making the new tests in
tests/Driver/options.swift fail on Windows. The tests pass after this
change.

Notice that it seems to load the host standard library, so restricting
the change to Windows seems to be OK and should not affect
cross-compilation. Windows was already hardcoding ".dll" as the library
extension, disregarding the target, anyway.
2019-07-03 19:16:35 -07:00
Mike Ash
9df513ae7c [Interpreter] Clean up the /usr/lib/swift fallback code.
- Check the target triple at runtime to decide whether to use the fallback.
- Change isInResourceDir to actually check the resource dir.
- Use ArrayRef<std::string> instead of std::vector<std::string>.
2019-07-01 13:08:04 -04:00
Mike Ash
3f774094b7 [Interpreter] Fall back to loading Swift dylibs from /usr/lib/swift on Apple platforms.
Continue to load the dylibs next to the compiler if they exist. If they don't, then use the OS's dylibs.

rdar://problem/47528005
2019-07-01 13:08:04 -04:00
Saleem Abdulrasool
218b37e1bb build: rename LLVM_COMPONENT_DEPENDS
This is not a target dependency but a target link.  Name the parameter
to be less misleading.  This also makes the name identical to the LLVM
parameter.
2019-05-04 19:58:28 -07:00
Jordan Rose
9ed3fe061d Change ModuleDecl::getImportedModules to take an option set
...in preparation for me adding a third kind of import, making the
existing "All" kind a problem. NFC, except that I did rewrite the
ClangModuleUnit implementation of getImportedModules to be simpler!
2019-03-28 14:44:41 -07:00
Saleem Abdulrasool
9934532e07 cmake: switch host libraries to use target_link_libraries
This is a follow up to the discussion on #22740 to switch the host
libraries to use the `target_link_libraries` rather than the
`LINK_LIBRARIES` special handling.  This allows the dependency to be
properly tracked by CMake and allows us to use the more modern syntax.
2019-02-22 15:28:07 -08:00
David Zarzycki
3479da81b4 [CMake] Add missing libedit dependency 2019-02-20 13:03:35 -05:00
David Zarzycki
6a53f67654 [CMake] Fix dependencies found using LLVM's -DBUILD_SHARED_LIBS=TRUE 2019-02-15 11:28:39 -05:00
Michael Gottesman
531aa6f6a1 [ownership] Strip ownership before running lowering passes in the repl.
This fixes most of the interpreter tests for ownership.
2019-02-02 19:45:07 -08:00
Harlan Haskins
f5fc6f0c57 [Lexer] Handle SwiftInterface files as well as SIL
Previously, the Lexer kept a single flag whether we’re lexing Swift or SIL. Instead, keep track if we’re parsing Swift, SIL, or a Swiftinterface file. .swiftinterface files allow $-prefixed identifiers anywhere.
2019-01-22 11:02:36 -08:00
Arnold Schwaighofer
9feb75806a Refactor 2018-11-08 17:50:25 -08:00
Arnold Schwaighofer
963c64e3e7 Add @_private(from: "SourceFile.swift") imports
A module compiled with `-enable-private-imports` allows other modules to
import private declarations if the importing source file uses an
``@_private(from: "SourceFile.swift") import statement.

rdar://29318654
2018-11-08 08:00:47 -08:00
Michael Gottesman
a761d7c0ba Revert "Revert "Revert "[Build System: CMake] make add_swift_library a wrapper to add_llvm_library"""
This reverts commit 121f5b64be.

Sorry to revert this again. This commit makes some pretty big changes. After
messing with the merge-conflict created by this internally, I did not feel
comfortable landing this now. I talked with Saleem and he agreed with me that
this was the right thing to do.
2018-11-06 13:24:00 -08:00
Saleem Abdulrasool
121f5b64be Revert "Revert "[Build System: CMake] make add_swift_library a wrapper to add_llvm_library""
This reverts commit 103f9a8246.
2018-11-05 14:37:40 -08:00
Xi Ge
103f9a8246 Revert "[Build System: CMake] make add_swift_library a wrapper to add_llvm_library" 2018-11-02 12:49:07 -07:00
Saleem Abdulrasool
c5c64ca3ea add_swift_host_library: rename LLVM_COMPONENT_DEPENDS to LINK_COMPONENTS 2018-10-31 12:46:31 -07:00
Saleem Abdulrasool
39dde93c88 add_swift_host_library: rename LINK_LIBRARIES to LINK_LIBS 2018-10-31 12:46:31 -07:00
Michael Gottesman
3f17bb6ddf Carefully split the build's invocation of add_swift_library into host/target variants.
The key thing here is that all of the underlying code is exactly the same. I
purposely did not debride anything. This is to ensure that I am not touching too
much and increasing the probability of weird errors from occurring. Thus the
exact same code should be executed... just the routing changed.
2018-10-27 12:58:51 -07:00
Jordan Rose
a9bbaf751f Assume a SILModule is whole-module when SILGen-ing from a ModuleDecl
No functionality change. Unfortunately we still need the flag in
SILModule itself because of the ability to create an empty SILModule
and parse SIL into it incrementally, which can happen before there's
a FileUnit to use as the associated DeclContext instead of a
CompilerInstance's main module.
2018-09-25 09:13:52 -07:00
Jordan Rose
2b5a2ad84c Rework the integrated REPL to use separate modules for every line
...like LLDB does, instead of parsing into a single SourceFile.
This does break some functionality:

- no more :dump_ast
- no redeclaration checking, but no shadowing either---redeclarations
  just become ambiguous
- pretty much requires EnableAccessControl to be off, since we don't
  walk decls to promote them to 'public'

...but it allows us to remove a bit of longstanding support for
type-checking / SILGen-ing / IRGen-ing only part of a SourceFile that
was only used by the integrated REPL.

...which, need I remind everyone, is still /deprecated/...but sometimes
convenient. So most of it still works.
2018-09-25 09:13:52 -07:00
Jordan Rose
56f7164f15 Remove support for -enable-source-import in JIT or REPL modes
This was full of cruft to begin with, and -enable-source-import has
plenty of other problems. Remove support for IRGen-ing those other
modules.
2018-09-22 13:47:16 -07:00
Xi Ge
24b0eac9a4 Parser: parse members in extension decls incrementally. 2018-09-05 17:00:39 -07:00
Bob Wilson
ffa88c3d28 Merge remote-tracking branch 'origin/master' into master-next 2018-07-23 14:38:55 -07:00