695 Commits

Author SHA1 Message Date
David Farler
645aaad551 [index/build] Upstream indexing while building changes
This patch upstreams previously AppleInternal changes for
indexing while building.
2017-06-29 16:20:06 -07:00
Greg Parker
7b009eccde Merge remote-tracking branch 'origin/master' into master-next 2017-06-28 15:25:17 -07:00
Michael Gottesman
3617134b69 [upstream-update] llvm::opt::filtered_{begin,end} => llvm::opt::filtered. 2017-06-22 21:17:01 -07:00
George Karpenkov
479aeca88c Addressing code review comments. 2017-06-16 13:26:46 -07:00
George Karpenkov
9637bd2c36 Change driver logic for sanitizers support.
With this patch different sanitizers (tsan/asan) will be enabled or
disabled on the driver level on a particular OS depending on whether
the required library is present.

The current patch only supports Darwin architectures, but Linux support
should not be hard to add.
2017-06-16 13:26:46 -07:00
swift-ci
e057a05fbe Merge remote-tracking branch 'origin/master' into master-next 2017-06-14 16:28:39 -07:00
Mishal Shah
c5ff1f2cac Update master to build with Xcode 9 beta 1, OS X 10.13, iOS 11, tvOS 11, and watchOS 4 SDKs. 2017-06-14 16:20:35 -07:00
swift-ci
6a0b7391f8 Merge remote-tracking branch 'origin/master' into master-next 2017-06-14 14:08:42 -07:00
Erik Verbruggen
97b9886a70 Do stricter checking of -D command-line arguments
Check if the condition "name" is a proper identifier, and generate an
error when assigning specific values in -D conditions.

Fixes SR-2404.
2017-06-13 23:19:08 -07:00
swift-ci
6afda14ba8 Merge remote-tracking branch 'origin/master' into master-next 2017-06-07 15:48:34 -07:00
Argyrios Kyrtzidis
ffd9e952d8 Merge pull request #10158 from akyrtzi/persistent-pch-diag-file
[driver] For the persistent bridging PCH job action, make sure to pass a serialized diagnostics path in the PCH output directory
2017-06-07 15:34:24 -07:00
Argyrios Kyrtzidis
563a37f053 [driver] For the persistent bridging PCH job action, make sure to pass a serialized diagnostics path in the PCH output directory
Previously it was passing a relative filename and the invocation was creating .dia files in the source directory.
If a filename is not determined for inside the PCH output directory, it fallsback to creating a temporary for the diagnostics file,
similarly to the non-persistent bridging PCH job.

rdar://32594291
2017-06-07 15:08:05 -07:00
swift-ci
54af467191 Merge remote-tracking branch 'origin/master' into master-next 2017-06-03 00:28:33 -07:00
Graydon Hoare
7fc8bd270b [Stats] Tidy up stray characters in filenames. 2017-06-02 23:42:38 -07:00
swift-ci
6366c9fe1c Merge remote-tracking branch 'origin/master' into master-next 2017-06-02 20:28:33 -07:00
Graydon Hoare
e10f483477 [Stats] Mangle a little more information into the file & timer names.
This helps disambiguate files that might otherwise be hard to sort through
if multiple runs output stats together in a single directory. The names
don't have to be perfect, just contain sufficient hints (and be parseable)
to differentiate module, arch, opt and output-type variation in jobs.
2017-06-02 18:08:31 -07:00
swift-ci
d07f8e33e7 Merge remote-tracking branch 'origin/master' into master-next 2017-05-23 14:28:33 -07:00
Jordan Rose
45e5116683 [Driver] Don't remove temporary PCH files on crashes either. (#9881)
Follow-up to a875d8c7c.
2017-05-23 14:20:31 -07:00
swift-ci
0b164991ae Merge remote-tracking branch 'origin/master' into master-next 2017-05-13 16:48:31 -07:00
Argyrios Kyrtzidis
a6a3ebee6c [Driver] For the persistent PCH job there is no output path, the frontend determines the filename to use.
Previously the parseable output would have an empty string as the output of the PCH job, this fixes the issue.
2017-05-13 14:59:18 -07:00
swift-ci
4c56317e58 Merge remote-tracking branch 'origin/master' into master-next 2017-05-12 07:48:34 -07:00
Argyrios Kyrtzidis
4391ecc802 [Driver] For the 'emit persistent PCH' job, don't set an output filename. 2017-05-11 16:24:51 -07:00
Argyrios Kyrtzidis
c4b5b60d00 [Driver/ClangImporter] Changes for the driver to recognize -pch-output-dir and propagate to the frontend invocations
For the multiple-files mode -emit-pch is still invoked in separate frontend invocation but with using a persistent PCH.
Subsequent frontend invocations use the persistent PCH but they don't need to validate it.

For all-files mode (e.g. WMO) the frontend invocation uses a persistent PCH that it also validates.
2017-05-11 11:44:12 -07:00
swift-ci
502bda365b Merge remote-tracking branch 'origin/master' into master-next 2017-05-05 13:48:34 -07:00
practicalswift
492f5cd35a [gardening] Remove redundant repetition of type names (DRY): RepeatedTypeName foo = dyn_cast<RepeatedTypeName>(bar)
Replace `NameOfType foo = dyn_cast<NameOfType>(bar)` with DRY version `auto foo = dyn_cast<NameOfType>(bar)`.

The DRY auto version is by far the dominant form already used in the repo, so this PR merely brings the exceptional cases (redundant repetition form) in line with the dominant form (auto form).

See the [C++ Core Guidelines](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#es11-use-auto-to-avoid-redundant-repetition-of-type-names) for a general discussion on why to use `auto` to avoid redundant repetition of type names.
2017-05-05 09:45:53 +02:00
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