Commit Graph

441 Commits

Author SHA1 Message Date
Varun Gandhi
0f277aca15 [Frontend] Avoid crashing in trace emission due to "duplicate" swiftinterfaces. 2019-11-01 11:26:51 -07:00
swift-ci
ae278ae961 Merge remote-tracking branch 'origin/master' into master-next 2019-10-30 14:50:00 -07:00
Owen Voorhees
8a6711769e [Diagnostics] Refactor DiagnosticConsumer interface
DiagnosticInfo now holds all the information needed to consume
a diagnostic, so remove unneeded parameters from handleDiagnostic.
2019-10-29 13:52:12 -07:00
Xi Ge
64c0680686 Merge remote-tracking branch 'apple/master' into master-next 2019-10-28 10:19:36 -07:00
Varun Gandhi
ab1381a808 [Frontend] Weaken validation when emitting a trace. (#27737)
Fixes rdar://problem/56333192.
2019-10-17 09:32:10 -07:00
Varun Gandhi
903add2c3f [Frontend] Make the module trace emission more robust.
✔ More informative error messages in case of crashes.
✔ Handling and documenting different cases.
✔ Test cases for different cases.
✔ Make SDKDependencies.swift pass again.
2019-10-15 15:44:26 -07:00
swift-ci
31004db03c Merge remote-tracking branch 'origin/master' into master-next 2019-10-03 18:29:24 -07:00
Slava Pestov
55a6693da8 Frontend: -emit-silgen exits with non-zero status code if a diagnostic was emitted 2019-10-03 17:11:44 -04:00
swift-ci
abcec82ca5 Merge remote-tracking branch 'origin/master' into master-next 2019-09-22 19:30:00 -07:00
David Ungar
3c891f9532 Fully eager for printing, just eager enough for type-checking. 2019-09-22 17:59:40 -07:00
swift-ci
6e2d90770c Merge remote-tracking branch 'origin/master' into master-next 2019-09-17 09:09:58 -07:00
Jordan Rose
94265e8163 [Frontend] Add a comment about 9e6d4db (#27169)
With wording help from David U.
2019-09-17 09:05:23 -07:00
swift-ci
0c440ff5ef Merge remote-tracking branch 'origin/master' into master-next 2019-09-13 20:49:32 -07:00
Harlan Haskins
c82c9b8210 [ModuleInterfaces] Remove references to 'parseable' interfaces everywhere
Now that we've settled on Module Interface as the name, let's remove the
vestiges of "Parseable Interfaces"
2019-09-13 14:55:48 -07:00
Harlan Haskins
fafc5832fe [ModuleInterfaces] ParseableInterfaceModuleLoader -> ModuleInterfaceLoader
Rename this class to better fit the user-facing name.
2019-09-13 13:40:01 -07:00
swift-ci
cdffb88fe8 Merge remote-tracking branch 'origin/master' into master-next 2019-09-12 18:10:45 -07:00
Jordan Rose
9e6d4db6d0 [Frontend] Avoid doing whole-module work under primary-file typecheck (#27153)
...a situation we get into with indexing. The way Xcode generates
indexing invocations is to take a build command and add additional
flags to it; in order for the Driver to produce a single frontend
command from /that/, it currently plans as if it's going to do a
whole-module -typecheck and then turns around and uses -primary-file
anyway. This is questionable practice, to be sure...

...but meanwhile, let's not crash by trying to access declarations
that haven't been type-checked yet.

rdar://problem/53117124
2019-09-12 17:53:06 -07:00
Mike Ash
f5e7ab866c Merge branch 'master' into master-next 2019-09-09 12:11:25 -04:00
Slava Pestov
859b37e782 Frontend: Only build and generate a single SILModule at a time
Instead of SILGen'ing all primary files before we go on to optimize
and IRGen them, run each file to completion before starting the next
one. This reduces memory usage.
2019-09-06 21:50:15 -04:00
Slava Pestov
01e65e18c4 SIL: Share TypeConverter between SILModules in batch mode 2019-09-06 21:50:15 -04:00
swift-ci
f4374ed77c Merge remote-tracking branch 'origin/master' into master-next 2019-09-03 09:49:53 -07:00
Varun Gandhi
4bd7a89bd6 Skip module trace emission if we encountered errors when compiling.
Fixes rdar://problem/54860311.
2019-08-30 16:14:18 -07:00
Arnold Schwaighofer
20efacf2d6 Merge remote-tracking branch 'upstream/master' into master-next 2019-08-26 13:30:41 -07:00
Jordan Rose
d8c823e159 Module trace: explicitly ignore the main module
I'm not sure why this wasn't already broken, but with the changes in
the next commit the multifile module trace test fails complaining that
it can't get a path for the main module. But we don't /need/ a path
for the main module because it's not a dependency of itself.
2019-08-23 17:40:45 -07:00
Jonas Devlieghere
b4d268e9e1 Migrate llvm::make_unique to std::make_unique
Now that we've moved to C++14, we no longer need the llvm::make_unique
implementation from STLExtras.h. This patch is a mechanical replacement
of (hopefully) all the llvm::make_unique instances in the swift repo.
2019-08-15 11:32:39 -07:00
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