Commit Graph

270 Commits

Author SHA1 Message Date
swift-ci
cdde06ac25 Merge remote-tracking branch 'origin/master' into master-next 2017-04-27 15:56:02 -07:00
David Farler
63776b507b When converting some of the old Migrator automation to the new Migrator,
I had set up the driver to invoke a separate frontend invocation with
the "update code" mode. We sort of did this last release, except we
forked to the swift-update binary instead. This is causing problems with
testing in Xcode.

Instead, let's perform a single compile and add the remap file as an
additional output during normal compiles. The driver, seeing
-update-code, will add -emit-remap-file-path $PATH to the -c frontend
invocation.

rdar://problem/31857580
2017-04-27 01:03:00 -07:00
Huon Wilson
45bda6fe79 [Frontend] Change LOADED_MODULE_TRACE_PATH -> ..._FILE.
Accidentally wrote down the wrong name initially.
2017-04-25 13:19:49 -07:00
swift-ci
2d8df36a08 Merge remote-tracking branch 'origin/master' into master-next 2017-04-21 13:28:31 -07:00
Huon Wilson
9c6c7c5105 [Driver] Support the SWIFT_LOADED_MODULE_TRACE_PATH env var.
This overrides -emit-loaded-module-trace (etc.).
2017-04-21 11:14:30 -07:00
Huon Wilson
7e8568d03d [Driver] Main compiler tells frontend to -emit-loaded-module-trace. 2017-04-21 11:14:29 -07:00
Huon Wilson
87aa3e6935 [Frontend] -frontend -emit-loaded-module-trace.
The -frontend jobs can output a JSON file summarizing the
swiftmodules (etc.) they load during compilation.
2017-04-21 11:14:29 -07:00
swift-ci
0a7a14e29c Merge remote-tracking branch 'origin/master' into master-next 2017-04-17 16:28:36 -07:00
David Farler
303a3e5824 Start the Migrator library
The Swift 4 Migrator is invoked through either the driver and frontend
with the -update-code flag.

The basic pipeline in the frontend is:

- Perform some list of syntactic fixes (there are currently none).
- Perform N rounds of sema fix-its on the primary input file, currently
  set to 7 based on prior migrator seasons.  Right now, this is just set
  to take any fix-it suggested by the compiler.
- Emit a replacement map file, a JSON file describing replacements to a
  file that Xcode knows how to understand.

Currently, the Migrator maintains a history of migration states along
the way for debugging purposes.

- Add -emit-remap frontend option
  This will indicate the EmitRemap frontend action.
- Don't fork to a separte swift-update binary.
  This is going to be a mode of the compiler, invoked by the same flags.
- Add -disable-migrator-fixits option
  Useful for debugging, this skips the phase in the Migrator that
  automatically applies fix-its suggested by the compiler.
- Add -emit-migrated-file-path option
  This is used for testing/debugging scenarios. This takes the final
  migration state's output text and writes it to the file specified
  by this option.
- Add -dump-migration-states-dir

  This dumps all of the migration states encountered during a migration
  run for a file to the given directory. For example, the compiler
  fix-it migration pass dumps the input file, the output file, and the
  remap file between the two.

  State output has the following naming convention:
  ${Index}-${MigrationPassName}-${What}.${extension}, such as:
  1-FixitMigrationState-Input.swift

rdar://problem/30926261
2017-04-17 16:25:02 -07:00
Bob Wilson
07019d964d Update Swift master-next after LLVM API change in r300135. 2017-04-13 12:30:04 -07:00
Graydon Hoare
0245c83c4b [Stats] Add -stats-output-dir, wire UnifiedStatsReporter into place. 2017-04-03 18:08:59 -07:00
Huon Wilson
fba2ab49dc Merge pull request #8301 from huonw/symbol-list
Initial TBD push: list of (some) public symbols
2017-03-29 12:48:22 -07:00
Huon Wilson
4eff6f1374 [FrontendTool] -emit-tbd and -validate-tbd-against-ir flags.
These, respectively, write a list of symbols to a file, and compare what
that list would be against the "true" list (the symbol names in the IR).
2017-03-28 16:31:09 -07:00
Matthew Carroll
d12daa736a [Driver] SR-2396: Driver should have a -verify-debug-info option
Add a -verify-debug-info option that invokes dwarfdump --verify as the last step after running dsymutil. dwarfdump is invoked with same options clang 802.0.35 uses to invoke it:

dwarfdump --verify --debug-info --eh-frame --quiet

A warning is produced if -verify-debug-info is set and no debug option is also set.

dwarfdump is failing to validate the debug info in the test verify-debug-info.swift. The failure is:
error: .debug_line[0x0000007d].row[0].file = 1 is not a valid index

https://bugs.swift.org/browse/SR-2396
2017-03-24 16:42:39 -04:00
swift-ci
099effd29b Merge pull request #8119 from huonw/imported-modules 2017-03-20 17:52:41 -07:00
Huon Wilson
55b2ba2524 [Frontend] Add -emit-imported-modules: listing modules imported by the current one.
This is purely designed to cheaply compute dependency graphs between
modules, and thus only lists the top-level names (i.e. not submodules)
and doesn't do any form of semantic analysis.
2017-03-17 18:44:03 -07:00
Graydon Hoare
d711c0443f [Bridging PCH] Only emit deps for CompileJobActions rdar://31016087 2017-03-14 17:39:59 -07:00
Matthew Carroll
69ae6cd588 [Driver] SR-3352: Warn on and ignore -embed-bitcode when not generating object files (#7962)
Commands like -emit-sil and -emit-module (on its own) do not produce object files.
When -embed-bitcode is also set, the driver runs a backend job to generate a module that fails.
This commit emits a warning instead and ignores the -embed-bitcode option.

https://bugs.swift.org/browse/SR-3352
2017-03-07 15:19:08 -08:00
Graydon Hoare
fae468f951 [Bridging PCH] Serialize diagnostics in -emit-pch step. 2017-03-06 15:11:44 -08:00
Graydon Hoare
ec5d4f3ea1 [Driver] Put new job-lifecycle diagnostic chatter behind another option. 2017-03-01 09:07:21 -08:00
Hugh Bellamy
f001b7562b Use relatively new LLVM_FALLLTHROUGH instead of our own SWIFT_FALLTHROUGH 2017-02-12 10:47:03 +07:00
Graydon Hoare
cf5a227fee [Bridging PCH] Make -enable-bridging-pch the default. 2017-02-06 14:49:03 -08:00
Bob Wilson
34514513fd Merge remote-tracking branch 'origin/master' into master-next 2017-01-15 17:34:17 -08:00
Graydon Hoare
e1b0cc909c [Bridging PCH] Add -enable-bridging-pch option, set default to disabled. 2017-01-13 15:18:41 -08:00
Graydon Hoare
3b0b8c3270 [Bridging PCH] Auto-generate and use temporary bridging PCHs from driver. 2017-01-13 15:18:40 -08:00
Graydon Hoare
a95f5da86d [Bridging PCH] Add -emit-pch to Frontend; call emitBridgingPCH. 2017-01-13 15:18:39 -08:00
Bob Wilson
c765d5e3a5 Merge remote-tracking branch 'origin/master' into master-next 2017-01-12 15:58:19 -08:00
Sean Callanan
399709ccb8 Optionally separate Tasks` stderr from stdout.
Fixes a serious problem where spurious output from xcrun breaks
swift's discovery of libarclite.

<rdar://problem/28573949>
2017-01-11 11:11:23 -08:00
Bob Wilson
37e7d1c627 Merge remote-tracking branch 'origin/master' into master-next 2017-01-08 17:07:46 -08:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
Bob Wilson
deddf19aae Merge remote-tracking branch 'origin/master' into master-next 2016-12-13 10:23:03 -08:00
Jordan Rose
300d690ce0 [Driver] Remove unused "ToolChains" map from the Driver class. (#6114)
We only ever make one toolchain, and it's passed around explicitly
everywhere it's needed.

No functionality change.
2016-12-06 17:27:52 -08:00
Bob Wilson
13da3fa8b1 Merge remote-tracking branch 'origin/master' into master-next 2016-12-04 18:16:09 -08:00
David Farler
6d8514b2a3 Add back the -parse flag, which doesn't typecheck 2016-11-28 10:50:55 -08:00
David Farler
b7d17b25ba Rename -parse flag to -typecheck
A parse-only option is needed for parse performance tracking and the
current option also includes semantic analysis.
2016-11-28 10:50:55 -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
Bob Wilson
f10ae47b9f Merge remote-tracking branch 'origin/master' into master-next 2016-11-15 17:32:28 -08:00
Brian Gesiak
6a2d466e4b Merge pull request #5377 from modocache/sr-2855-malformed
[Driver] Show incremental is off with bad JSON
2016-11-14 15:07:56 -05:00
Brian Gesiak
847278e295 [Driver] Show incremental is off with bitcode, WMO
SR-2855 suggests `-driver-show-incremental` not only print information
about why certain files are included in incremental compilation, but
also print out why incremental compilation may be disabled altogether.

Add a message for two such reasons:

1. When whole module compilation is enabled, since optimizations for
   WMO require a full rebuild.
2. When embedding LLVM IR bitcode, which needs to be re-generated.
2016-11-12 16:54:26 -05:00
Bob Wilson
956c7150d5 Tweak my previous changes for reading and writing times.
As far as I know, the previous code worked OK but this version seems
cleaner.
2016-11-09 10:40:40 -08:00
Brian Gesiak
7a21445083 [Driver] Show incremental is off with bad JSON
SR-2855 suggests `-driver-show-incremental` not only print information
about why certain files are included in incremental compilation, but
also print out why incremental compilation may be disabled altogether.

Add a message for one such reason: when the build record file is
malformed.
2016-11-05 13:28:40 -07:00
Bob Wilson
564fc6f22d Clean up my changes for llvm r284966.
Sorry -- I meant to include this with the previous commit. LLVM is
moving away from llvm::sys:TimeValue in favor of std::chrono. For consistency
with LLVM, I used the new llvm::sys::TimePoint type in most places.
There are a few places, like the SourceKit files modified here, where it
makes more sense to use std::chrono directly.
2016-10-28 13:17:26 -07:00
Bob Wilson
5c4f517824 Checkpoint fixes for llvm r284966 (TimeValue) 2016-10-28 12:09:57 -07:00
Brian Gesiak
0e760b532d Show args mismatch in -driver-show-incremental
SR-2855 suggests `-driver-show-incremental` not only print information
about why certain files are included in incremental compilation, but
also print out why incremental compilation may be disabled
altogether.

Add a message for one such reason: when the arguments passed to the Swift
compiler don't match the ones used previously.
2016-10-19 21:54:39 -04:00
Brian Gesiak
c2002ea485 Show inputs mismatch in -driver-show-incremental
SR-2855 suggests `-driver-show-incremental` not only print information
about why certain files are included in incremental compilation, but
also print out why incremental compilation may be disabled altogether.

Add a message for one such reason: when the inputs passed to the
Swift compiler don't match the ones used previously.
2016-10-19 15:13:25 -04:00
Brian Gesiak
88ac6181bb Show version mismatch in -driver-show-incremental
SR-2855 suggests `-driver-show-incremental` not only print information
about why certain files are included in incremental compilation, but
also print out why incremental compilation may be disabled altogether.

Add a message for one such reason: when the version of the Swift
compiler being used to incrementally compile doesn't match the one used
to compile previously.
2016-10-17 18:56:09 -04:00
Brian Gesiak
685a952675 [Driver] Fix typo "BackenJobAction" (NFC) 2016-09-23 09:09:31 -04:00
practicalswift
b057000640 [gardening] Fix recently introduced typos 2016-09-22 17:16:13 +02:00
Graydon Hoare
8970d44675 Add "-swift-version <n>" that sets LangOpts.EffectiveLanguageVersion.
This flag switches the "effective language version" of the compiler,
at least to any version supported (as of this change: "3" or "3.0").

At the moment nothing uses it except the language version build
configuration statements (#if swift(...)) and various other places
that report, encode, or otherwise check version numbers.

In the future, it's intended as scaffolding for backwards compatibility.

Fixes SR-2582
2016-09-20 15:11:37 -07:00
Doug Gregor
4e214687ca [WIP Name binding] Introduce a basic 'scope map' to model scopes in the AST.
The scope map models all of the name lookup scopes within a source
file. It can be queried by source location to find the innermost scope
that contains that source location. Then, one can follow the parent
pointers in the scope to enumerate the enclosing scopes.

The scope map itself is lazily constructed, only creating scope map
nodes when required implicitly (e.g, when searching for a particular
innermost scope) or forced for debugging purposes.

using a lazily-constructed tree that can be searched by source
location. A search within a particular source location will
2016-09-02 17:13:05 -07:00