Commit Graph

1737 Commits

Author SHA1 Message Date
swift-ci
87652fe449 Merge remote-tracking branch 'origin/master' into master-next 2018-08-28 17:29:51 -07:00
Jordan Rose
c89ce68359 Fix comment typo in e224e31720 (#19019) 2018-08-28 17:21:57 -07:00
swift-ci
0be8a7293d Merge remote-tracking branch 'origin/master' into master-next 2018-08-28 09:49:38 -07:00
Jordan Rose
e224e31720 Break almost all dependencies of Driver on Frontend
- Sink OutputFileMap{.h,.cpp} and ReferenceDependencyKeys.h to Basic
- Remove unnecessary includes of Frontend.h.
2018-08-27 20:47:58 -07:00
Bob Wilson
8aa01ec974 [master-next] Add HermitCore OS type for LLVM triples
LLVM r340675 added a new HermitCore OS type to triples, which broke the
Swift build because it is using -Werror,-Wswitch and the new value was not
handled in swift::getPlatformNameForTriple
2018-08-27 10:37:20 -07:00
Graydon Hoare
a25dd40fb9 [Stats] Clear all timers on print, since they stopped self-clearing recently. 2018-08-25 01:24:24 -07:00
Saleem Abdulrasool
0605f7b2d7 Merge pull request #18911 from compnerd/arrayref-update
Basic: update the use of the `ExecuteNoWait` API
2018-08-24 14:47:43 -07:00
Alex Hoppen
077d8e8a90 [swiftBasic] Simplify bound checks for ExponentialGrowthAppendingBinaryByteStream 2018-08-23 20:44:21 -07:00
Alex Hoppen
49f2e14094 [swiftBasic] Use a SmallVector as the underlying storage for ExponentialGrowthAppendingBinaryByteStream 2018-08-23 09:00:27 -07:00
Alex Hoppen
ff68452301 [swiftBasic] Introduce an exponentially growing appending binary stream
It is more efficient than llvm::AppendingBinaryByteStream if a lot of
small data gets appended to it because it doesn't need to resize its
buffer on each write.
2018-08-23 08:14:02 -07:00
Saleem Abdulrasool
dd0dd7b2d1 Basic: update the use of the ExecuteNoWait API
This now takes `ArrayRef<StringRef>` and `Optional<ArrayRef<StringRef>>`
parameters.  Explicitly update the interfaces to match.  This is particularly
important to repair the Windows build.
2018-08-22 15:34:29 -07:00
Saleem Abdulrasool
4aa137f789 Basic: guard inclusion of unistd.h on non-Unices
unistd.h is a Unix specific header.  Ensure that we do not try to include it on
non-unix environments (i.e. Windows).  This attempts to restore the Windows
build once again.
2018-08-21 09:48:59 -07:00
Graydon Hoare
fe5667a4b6 [Stats] Change NumInstructions to NumInstructionsExecuted, accept 0 when on VMs. 2018-08-16 13:19:36 -07:00
Graydon Hoare
bdb00fceb0 Add Frontend.NumInstructions statistic, populated on macOS by rusage_info_v4. 2018-08-11 23:28:57 -07:00
swift-ci
df3895a653 Merge remote-tracking branch 'origin/master' into master-next 2018-08-02 12:29:14 -07:00
Daniel Martín
e66095b10a [Parser] Support "<" unary operator in #if swift() expressions
Until now, only ">=" was supported in #if swift() expressions, for example:

```#if swift(>=2.1)
```#endif

This means that if we want to evaluate code only when the language version is
less than a particular version we need to do the following:

```#if !swift(>=2.1)
```#endif

An alernative to make this more readable (the "!" can be easily missed in a code
review) is to introduce another supported unary operator, "<". The previous
example could be rewritten like this:

```#if swift(<2.1)
```#endif

This commit adds support for that unary operator, along with some tests.
2018-08-02 20:35:58 +02:00
Michael Gottesman
7e70389b80 [upstream-update] Do not specify OpenFlags since it was removed upstream.
This was removed upstream in https://reviews.llvm.org/D47789 since the only
place this flag was used was in the windows implementation where the behavior
triggered by this could be hidden in the implementation instead of being an
argument. As such, this code doesn't compile on master-next.

Since this has an acceptable default argument given the current stable, we can
just fix this on master and everything will work.

rdar://42862352
2018-08-02 11:34:54 -07:00
swift-ci
19cb223a66 Merge remote-tracking branch 'origin/master' into master-next 2018-08-01 18:49:02 -07:00
Jordan Rose
1dd415ae68 Add a new helper, atomicallyWritingToFile, and use it
This replaces the use of a Clang utility function that was
inexplicably a non-static member function of CompilerInstance. It
would be nice to sink this all the way to LLVM and share the
implementation across both projects, but the Clang implementation does
a handful of things we don't need, and it's hard to justify including
them in an LLVM-level interface. (I stared at
llvm/Support/FileSystem.h for a long time before giving up.)

Anyway, Serialization and FrontendTool both get their atomic writes
now without depending on Clang, and without duplicating the
scaffolding around the Clang API. We should probably adopt this for
all our output files.

No functionality change.
2018-08-01 16:41:21 -07:00
swift-ci
fe2b1bbd3a Merge remote-tracking branch 'origin/master' into master-next 2018-07-31 19:29:10 -07:00
Robert Widmann
917e94d11c Introduce SourceManager::getDisplayNameForLoc
Add an abstraction to retrieve a name suitable for display for a given
source location for use with diagnostics, debug locations, and magic
file literals.
2018-07-31 13:16:14 -07:00
Robert Widmann
0e58b7fd14 Plumbing for a Virtual File System
Adds the -vfsoverlay frontend option that enables the user to pass
VFS overlay YAML files to Swift. These files define a (potentially
many-layered) virtual mapping on which we predicate a VFS.

Switch all input-based memory buffer reads in the Frontend to the new
FileSystem-based approach.
2018-07-31 13:16:14 -07:00
swift-ci
cfc685f7cb Merge remote-tracking branch 'origin/master' into master-next 2018-07-30 08:48:53 -07:00
Alex Hoppen
88937f93c4 Merge pull request #18295 from ahoppen/json-serialization-improvements
[libSyntax] JSON serialization improvements
2018-07-30 08:46:16 -07:00
Alex Hoppen
7593682c98 [JSONSerialization] Make key a StringRef
Most keys are string literals and if they are converted directly to
StringRef, the string length can be computed at compile time, increasing
performance.
2018-07-27 16:20:34 -07:00
Alex Hoppen
07b449bbd5 [JSONSerialization] Introduce ScalarReferenceTraits
For ScalarTraits, a buffer was always created on the heap to which the
scalar string value was written just to be copied to the output buffer
again. In case the value already exists in a memory buffer it is way
cheaper to avoid the heap allocation and copy it straight to the output
buffer.
2018-07-27 16:20:34 -07:00
swift-ci
9711455ad8 Merge remote-tracking branch 'origin/master' into master-next 2018-07-26 14:49:10 -07:00
Jordan Rose
a5899ee93a Minor improvements to file_types
No intended functionality change.
2018-07-25 22:23:00 -07:00
Jordan Rose
67a6a4ff18 Move swift/Frontend/FileTypes.h down to Basic
The next commit will take advantage of this, but this is just a
mechanical change.
2018-07-25 22:23:00 -07:00
swift-ci
9b12d01fc2 Merge remote-tracking branch 'origin/master' into master-next 2018-07-17 09:09:17 -07:00
Alex Hoppen
3bf94abbfc Merge pull request #17621 from ahoppen/002-sytnax-tree-based-coloring
[libSyntax] Syntax colouring based on the syntax tree
2018-07-17 08:54:51 -07:00
Alex Hoppen
dfad6f787f [Basic] Extract isEditorPlaceholder from Identifier to standalone function 2018-07-13 16:56:03 -07:00
swift-ci
f1db8dec9f Merge remote-tracking branch 'origin/master' into master-next 2018-07-11 17:49:17 -07:00
Jordan Rose
d11704bcc9 Add swift::getNonSimulatorPlatform for DarwinPlatformKind
And use it in getDarwinLibraryNameSuffixForTriple, making the logic
there clearer.

Suggested by David U!
2018-07-11 15:09:53 -07:00
Bob Wilson
a53091ee8a Merge remote-tracking branch 'origin/master' into master-next 2018-07-05 10:57:46 -07:00
Ben Cohen
a1adf9f347 Squash a few more unused warnings (#17743) 2018-07-05 08:24:17 -07:00
Bob Wilson
e468fae196 Merge remote-tracking branch 'origin/master' into master-next 2018-07-04 11:13:51 -07:00
Ben Cohen
2b04e9f105 Suppress a number of warnings in no-assert builds (#17721)
* Supress a number of warnings about things used only in asserts

* Re-use a couple of variables instead of supressing the warning
2018-07-04 07:15:14 -07:00
Bob Wilson
c3e02955bb [master-next] Adjust for VersionTuple moving from clang to llvm.
LLVM r334399 (and related Clang changes) moved clang::VersionTuple to
llvm::VersionTuple. Update Swift to match.

Patch by Jason Molenda.
rdar://problem/41025046
2018-06-12 16:44:11 -07:00
Bob Wilson
796122fa45 Merge remote-tracking branch 'origin/master' into master-next 2018-06-12 15:06:47 -07:00
Doug Gregor
346bb99f73 [Evaluator] GraphViz printing for all of the dependencies.
Introduce another form of debugging dump for the evaluator, rendering the
complete dependency graph using GraphViz, including all dependencies and
values cached within the evaluator.
2018-06-01 08:56:18 -07:00
Doug Gregor
4ac125f41f [Evaluator] Introduce a simple request evaluator.
Meant as a replacement for the barely-started iterative type checker,
introduce a simpler "evaluator" that can evaluate individual requests
(essentially, function objects with some additional API), caching
results as appropriate and detecting cycles.
2018-06-01 08:56:18 -07:00
swift-ci
a5f7641e9e Merge remote-tracking branch 'origin/master' into master-next 2018-05-30 17:08:56 -07:00
Saleem Abdulrasool
6111d4deed Basic: move TaskQueue serialization
The implementation is small and would need to be replicated into the
default implementation.  Move the definition into the common TaskQueue
implementation.  This repairs the Windows build of the compiler.
2018-05-30 11:53:54 -07:00
swift-ci
141f04e2e2 Merge remote-tracking branch 'origin/master' into master-next 2018-05-25 17:09:00 -07:00
Benjamin Herzog
ac10fb3462 [Driver] Added process information to emitted messages
When providing the -parseable-output flag to the swift compiler, it will provide json formatted messages about tasks that run.
I added some optional usage information in form of user time, system time and maxrss to the output. This can be used by other tools using the compiler to get some insights about time and memory usage.
Since the output does not longer match processes run (in batch mode), I also added a real_pid field so the client could reason about jobs that belong together if needed.

rdar://39798231
2018-05-25 13:12:57 -07:00
swift-ci
9d02f94670 Merge remote-tracking branch 'origin/master' into master-next 2018-05-22 10:49:24 -07:00
Alex Hoppen
8998b27dd4 [incrParse] Add coloured output indicating which code got reused 2018-05-22 08:52:34 -07:00
swift-ci
336e42ee2c Merge remote-tracking branch 'origin/master' into master-next 2018-05-17 15:09:01 -07:00
Graydon Hoare
dcbbafae6f <rdar://40182303> Fix typo in error message, on failure to write stats file. 2018-05-17 13:03:07 -07:00