Commit Graph

557 Commits

Author SHA1 Message Date
Jordan Rose
fdd02f61d3 [CMake] Stop linking CoreFoundation into swiftc and libobjc into everything.
We link the stdlib against Foundation and that's quite sufficient for the REPL
and script mode to work.
2016-12-22 08:50:13 -08:00
Bob Wilson
13da3fa8b1 Merge remote-tracking branch 'origin/master' into master-next 2016-12-04 18:16:09 -08:00
Saleem Abdulrasool
6434a90032 Revert "build: use add_llvm_tool_symlink" 2016-12-03 15:14:33 -08:00
Saleem Abdulrasool
4a90e194c7 build: use add_llvm_tool_symlink
Rather than invoke the create_symlink command manually which wont work on
Windows, use the add_llvm_tool_symlink.
2016-12-03 12:21:24 -08:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Saleem Abdulrasool
46d684f35f remove usage of BitstreamReader
LLVM SVN r286207 removed the BitstreamReader interface.  Remove the usage of the
type, updating the cursor constructor accordingly.
2016-11-15 17:39:37 -08:00
Bob Wilson
f10ae47b9f Merge remote-tracking branch 'origin/master' into master-next 2016-11-15 17:32:28 -08:00
Saleem Abdulrasool
c7317ff9d0 driver: adjust for SVN r286561
LLVM SVN r286561 made the default constructor for llvm::Error protected,
requiring value initialization to `llvm::Error::success()`.  Update the code
accordingly.
2016-11-15 09:49:30 -08:00
Daniel Duan
d0de084a79 [swift-format] add option to indent switch block
add a boolean option to indent switch's block:

```
// with -indent-switch-case
switch xyz {
  case .x:
    doSomething()
}
```

```
// without -indent-switch-case
switch xyz {
case .x:
  doSomething()
}
```
2016-11-03 19:48:41 -07:00
Daniel Duan
f5ed77a032 Merge pull request #5093 from danielmartin/swift-format-SR-2619
[swift-format] Remove dependency on clang::tooling::Replacement
2016-10-29 22:44:23 -07:00
Bob Wilson
9cc68d6c9f Update for clang r283671: remove use of clEnumValEnd. 2016-10-15 11:02:20 -07:00
Daniel Martín
81f87e5e9d Remove dependency on clang::tooling::Replacement
Considering that formatting only affects a single compilation unit, and
that code formatting does not support line ranges yet, remove dependency
on clang::tooling::Replacement.

This fixes SR-2619.
2016-10-02 21:16:31 +02:00
Doug Gregor
580a2812a3 [Clang importer] Enable API notes alongside header/frameworks.
Enable newly-introduced Clang functionality to load API notes stored
alongside the headers for a module or, for a framework, in an APINotes
subdirectory within the framework. Fixes rdar://problem/28455644.
2016-09-28 00:13:16 -07:00
Michael Gottesman
d9882893b9 [swift-format] Check the llvm::Error returned by clang::tooling::Replacements::add to prevent abort.
llvm::Error's destructor has an assert in it that it was checked for success or
failure. This patch puts in a quick check for failure and emits a message to
llvm::errs() and returns failure (which in this case is indicating by returning
true).

A first class diagnostic should be added here, but given that I am preparing for
a stable merge update on a quick time schedule, I did the easy thing (with
respect to the message).
2016-08-31 14:07:18 -07:00
Michael Gottesman
78cb79a34d [upstream-update] clang::tooling::Replacements::insert() => clang::tooling::Replacements::add()
This is just a rename.
2016-08-30 23:14:51 -07:00
Michael Gottesman
fa1bb95923 Merge remote-tracking branch 'origin/master' into master-next 2016-08-30 19:50:12 -07:00
Michael Gottesman
7e2568dcf0 [cmake-components] Introduce a new API add_swift_host_tool for creating/initializing swift tool targets.
The main action here is to sink the creation of the installation rule for all of
the swift host tools into this API. In a latter commit, I will use this API to
create include and build rules for add_swift_host_tool.
2016-08-28 14:12:14 -07:00
Saleem Abdulrasool
2d50ed9ca3 [upstream-update] Link LLVMDebugInfoCodeView into 6 executable tools. (#4489)
All of these cases seem to need the symbols from LLVM's new CodeView library to
link.

The specific executables are:

1. Swift Driver.
2. SIL Extract.
3. SIL Opt.
4. Swift IDE Test.
5. Swift LLVM Opt.
6. LLDB Module Import Test
2016-08-26 02:20:45 -04:00
Robert Widmann
4ccf6c98dc Merge pull request #4191 from danielmartin/swift-format-documentation
Add swift-format documentation
2016-08-12 07:32:20 -07:00
Daniel Martín
14741c40bc Add swift-format documentation
Also, rename some options to improve consistency across the rest of the
driver options.
2016-08-10 17:43:49 +02:00
Daniel Martín
6902d9220c Use UINT_MAX instead of a "magic" upper bound
If a line range is not set, create a line range over the unsigned type,
instead of setting an arbitrary limit. We're not probably going to ever
deal with such big files, though.
2016-08-10 13:08:18 +02:00
Michael Gottesman
cae9dedde2 Merge pull request #3439 from danielmartin/swift-format-tool
swift-format tool
2016-08-08 21:54:32 -07:00
Daniel Martín
df15ec4f3b Swift-format driver tool
This driver tool formats Swift files or file ranges using some
parameters like tabs or spaces, tab width, or amount of spaces.
2016-08-08 11:07:15 +02:00
Han Sangjin
0747503b0f [Autolink] Autolinking on COFF for Cygwin/MinGW
Cygwin and MinGW should use the autolink feature in the sameway of Linux
due to the linker's limit. Now swift-autolink-extract recognizes the
COFF format file for Cygwin/MinGW.
2016-08-07 07:20:50 +09:00
Saleem Abdulrasool
8cb2029f24 driver: adopt to new Archive API
The archiving API was changed in SVN r275361.  Adjust accordingly.
2016-07-15 22:37:55 -07:00
Saleem Abdulrasool
dc078691dd driver: add braces
Adjust style as per gottesmm's request.
2016-07-01 19:38:00 -07:00
Saleem Abdulrasool
5ec5310f53 [upstream-update] driver: adapt to the new cl API
This was changed in the LLVM SVN r274171.
2016-07-01 10:33:08 -07:00
Vedant Kumar
51e4aef167 [driver] Simplify; use toString instead of handleAllErrors (NFC) 2016-06-27 20:36:14 -07:00
Vedant Kumar
21118978aa [stable-merge] [driver] Adopt new Error/Expected API 2016-06-27 11:12:54 -07:00
Michael Gottesman
7803a440f6 Use COMPONENT_DEPENDS instead of LINK_LIBRARIES when linking against llvm libraries. 2016-05-20 21:30:27 -07:00
Mark Lacey
859b779f15 Speculatively try a different fix for LLVMCoverage linker issues.
We're still hitting undefined symbols on Linux. Hopefully this clears
those up as well.
2016-05-06 17:02:22 -07:00
Mark Lacey
590cd6476e Link LLVMCoverage into tools that pull in references to it. 2016-05-03 21:41:54 -07:00
Mark Lacey
182b6dfb18 Merge remote-tracking branch 'origin/master' into master-next
Conflicts:
	tools/driver/CMakeLists.txt
	tools/swift-reflection-dump/swift-reflection-dump.cpp
2016-05-03 14:23:20 -07:00
John McCall
23f961bc0a Give the FrontendTool library its own header and allow users
to observe progress through the frontend.
2016-04-21 14:59:39 -07:00
John McCall
95eeabb025 Move the -frontend logic into its own library to allow re-use
and abstraction (to come).
2016-04-20 22:54:00 -07:00
Michael Gottesman
0c1f6db23b [upstream-update] Add our own LLVM global context now that llvm::getGlobalContext() was removed upstream.
Swift relies on this for now. So create our own. This makes more sense
than trying to add back in the API (which is dead besides the c api) or
use the c api itself. We should probably consider not using a global
context like this.
2016-04-18 07:29:58 -07:00
Doug Gregor
55f72405f5 Adjust for use of llvm::Expected as llvm::object::createBinary result. 2016-04-14 10:13:10 -07:00
John McCall
21e9f5949a Merge remote-tracking branch 'origin/master' into master-next 2016-04-08 13:29:39 -07:00
Saleem Abdulrasool
9571219927 driver: keep options ordered
The linker flags are order dependent.  Ensure that we preserve ordering.  Also
enhance it to support options which may be repeated (e.g. -rpath).
2016-04-01 17:18:25 -07:00
Michael Gottesman
140bcbc355 [upstream-update] Link LLVMDebugInfoCodeView into 6 executable tools.
All of these cases seem to need the symbols from LLVM's new CodeView library to
link.

The specific executables are:

1. Swift Driver.
2. SIL Extract.
3. SIL Opt.
4. Swift IDE Test.
5. Swift LLVM Opt.
6. LLDB Module Import Test
2016-03-26 02:01:19 -07:00
Saleem Abdulrasool
6749cfeafb build: install swift-autolink-extract as aux-driver-tools
swift supports cross-compilation.  The autolink extract tool is needed when
targeting non-Darwin targets even on Darwin.  Install it as the aux-driver-tools
component.  Update the Linux builds to install this component by default.
2016-03-22 09:38:53 -07:00
Slava Pestov
552a6ad1b7 Sema: Remove some dead code for "delayed members", NFC
This was added at some point to make 'import Foundation' faster in the REPL.
What we really care about though is not delaying synthesis of the rawValue
accessors (those are synthesized on demand anyway), but delaying the
conformance check to RawRepresentable.
2016-03-16 18:35:31 -07:00
Brian Gesiak
c6121d56b1 [Un-revert][Glibc] Configure modulemap for target, not host
This reverts commit f2154ee94d, which reverted 04e1cd5bda. The original
commit needed to be reverted because of an issue in which install
targets were added to OS X builds that did not target Linux. This
addresses that issue by guarding all the Linux-only CMake logic with a
check for the SDK being built.
2016-03-16 14:55:33 -04:00
Michael Ilseman
f2154ee94d Revert "[Glibc] Configure modulemap for target, not host" 2016-03-16 09:47:52 -07:00
Brian Gesiak
04e1cd5bda [Glibc] Configure modulemap for target, not host
The current Glibc CMakeLists.txt uses the host machine to determine
which modulemap to use. The same modulemap can't be used for all
platforms because headers are available in different locations on
different platforms.

Using the host machine to determine which modulemap to configure and
place at a specific path in the resource dir is fine, so long as:

1. Only one Glibc is being compiled in a single CMake invocation.
2. The target machine needs the same modulemap as the host.

https://github.com/apple/swift/pull/1442 violates both of these
assumptions: the Glibc module for both Linux and Android is compiled
at the same time, and the Android target can't use the Linux modulemap.

This commit instead uses the target(s) to determine which
modulemap to use. The modulemap is configured and placed in an OS-
and architecture-specific directory in the resource dir. The path to
that modulemap is referenced by the ClangImporter (since it is no
longer at a path that is automatically discovered as an implicit
modulemap).
2016-03-15 18:40:17 -04:00
practicalswift
993453978f [gardening] Fix formatting of recently introduced file header 2016-03-05 08:32:51 +01:00
Doug Gregor
da60535ced [Driver / API Notes] Re-introduce "-apinotes" driver flag to compile API notes.
Using Clang to compile API notes introduces a dependency on the
underlying Clang, which can cause problems as Clang's support for API
notes evolves. Re-introduce the "-apinotes" driver flag into the Swift
driver to allow us to compile API notes, and use that (rather than
Clang) to precompile API notes for the overlays.
2016-03-04 14:12:15 -08:00
Xi Ge
dd74e1c0ef [Serialization] Add a new front-end argument to specify the path of the group info file. NFC 2016-02-22 20:28:39 -08:00
Dmitri Gribenko
7235595264 Merge pull request #1108 from tinysun212/porting-to-cygwin
Porting to cygwin
2016-02-22 18:53:30 -08:00
Roman Levenstein
949471f629 Use SILOptions to decide if SIL needs to be optimized.
Checking IRGenOptions.Optimize was not the most direct and reliable way to detect if SIL needs to be optimized.
2016-02-21 22:33:23 -08:00