Commit Graph

466 Commits

Author SHA1 Message Date
Slava Pestov
6248628961 Merge remote-tracking branch 'origin/master' into master-next 2019-08-09 15:51:48 -04:00
David Ungar
f64033a2d2 Manual rebase with master 2019-08-06 22:13:20 -07:00
swift-ci
25a82d2273 Merge remote-tracking branch 'origin/master' into master-next 2019-07-24 15:09:59 -07:00
Varun Gandhi
0205a10998 Add information on direct imports and library evolution to trace file.
Pending: support for tracking depedencies through -import-underlying-module
and -import-objc-header.

Fixes rdar://problem/51825495 and rdar://problem/51825644.
2019-07-23 16:25:41 -07:00
swift-ci
7f46a4a7fb Merge remote-tracking branch 'origin/master' into master-next 2019-07-22 16:10:11 -07:00
Jordan Rose
cd4018e80c Dump PrettyStackTrace on Ctrl-T in a frontend job (#26234)
It'll dump it for all the frontend jobs spawned from a driver, too,
but then the driver will buffer the response, so it's not that useful.

Requires LLVM r365911.
2019-07-22 15:55:33 -07:00
Jordan Rose
f0d9088f56 [ModuleInterface] Use SDK-relative deps in forwarding modules too
Apart from not having to write out the SDK path, this allows us to
properly distinguish system and non-system dependencies. (Well, as
properly as we were doing before this commit, i.e. whether something
comes from the SDK.)

Groundwork for rdar://problem/53279521
2019-07-18 18:38:30 -07:00
David Ungar
06527db4ab Merge pull request #24594 from davidungar/A5-7-ASTOOScope-rebased
[NameLookup] ASTOOScope ontology
2019-06-14 08:03:09 -07:00
David Ungar
69f6b41a13 Use unique_ptr for Scope, getScope returns a reference 2019-06-12 07:29:00 -07:00
Jordan Rose
0f45437104 -build-module-from-parseable-interface: Don't make an extra ASTContext (#25185)
This mode is supposed to get all its configuration information from
the switftinterface being read in, but that means that the ASTContext
and ClangImporter that get created by default may not be a sensible
configuration (for example, a mismatched target and SDK, which Clang
emits a warning about). Avoid this by just not creating the ASTContext
if it's already been determined that the frontend is building a module
from a parseable interface.
2019-06-01 15:27:17 -07:00
Slava Pestov
ec1b1a390a AST: Remove ASTContext::ExternalDefinitions
Anything added here has a type checked body now, so it no longer
serves any purpose.
2019-05-28 22:08:30 -04:00
David Ungar
173bc0970c Only need NameLookup for the ASTScope interface class. 2019-05-28 11:01:55 -07:00
David Ungar
c7a6f8008f Clean up 2019-05-28 10:55:34 -07:00
David Ungar
663760e3b7 ASTOOScope ontology 2019-05-28 10:48:22 -07:00
Harlan Haskins
ca5b94f7d9 [Frontend] Re-add FrontendObserver methods (#24917)
These observer methods were used by external clients. Since we no longer
have the granularity between diagnostics and optimization, they're
rolled into a new observer callback, `performedSILProcessing`.

This (effectively) reverts commit 7b43e1d04d.
2019-05-20 21:33:33 -07:00
Harlan Haskins
5cb98bfe80 [ModuleInterface] Pass -Rmodule-interface-rebuild to sub-invocation (#24737)
Previously, we wouldn't pass this flag to sub-invocations, which means
that if we had to fall back and recompile a transitive import, we
wouldn't get a remark.

rdar://50729662
2019-05-13 12:56:18 -07:00
Jordan Rose
3eff026bbf [ModuleInterfaces] Warn emitting without -enable-library-evolution
Module interfaces don't yet carry enough information to correctly
describe the binary interface of a module compiled without
-enable-library-evolution, but we don't want to make this an error
because that would make it harder to work towards getting it in the
future.
2019-05-01 17:32:12 -07:00
Jordan Rose
73b7185a3d [ModuleInterfaces] Warn emitting an interface in -swift-version 4[.2]
If the project ever drops Swift 4 mode or Swift 4.2 mode, that would
break modules using those modes in their interface, so put an
unsilenceable warning in for using those modes to nudge interface
emitters to Swift 5.

rdar://problem/47792595
2019-05-01 17:32:12 -07:00
Slava Pestov
33b548f8b0 AST: Remove SourceFile::UsedConformances
Sema no longer adds conformances to a per-SourceFile list that it thinks
are going to be "used" by SILGen, IRGen and the runtime. Instead, previous
commits already ensure that SILGen determines the set of conformances to be
emitted, triggering conformance checking as needed.
2019-04-25 22:32:27 -04:00
Harlan Haskins
e5456984f7 [ModuleInterfaces] Remove 'parseable' from command-line flags
Leave the old flag in as an alias to the new flag, for transition
purposes. Also go ahead and remove the long-deprecated and unused
`emit-interface-path`.

Part of rdar://49359734
2019-04-11 18:05:09 -07:00
David Ungar
cf5d81c889 Merge pull request #23735 from davidungar/tracking-primary
[Batch mode] Cope with bugs that cause error  suppression.
2019-04-05 17:45:20 -07:00
David Ungar
c8cd0f3bc0 Move location lookup to RAII object. 2019-04-04 22:41:53 -07:00
David Ungar
240b573966 WIP 2019-04-04 21:55:25 -07:00
David Ungar
aafc2a3dda Better idiom for sometimes RAII. 2019-04-04 16:59:32 -07:00
David Ungar
8448da303d Use MSF not mainInputFilenameForDebugInfo 2019-04-04 15:36:53 -07:00
David Ungar
5c837323a0 WIP 2019-04-04 13:58:08 -07:00
David Ungar
7428feef72 Format 2019-04-03 16:21:20 -07:00
David Ungar
d0330523d0 suppress non-primary errors if there is no responsible primary 2019-04-03 16:19:45 -07:00
David Ungar
44daa88ebd Format 2019-04-03 12:53:31 -07:00
David Ungar
9cc3a4a9d8 Rename defaultDiagnosticLoc to bufferIndirectlyCausingDiagnostic. 2019-04-03 12:52:49 -07:00
David Ungar
fd63a1ea73 Change strategy for non-primaries
No more vacuous subconsumers. Output into active primary or everywhere.
2019-04-03 11:38:58 -07:00
Nathan Hawes
f683373116 [ParseableInterface] Respect -track-system-dependencies with -build-module-from-parseable-interface
Updates the subinvocation that builds the parseable interface to respect the
-track-system-dependencies flag of the top-level invocation if present, by
including system dependencies in the produced .swiftmodule.
2019-04-03 06:34:29 -07:00
David Ungar
0baa668920 Format 2019-04-02 22:28:38 -07:00
David Ungar
c139c5909a Pass defaultDiagnosticLoc to handleDiagnostic, not currentPrimaryInput. 2019-04-02 22:27:55 -07:00
David Ungar
c90d9e69b6 Format 2019-04-02 00:43:59 -07:00
David Ungar
7a0e0ffc8a Store current primary in diagnostic engine, pass it down via handleDiagnostic. Unformmated. 2019-04-02 00:43:28 -07:00
Harlan Haskins
366bbf48b9 [ParseableInterface] Add ‘forwarding modules’
A ‘forwarding module’ is a YAML file that’s meant to stand in for a .swiftmodule file and provide an up-to-date description of its dependencies, always using modification times.

When a ‘prebuilt module’ is first loaded, we verify that it’s up-to-date by hashing all of its dependencies. Since this is orders of magnitude slower than reading mtimes, we’ll install a `forwarding module` containing the mtimes of the now-validated dependencies.
2019-03-07 11:36:15 -08:00
Saleem Abdulrasool
d30a2ababd FrontendTool: fix escaping of filenames in Makefile
The dependency file that is being generated should not escape : and # in
the filename.  This makes the behaviour of the filename escaping similar
to clang and GCC and fixes incorrect quoting of paths on Windows.
2019-02-19 10:51:26 -08:00
David Ungar
26ef59f576 Fixes from master 2019-01-24 18:46:49 -08:00
David Ungar
b520b242dc Collapsed lots of changes. 2019-01-24 18:46:49 -08:00
Michael Gottesman
4fd45930f8 [sil-optimizer] At -Onone serialize when running the Onone optimization pipeline instead of after running SIL passes.
NOTE: This is not in the mandatory passes (which run before this). This will
enable me to strip out ownership after we serialize without touching frontend
code. It also makes Onone and O use the same code paths for serialization
instead of one happening in the driver (Onone today) and the other in a SIL pass
(-O, -Osize).

The reason that I updated the sil-func-extractor test is that I found a bug in
how we emit sib files, namely if you try to emit a sib file to stdout, the
llvm-bcanalyzer flags it as malformed. If I output the .sib into a file rather
than trying to use stdout, everything works.
2019-01-14 10:33:58 -08:00
Jordan Rose
614deb640b [ParseableInterface] Pass prebuilt cache path down to sub-invocations
Otherwise, the top-level compilation gets the benefit of the prebuilt
cache path, but the sub-invocations for swiftinterfaces that /do/
need to be compiled do not.
2018-12-21 15:41:17 -08:00
Jordan Rose
37708ede6e Add frontend mode -build-module-from-parseable-interface
Makes it easier to test the caching behavior, and may also be useful
for "prebuilding" swiftinterfaces in the future, or having the Driver
kick off a bunch of separate builds as proper tasks.
2018-12-13 11:18:05 -08:00
Adrian Prantl
ff63eaea6f Remove \brief commands from doxygen comments.
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.

Patch produced by

      for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
2018-12-04 15:45:04 -08:00
Harlan Haskins
f5cf517f6a [Frontend] Factor out SIL processing code to Frontend
This lets us reuse the logic for running optimization passes between regular frontend invocations and parseable interface compilation.
2018-12-03 13:17:35 -08:00
Harlan Haskins
7b43e1d04d [FrontendTool] [NFC] Reduce scope of FrontendObserver
These APIs weren't used.
2018-11-29 19:18:56 -08:00
Saleem Abdulrasool
19a76ea042 FrontendTool: fix a use-after-move on Windows
The order of evaluation of arguments is undefined by the language
specification.  Windows evaluates right to left rather than left to
right.  This means that the argument was getting moved away before
initializing the first formal argument.  Use a temporary to construct
the value to avoid the use-after-move.
2018-11-21 14:23:59 -08:00
Vinicius Vendramini
39d3963131 Fix broken tests
- Many tests got broken because of two things:
  - AST dump now outputs to stdout, but many tests expected stderr. This was a straightforward fix.
  - Many tests call swift with specific parameters; specifically, many call `swift frontend` directly. This makes them go through the compiler in unexpected ways, and specifically it makes them not have primary files, which breaks the new AST dump implementation. This commit adds the old implementation as a fallback for those cases, except it dumps to `stdout` to maintain some consistence.

Finally, the `/test/Driver/filelists.swift` failed for unknown reasons. It seems its output now had some lines out of order, and fixing the order made the test pass. However, as the reasons why it failed are unknown, this fix might not have been a good idea. Corrections are welcome.
2018-11-14 13:38:01 -02:00
Vinicius Vendramini
5e9997d7f0 Add a FIXME to warn about potential WMO bugs. 2018-11-14 13:38:01 -02:00
Vinicius Vendramini
d392c2af04 Fixes from the code review.
- Adds a space after the `for`;
- Changes `Instance` to use `getASTContext` directly.
- The `getFileOutputStream` method already checks for the `"-"` file name and returns `stdout` in that case. Replace the current (redundant) check with that one, and therefore replace the current default (`stderr`) with `stdout`.
2018-11-14 13:38:01 -02:00