Commit Graph

1189 Commits

Author SHA1 Message Date
Vinicius Vendramini
e123750c12 Add option to dump AST to files
This adds two things:
- Calling `swiftc -dump-ast foo.swift [...] -o foo.ast` will dump the AST to the file `foo.ast`, instead of dumping it to `stderr` as usual.
- Calling `swiftc -dump-ast -output-file-map=outputFileMap.json *.swift [...]`, given an `outputFileMap.json` file that contains entries in the form `"ast-dump": "foo.ast"`, will dump the ASTs of the input files to their respective output files in the file map.

This should serve as a valid workaround to a bug mentioned in [the forums](https://forums.swift.org/t/error-when-dumping-the-ast-for-hundreds-of-files/17578) where the AST dump functionality crashes when called with too many input files. A few implementation details were also discussed in the same forum post.

As an aside, this also fixes a comment in `include/swift/Basic/PrimarySpecificPaths.h` that was incorrect.
2018-11-14 13:38:01 -02:00
Han Sang-jin
859f144b75 [LangOptions] os(Cygwin) is not true on Cygwin
`Target.isOSWindows()` and `Target.isWindowsCygwinEnvironment()` are both true in Cygwin.
We should check the `os(Cygwin)` before `os(Windows)`.
2018-11-10 11:23:00 +09:00
Ted Kremenek
748dae7d10 Merge remote-tracking branch 'upstream/master' into swift5-version
# Conflicts:
#	validation-test/stdlib/HashedCollectionFilter3.swift
#	validation-test/stdlib/HashingPrototype.swift
2018-11-09 09:39:22 -08:00
swift-ci
7e70c3c2bd Merge remote-tracking branch 'origin/master' into master-next 2018-11-06 16:29:56 -08:00
Ted Kremenek
46510a5eba Bump compiler version to Swift 5.
Main pieces:

- Bump swift-version to 5
- Remove -swift-version 3 support
2018-11-06 14:38:55 -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
Bob Wilson
5a8a38c692 Merge remote-tracking branch 'origin/master' into master-next 2018-11-06 11:12:09 -08:00
Graydon Hoare
e272ece309 Merge pull request #20170 from graydon/text-interface-to-module
Switch from .sid files to using FILE_DEPENDENCY records in INPUT_BLOCK
2018-11-06 07:52:09 -08:00
swift-ci
b201d947f9 Merge remote-tracking branch 'origin/master' into master-next 2018-11-05 20:09:53 -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
swift-ci
b3863e592e Merge remote-tracking branch 'origin/master' into master-next 2018-11-02 13:10:10 -07: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
swift-ci
0b62e5ba16 Merge remote-tracking branch 'origin/master' into master-next 2018-11-02 10:09:49 -07:00
Graydon Hoare
4938b002b4 [ModuleInterface] Remove SwiftParseableInterfaceDeps files, use INPUT_BLOCK. 2018-11-01 10:51:16 -07:00
Saleem Abdulrasool
c3555cf0c4 add_swift_host_library: special handling for GYB sources 2018-10-31 12:46:31 -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
Saleem Abdulrasool
e0b839330d add_swift_host_library: remove C_COMPILE_FLAGS 2018-10-31 12:46:31 -07:00
swift-ci
a6f698d89e Merge remote-tracking branch 'origin/master' into master-next 2018-10-27 15:29:52 -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
Bob Wilson
fcc9847432 Merge remote-tracking branch 'origin/master' into master-next 2018-10-21 09:05:34 -07:00
Graydon Hoare
dc006e883a [ModuleInterface] Add new SwiftParseableInterfaceDeps file type (.sid). 2018-10-18 00:31:24 -07:00
swift-ci
0f1060b1bd Merge remote-tracking branch 'origin/master' into master-next 2018-10-12 16:15:13 -07:00
Nathan Hawes
b1c8013701 Merge pull request #19782 from nathawes/incremental-parsing-bug
[incrParse] Fix bug mapping a node's location back to its location in the cached syntax tree
2018-10-12 15:43:11 -07:00
Saleem Abdulrasool
ccacfe7a73 swift: update for LLVM SVN r344140
Update swift's usage of clang::vfs which has been hoisted into LLVM.
2018-10-12 11:16:58 -07:00
swift-ci
1ff59f7d73 Merge remote-tracking branch 'origin/master' into master-next 2018-10-12 02:49:36 -07:00
Graydon Hoare
4f315363f8 [ModuleInterface] Change TY_SwiftModuleInterfaceFile to TY_SwiftParseableInterfaceFile 2018-10-11 23:56:19 -07:00
Nathan Hawes
5c568af436 [incrParse] Fix bug mapping a node's location back to its location in the cached syntax tree
Also fix Edit::intersectsOrTouchesRange check only returning true when the
ranges overlapped, rather than when they overlapped or 'touched'.

Resolves rdar://problem/45108439
2018-10-08 15:44:38 -07:00
swift-ci
e9ec2ed51f Merge remote-tracking branch 'origin/master' into master-next 2018-09-26 15:09:36 -07:00
Jordan Rose
ceaa5db623 Merge pull request #17960 from danielmartin/new-unary-operator-ifconfig
[Parser] Support "<" unary operator in #if swift() and #if compiler() expressions
2018-09-26 15:00:48 -07:00
swift-ci
d61986d1ff Merge remote-tracking branch 'origin/master' into master-next 2018-09-21 15:49:35 -07:00
Nathan Hawes
44f4df49df [sourcekit] Fix line+column -> offset conversion when on the last line of a file with no terminating newline
This was causing local refactorings (which are line+column-based) to fail due to
the provided location being considered invalid, even though the available
refactorings request (which uses offset directly) reported them as available.
2018-09-20 18:25:45 -07:00
swift-ci
d5b96980be Merge remote-tracking branch 'origin/master' into master-next 2018-09-14 09:09:31 -07:00
Saleem Abdulrasool
4baa775726 Merge pull request #19297 from compnerd/unreachable
litter the tree with `llvm_unreachable`
2018-09-14 09:04:56 -07:00
swift-ci
1b6d88c145 Merge remote-tracking branch 'origin/master' into master-next 2018-09-13 19:09:15 -07:00
Graydon Hoare
5a563f59af [Stats] Add SWIFTC_MAXIMUM_DETERMINISM to inhibit parallelism everywhere. 2018-09-13 16:15:49 -07:00
Saleem Abdulrasool
d281b98220 litter the tree with llvm_unreachable
This silences the instances of the warning from Visual Studio about not all
codepaths returning a value.  This makes the output more readable and less
likely to lose useful warnings.  NFC.
2018-09-13 15:26:14 -07:00
swift-ci
2bcd5e4d1d Merge remote-tracking branch 'origin/master' into master-next 2018-09-05 00:49:58 -07:00
swift-ci
6f3b6182bc Merge pull request #15665 from graydon/everybody-gets-a-tracer 2018-09-05 00:46:20 -07:00
swift-ci
b0c2e834d8 Merge remote-tracking branch 'origin/master' into master-next 2018-09-04 14:29:18 -07:00
Saleem Abdulrasool
0314bb1dc2 Basic: guard against nullptr for env
`env` is a default'ed parameter.  In some cases it may be passed a `nullptr`,
which is not a valid parameter to `llvm::toStringRefArray`.  Guard against this
case.  This allows the swift compiler to work again on Windows!
2018-09-04 11:48:51 -07:00
Graydon Hoare
1c87229104 [Stats] Flush Stats profiles and tracers at SILModule lifecycle boundary. 2018-09-01 00:05:58 -07:00
Graydon Hoare
044157821e [Stats] Assert main-thread-only use of UnifiedStatsReporter. 2018-09-01 00:05:58 -07:00
swift-ci
02c48440da Merge remote-tracking branch 'origin/master' into master-next 2018-08-31 20:29:37 -07:00
Harlan
dc1bc823e6 [InterfaceGen] Remove #ifs from default arguments (#19075)
* [InterfaceGen] Remove #ifs from default args

This patch removes all #if configs form the bodies of default arguments,
which can contain multiline closures, while preserving the bodies of the
clauses that are active.

This code is generalized and should "just work" for inlinable function
bodies, which will come in a later patch.

* Address review comments

* Fix and test CharSourceRange.overlaps

* Fix CharSourceRange::print to respect half-open ranges
2018-08-31 20:18:48 -07:00
swift-ci
c7f0e2379b Merge remote-tracking branch 'origin/master' into master-next 2018-08-31 16:09:23 -07:00
Saleem Abdulrasool
468d9c36bc Merge pull request #19056 from compnerd/no-wait
Basic: use new signature for `ExecuteNoWait`
2018-08-31 15:58:03 -07:00
swift-ci
7ba60653c9 Merge remote-tracking branch 'origin/master' into master-next 2018-08-30 17:50:54 -07:00
swift-ci
88c41c6560 Merge pull request #19072 from graydon/sometimes-a-memory-aint-enough 2018-08-30 17:46:44 -07:00
Graydon Hoare
e7d0e0d47e [Stats] Only update process-wide counters for frontends. 2018-08-30 14:55:07 -07:00