Commit Graph

453 Commits

Author SHA1 Message Date
Xi Ge
a7a06d7ce3 FrontendTool: parse all delayed member decls when we're dumping parse tree or verifying parse diagnostics. 2018-09-12 19:40:28 -07:00
Graydon Hoare
1c87229104 [Stats] Flush Stats profiles and tracers at SILModule lifecycle boundary. 2018-09-01 00:05:58 -07:00
Xi Ge
ce29c64964 [Evaluator] Refactor evaluator's GraphViz output to the destructor of the evaluator. NFC
This allows us to output dependency-graph while using the compiler in
other tools, like swift-ide-test, sourcekitd-test, etc.
2018-08-28 18:16:44 -07:00
Ben Cohen
428c580158 Fix unused variable warnings in release builds. (#18755) 2018-08-16 11:46:45 -06:00
Harlan Haskins
75e219543e [TBDGen] Enable TBD generation after -typecheck 2018-08-15 15:33:26 -07:00
Harlan Haskins
14a7ae56db [TBDGen] Remove TBD options from FrontendOptions
This patch removes the duplication between FrontendOptions and
TBDGenOptions by parsing the TBDGenOptions up front similarly to IRGen
and SIL options.
2018-08-15 14:53:44 -07:00
Harlan
7318efe49d [TBDGen] Allow user-provided dylib version flags (#18716)
* [TBDGen] Allow user-provided dylib version flags

This patch adds two frontend arguments, -tbd-compatibility-version and
-tbd-current-version, both of which accept SemVer versions.

These will show up in the generated TBD file for a given module as

current-version: 2.7
compatibility-version: 2.0

These flags both default to `1.0.0`.

* Reword some comments

* Add test for invalid version string

* Expand on comments for TBD flags
2018-08-15 11:42:42 -07:00
Jordan Rose
061204c704 Remove "IFK_" prefix from enum class InputFileKind
I suspect this was converted from a non-scoped enum in the past.
No functionality change.
2018-08-07 08:54:31 -07:00
David Ungar
f74b7e5178 Merge pull request #18489 from davidungar/rdar-42314665-fix-batch-mode-truncation-bug
[Batch Mode] Rdar 42314665 fix batch mode truncation bug
2018-08-06 22:04:36 -07:00
David Ungar
b4d942945a Rename local variable. 2018-08-06 10:12:04 -07:00
David Ungar
11c1f0f01e Format 2018-08-03 22:49:09 -07:00
David Ungar
cd3c82d9e2 Addressing comments. 2018-08-03 22:48:13 -07:00
David Ungar
1af9741dc7 format 2018-08-03 09:11:09 -07:00
David Ungar
cb3af7c0d4 factoring and commenting 2018-08-03 09:10:43 -07:00
David Ungar
dc952441a0 Format 2018-08-02 21:15:21 -07:00
David Ungar
67c8d9c357 Make Subconsumer into a class. 2018-08-02 21:14:49 -07:00
David Ungar
01582a2fe3 Rename ConsumerPair -> Subconsumer 2018-08-02 20:44:01 -07:00
swift-ci
df3895a653 Merge remote-tracking branch 'origin/master' into master-next 2018-08-02 12:29:14 -07: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
0204561269 [Frontend] Factor out textual interface generation into its own file
No functionality change.
2018-08-01 16:41:21 -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
Jordan Rose
e8e0584785 Hook up -emit-interface-path to a simple AST printer
We'll want more complexity soon, but this is a start.
2018-08-01 14:34:29 -07:00
swift-ci
660cab88ee Merge remote-tracking branch 'origin/master' into master-next 2018-08-01 08:49:46 -07:00
Robert Widmann
501a5ef782 Merge pull request #18410 from CodaFi/in-sib-id-attitudes
Refine The Frontend's Understanding of SwiftOnoneSupport
2018-08-01 08:37:20 -07:00
swift-ci
fe2b1bbd3a Merge remote-tracking branch 'origin/master' into master-next 2018-07-31 19:29:10 -07:00
Robert Widmann
3defe3b7a9 Refine The Frontend's Understanding of SwiftOnoneSupport
Continuing work from #18344, be more conservative about when we load
SwiftOnoneSupport.  Specifically, -emit-silgen and -emit-sibgen, despite
not going through the SIL Optimizer, may silently introduce dependencies
on SwiftOnoneSupport.

Because we want to support the ability to posthumously compile SILGen
and SIBGen'd files with these implicit dependencies, and because SIL
is not yet capable of expressing the dependency itself, we must always
assume we need to load SwiftOnoneSupport.
2018-07-31 17:25:39 -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
f7b8996498 Merge remote-tracking branch 'origin/master' into master-next 2018-07-30 20:59:23 -07:00
Slava Pestov
b15c9d7129 Implement a -dump-type-info frontend action 2018-07-30 18:38:47 -07:00
swift-ci
9711455ad8 Merge remote-tracking branch 'origin/master' into master-next 2018-07-26 14:49:10 -07:00
Jordan Rose
97b152d71e Consistently get extensions from swift/Basic/FileTypes.h (part 2)
Remove the last few literal extension strings from Strings.h in favor
of the file_types APIs, and use those APIs in a few more places.
2018-07-25 22:23:01 -07:00
swift-ci
817e5e80e7 Merge remote-tracking branch 'origin/master' into master-next 2018-07-19 16:49:18 -07:00
Huon Wilson
103170bcbb Merge pull request #17688 from huonw/merging-tbd
Allow TBD files to be generated in non-wmo mode
2018-07-20 09:44:50 +10:00
Robert Widmann
79b38ba6f3 Merge pull request #18083 from CodaFi/system-of-a-down
Add -track-system-dependencies Flag
2018-07-19 16:29:50 -07:00
Huon Wilson
2e3e6558b7 [Driver] Pass -emit-tbd through to -frontend -merge-modules, to get TBD files without -wmo.
Fixes rdar://problem/33735706
2018-07-20 08:12:22 +10:00
Robert Widmann
d845112695 Add -track-system-dependencies Flag
Add a flag to configure the behavior of the Clang Importer's dependency tracker with respect to system dependencies.
2018-07-19 13:03:30 -07:00
swift-ci
c4feb3611d Merge remote-tracking branch 'origin/master' into master-next 2018-07-18 17:09:20 -07:00
Alex Hoppen
1df1dc71b7 Merge pull request #18016 from ahoppen/003-incremental-syntax-coloring
[libSyntax] Incremental syntax colouring
2018-07-18 17:08:02 -07:00
Alex Hoppen
6635be10ea [libSyntax] Add UserInfo to json::Output
This will allow us to customize the serialization of a syntax tree like
not serializing the node's IDs.
2018-07-18 13:35:10 -07:00
swift-ci
e6011356fb Merge remote-tracking branch 'origin/master' into master-next 2018-07-13 14:39:37 -07:00
Robert Widmann
2282065197 Rename "Name Binding" action to "Resolve Imports" 2018-07-13 11:00:48 -07:00
Robert Widmann
cb1e9dd821 Introduce Name Binding as a Frontend Action
Introduces the -name-bind frontend action that is intended as an intermediary between the parse-only actions and a full typechecking pass.  In this phase, module imports will be validated and resolved, making it possible to emit full make-style dependencies files among other things.

Note that all information available to a parse-only pass is available to name binding, but because it does not continue-on to typecheck input files, full semantic information is not.
2018-07-13 10:56:03 -07:00
swift-ci
27a2e9d09d Merge remote-tracking branch 'origin/master' into master-next 2018-06-27 21:29:27 -07:00
Huon Wilson
8d257c256f [TBD] Validate TBDs in debug compilers for all platforms.
This is generalizing caa3dd4d29 to work even on
non-Apple platforms.

Fixes rdar://problem/40431434.
2018-06-28 14:16:32 +10:00
Huon Wilson
0c4fe6cef2 Merge pull request #16838 from huonw/validate-tbd-by-default
[Frontend] Turn symbols-missing-from-TBD validation on by default in debug builds on Apple platforms.
2018-06-28 14:11:09 +10:00
Huon Wilson
caa3dd4d29 [Frontend] Turn symbols-missing-from-TBD validation on by default in debug builds on Apple platforms.
TBD validation is effectively an expensive assertion, and is currently only
tuned for Apple platforms. However, we don't want it to regress more, and it
would be nice to start getting validation from people using master
snapshots. Together, this means that turning it on by default for the cases
mentioned above is an appropriate course of action.

At the very least, this has the benefit of running validation across the stdlib,
the overlays and the whole testsuite on each build, so people making changes to
the compiler that change symbols are hopefully alerted.

One limitation here is that this is only validating that the TBD is a superset
of the true set of symbols: it could include spurious symbols that aren't
actually in the binary. This case is less problematic for Swift than symbols
missing from the TBD file, and so we've focused energy on this. Once we've fixed
the extra-symbols problems and are confident in it, this validation can be
upgraded to validate that too.

Half of rdar://problem/40431434.
2018-06-28 10:34:45 +10:00
swift-ci
116de13e22 Merge remote-tracking branch 'origin/master' into master-next 2018-06-22 01:09:58 -07:00
swift-ci
846e1cb880 Merge pull request #17420 from DougGregor/evaluator-stats-reporting 2018-06-22 00:56:08 -07:00
Doug Gregor
197642d37b [Request-evaluator] Track # of evaluations for each request kind.
Using the unified stats reporter, track the # of evaluations for each
type checking request kind.
2018-06-22 00:01:55 -07:00