Commit Graph

1508 Commits

Author SHA1 Message Date
David Ungar
34f423fb5b Add clarifying comment to forEachInputNotProducingSupplementaryOutput. 2018-05-09 20:55:46 -07:00
David Ungar
02fcbf7226 optional pointer to consumer replaces NullDiagnosticConsumer placeholder 2018-05-09 18:09:40 -07:00
swift-ci
b0ecce5779 Merge remote-tracking branch 'origin/master' into master-next 2018-05-04 15:49:29 -07:00
David Ungar
22a75183c1 Merge pull request #16319 from davidungar/max-radix
Fix argument name in ArgsToFrontendOptionsConverter::setUnsignedIntegerArgument.
2018-05-04 15:32:08 -07:00
swift-ci
294d611e54 Merge remote-tracking branch 'origin/master' into master-next 2018-05-03 16:49:37 -07:00
David Ungar
037a2c813b Add cutoff to limit time taking to check exhaustiveness of switch statement. 2018-05-03 10:30:15 -07:00
David Ungar
c04585c413 Fix argument name in ArgsToFrontendOptionsConverter::setUnsignedIntegerArgument. 2018-05-02 16:20:15 -07:00
swift-ci
7056b65bf5 Merge remote-tracking branch 'origin/master' into master-next 2018-05-02 15:09:04 -07:00
Jordan Rose
df2e63d07d Diagnose modules with circular dependencies (#16075)
This can't arise from a clean build, but it can happen if you have
products lingering in a search path and then either rebuild one of
the modules in the cycle, or change the search paths.

The way this is implemented is for each module to track whether its
imports have all been resolved. If, when loading a module, one of its
dependencies hasn't resolved all of its imports yet, then we know
there's a cycle.

This doesn't produce the best diagnostics, but it's hard to get into
this state in the first place, so that's probably okay.

https://bugs.swift.org/browse/SR-7483
2018-05-02 15:01:09 -07:00
swift-ci
c12d46675a Merge remote-tracking branch 'origin/master' into master-next 2018-04-30 17:49:07 -07:00
Huon Wilson
1283b54678 Merge pull request #16251 from huonw/no-std-function
std::function -> llvm::function_ref for some non-escaping params.
2018-05-01 10:30:16 +10:00
swift-ci
13ab622cba Merge remote-tracking branch 'origin/master' into master-next 2018-04-30 17:09:26 -07:00
Huon Wilson
d4f49a1252 [IDE] std::function -> llvm::function_ref for some non-escaping params. 2018-05-01 08:29:06 +10:00
David Zarzycki
0f26cb7b40 [Frontend] NFC: Remove unused parameter 2018-04-30 16:38:32 -04:00
David Zarzycki
95473a10d7 [Misc] NFC: Fix random build warnings
Unused variables/methods, language extensions, extra semicolons, intentional
self assignment, platform specific quirks, etc.
2018-04-30 12:52:43 -04:00
swift-ci
efa08425d7 Merge remote-tracking branch 'origin/master' into master-next 2018-04-27 09:49:01 -07:00
Alex Hoppen
00604fb3dc [libSyntax] Add -verify-syntax-tree frontend flag
This will parse the source file into a libSyntax tree and verify that no
unknown nodes exist within it
2018-04-27 07:51:08 -07:00
swift-ci
b87673dc82 Merge remote-tracking branch 'origin/master' into master-next 2018-04-27 00:29:08 -07:00
Slava Pestov
175b40919f AST: Fewer headers include Expr.h, Module.h, Stmt.h 2018-04-26 22:55:26 -07:00
swift-ci
4ad1d595fe Merge remote-tracking branch 'origin/master' into master-next 2018-04-20 17:07:24 -07:00
Jordan Rose
797901fc41 Enable @unknown default warnings by default in Swift 5 mode (#16045)
Note that I said "warnings"; we're going to be more cautious about
rollout and just make this a warning in Swift 5 mode, with /no/
diagnostics in Swift 3 and 4. Users are still free to use `@unknown
default` in these modes, and they'll get a fatal run-time error if
they don't and an unexpected case actually shows up.

rdar://problem/29324688
2018-04-20 17:04:31 -07:00
swift-ci
8d3c88657f Merge remote-tracking branch 'origin/master' into master-next 2018-04-19 01:29:47 -07:00
Slava Pestov
55633e8d06 IRGen: New way of bypassing resilience for LLDB
When running Swift from within LLDB, we need to bypass resilience since LLDB
does not support resilience yet. However, the bypass was done too early as
part of the module loader, which had the effect of disabling resilience
altogether.

We still want resilience at the SIL level so that function types lower the
same with debugger support turned on and off. Only IRGen needs to bypass
resilience, so that LLDB can calculate fragile layouts of types. Also, the
DebuggerSupport flag is not always set in the ASTContexts created by LLDB.

So replace it with a new flag that only controls this behavior and nothing
else, and make it part of IRGenOptions to make it totally clear that it only
impacts IRGen.

Together with the paired LLDB change, fixes <rdar://problem/38719739>
and <rdar://problem/38483762>.
2018-04-18 21:06:49 -07:00
swift-ci
a1b34f4b95 Merge remote-tracking branch 'origin/master' into master-next 2018-04-17 16:09:36 -07:00
Slava Pestov
45f3f013b0 Remove -disable-sil-linking frontend flag 2018-04-17 15:10:22 -07:00
swift-ci
d2cb1fbee9 Merge remote-tracking branch 'origin/master' into master-next 2018-04-16 11:08:33 -07:00
swift-ci
80defe51b7 Merge pull request #15950 from gottesmm/pr-ad010a566f73a3f80c1bce1ac1d652208c260c8b 2018-04-16 10:51:52 -07:00
swift-ci
f34fcf47cd Merge remote-tracking branch 'origin/master' into master-next 2018-04-16 10:48:14 -07:00
Michael Gottesman
26a569b33c [stringref-upgrade] Change FrontendInputsAndOutputs::numberOfPrimaryInputsEndingWith to take a StringRef instead of a const char *.
This is in prepration for changing Strings.h to use StringLiteral.
2018-04-16 09:50:54 -07:00
Michael Gottesman
87d633b4cd [stringref-upgrade] Return a StringRef from suffixForPrincipalOutputFileForAction instead of a const char *.
This is in prepration for changing Strings.h to use StringLiteral.
2018-04-16 09:50:26 -07:00
swift-ci
0d728ccabb Merge remote-tracking branch 'origin/master' into master-next 2018-04-10 07:29:08 -07:00
Slava Pestov
c7853fe086 IRGen: Bring back the -enable-class-resilience staging flag 2018-04-09 21:53:45 -07:00
swift-ci
43ff3494c2 Merge remote-tracking branch 'origin/master' into master-next 2018-04-09 16:21:22 -07:00
Slava Pestov
81cf1d951d SIL: Remove -sil-link-all frontend flag
It was only used in a few tests. Those tests now use -emit-sil instead
of -emit-silgen, with some functions marked @_transparent and a few
CHECK: lines changed now that the mandatory optimizations get to run.
2018-04-09 13:27:52 -07:00
swift-ci
d7744cc9c1 Merge remote-tracking branch 'origin/master' into master-next 2018-04-07 16:10:18 -07:00
John McCall
7815892a76 Add unique typo corrections to the main diagnostic with a fix-it.
Continue to emit notes for the candidates, but use different text.
Note that we can emit a typo correction fix-it even if there are
multiple candidates with the same name.

Also, disable typo correction in the migrator, since the operation
is quite expensive, the notes are never presented to the user, and
the fix-its can interfere with the migrator's own edits.

Our general guidance is that fix-its should be added on the main
diagnostic only when the fix-it is highly likely to be correct.
The exact threshold is debateable.  Typo correction is certainly
capable of making mistakes, but most of its edits are right, and
when it's wrong it's usually obviously wrong.  On balance, I think
this is the right thing to do.  For what it's worth, it's also
what we do in Clang.
2018-04-07 16:01:39 -04:00
swift-ci
d5f8d23d40 Merge remote-tracking branch 'origin/master' into master-next 2018-03-31 12:48:59 -07:00
Xi Ge
991cc77d48 migrator: teach the driver to support multiple migration script sets. (#15637)
To support migration from both Swift 3 and 4, this patch
teaches the driver to pick up the right set of migration scripts
according to the given Swift version. We also pushed some placeholder script
files for migration from Swift 4. This patch also brings the migrator
up-to-date by avoiding migration if the Swift version is already 4.2.
2018-03-31 12:37:49 -07:00
swift-ci
d9a8a02d81 Merge remote-tracking branch 'origin/master' into master-next 2018-03-30 18:08:54 -07:00
Vedant Kumar
ca27e829ba Add a transform to help test lldb expression evaluation
The initial version of the debugger testing transform instruments
assignments in a way that allows the debugger to sanity-check its
expression evaluator.

Given an assignment expression of the form:

```
  a = b
```

The transform rewrites the relevant bits of the AST to look like this:

```
  { () -> () in
    a = b
    checkExpect("a", stringForPrintObject(a))
  }()
```

The purpose of the rewrite is to make it easier to exercise the
debugger's expression evaluator in new contexts. This can be automated
by having the debugger set a breakpoint on checkExpect, running `expr
$Varname`, and comparing the result to the expected value generated by
the runtime.

While the initial version of this testing transform only supports
instrumenting assignments, it should be simple to teach it to do more
interesting rewrites.

There's a driver script available in SWIFT_BIN_DIR/lldb-check-expect to
simplfiy the process of launching and testing instrumented programs.

rdar://36032055
2018-03-30 16:50:31 -07:00
swift-ci
bead5b930a Merge remote-tracking branch 'origin/master' into master-next 2018-03-26 14:32:05 -07:00
Michael Gottesman
0bc86e095f Replace -enable-guaranteed-normal-arguments with -disable-guaranteed-normal-arguments.
rdar://38874323
2018-03-26 12:25:22 -07:00
swift-ci
f50b8130d3 Merge remote-tracking branch 'origin/master' into master-next 2018-03-25 17:09:22 -07:00
Sho Ikeda
869b6bf7d8 Merge pull request #15473 from ikesyo/frontend-using-over-typedef
[gardening][Frontend] Replace `typedef` with `using`
2018-03-26 08:57:42 +09:00
swift-ci
39976fa7d8 Merge remote-tracking branch 'origin/master' into master-next 2018-03-25 16:09:10 -07:00
Jordan Rose
02a2af60b3 [Frontend] Move the argument converter header files into lib/ (#15417)
...since they don't need to be accessed from other libraries. No
intended functionality change.
2018-03-25 16:01:23 -07:00
Sho Ikeda
f737add594 [gardening][Frontend] Replace typedef with using 2018-03-24 10:15:48 +09:00
David Ungar
3376ca741d Add frontend check to ensure that all primaries are present in the supplementary output filemap. 2018-03-22 14:57:27 -07:00
David Ungar
807dd5864e Renamed swift::types to swift::file_types. 2018-03-22 08:40:06 -07:00
David Ungar
e3535ff3d8 Merge pull request #15371 from davidungar/PR-18-11-fileMap-redo
[Batch mode] Write out filemaps for supplementary outputs.
2018-03-21 17:05:36 -07:00