Commit Graph

22 Commits

Author SHA1 Message Date
Kevin Moore 0236c5c051 pkg:analyzer_fe_comparison, diagnostics, telemetry remove version info
Until we plan to publish these, it helps tools track what are our public
packages

Change-Id: I5bb692fd6f3da5cfdc9b759d55375435c7885b83
Reviewed-on: https://dart-review.googlesource.com/c/87220
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
2018-12-13 16:44:44 +00:00
Kevin Millikin a8493e1b50 Flip the default value of the Kernel syncAsync flag
In Kernel's TargetFlags, this flag still defaulted to false.  Flip the
default to true and update all client code in the SDK.  The
expectation is that many of the places that now pass false explicitly
really just want the default, but that will be verified separately and
then the flag will be removed.

Change-Id: I2a38eb53f280f21f59bb1d2e88c42516f827fd39
Reviewed-on: https://dart-review.googlesource.com/c/85448
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2018-12-12 14:23:54 +00:00
Paul Berry ce1eac3800 Adapt analyzer/FE comparison logic to handle mixins with >2 superclass constraints.
Change-Id: I812d292dffdc3bec75b31d4eccf463e2b3277b1d
Reviewed-on: https://dart-review.googlesource.com/c/80505
Commit-Queue: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-10-17 21:02:56 +00:00
Peter von der Ahé e502edf28b Add DiagnosticMessage support API
Change-Id: I0ae8d37e48951a58bd2d9016397baeee916857ee
Reviewed-on: https://dart-review.googlesource.com/c/78063
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
2018-10-15 14:06:55 +00:00
Paul Berry 1cabefdf5b Fix analyzer/FE comparison tool handling of mixins.
The kernel representation of mixin classes was changed in
c9b05d3f1ff0ba22cc8cc2e66e2654d99609e087; this adapts to the change.

Also, status file entries are added to reflect the differences
currently found by the comparison tool.

Change-Id: I16d5cb495cb70b05bf03e6d000002a69304ab4b0
Reviewed-on: https://dart-review.googlesource.com/c/79643
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-14 15:42:43 +00:00
Paul Berry 45092fd0aa Improve output of analyzer/FE comparison tool.
Now instead of annotating nodes as "added" or "removed", we explicitly
show which nodes are present only in analyzer output and which nodes
are present only in CFE output.

Change-Id: I9ea041610e015238136531649ebb48d4d7c075ae
Reviewed-on: https://dart-review.googlesource.com/c/79642
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-14 15:40:43 +00:00
Peter von der Ahé 8c872e0e3a Remove TargetFlags.strongMode
Change-Id: Ibf8661e5444d16666c54f1d81c626893b000521a
Reviewed-on: https://dart-review.googlesource.com/c/78986
Commit-Queue: Jens Johansen <jensj@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-10-10 12:11:41 +00:00
Peter von der Ahé ee97806084 Replace strongMode with legacyMode in CompilerOptions
Also, remove --strong and --strong-mode flags (use --legacy-mode
flag to enable legacy mode).

Change-Id: I577ab5f755a2bee88f0f4d63915a6e852e792f06
Reviewed-on: https://dart-review.googlesource.com/c/79000
Commit-Queue: Jens Johansen <jensj@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-10-10 12:04:26 +00:00
Peter von der Ahé 6b547e2683 Convert analyzer to use onDiagnostics
Change-Id: I224894b47a03c8b5cf48ddd3a125ba09a9a47a23
Reviewed-on: https://dart-review.googlesource.com/c/77842
Commit-Queue: Peter von der Ahé <ahe@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-10-04 07:29:34 +00:00
Paul Berry dcad8fe895 In analyzer/FE comparison, compare the return types of function types.
This was inadvertently left out of the initial implementation.

Change-Id: I930bb77baad2e10e61836c15453729711d54cbde
Reviewed-on: https://dart-review.googlesource.com/76724
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-26 19:33:21 +00:00
Paul Berry e31f9fc55f Track front end errors.
In a later CL I will add code to print out the errors in the case
where the front end detects errors but the analyzer does not.

Change-Id: I675a9ffcce7cfe7afa32406b3310e7b1d42d2afc
Reviewed-on: https://dart-review.googlesource.com/76720
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-26 17:42:32 +00:00
Paul Berry 0262530e1f Clarify code that checks for analyzer/FE differences.
We take a slight performance hit when differences are actually found
(since we now check for differences first, and then compute the diff
afterwards if differences were found), but this shouldn't be a big
problem since most of the time there are no differences.

Change-Id: I62957bc7ea3ef2e87afdf7ea175ea5e4e75fc1aa
Reviewed-on: https://dart-review.googlesource.com/76703
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-26 17:05:25 +00:00
Paul Berry d68f685cab More minor fixes to the analyzer/FE comparison tool.
- The new mixin syntax is now handled.  It's a little kludgy since the
  front end lowers it to the old supermixin representation, so we have
  to do a similar lowering to the analyzer representation.  Once the
  front end has full support for the new mixin syntax, I'll clean this
  up.

- Synthetic '__loadLibrary_' functions (inserted by the front end to
  cover the corner case where the "loadLibrary" function is torn off)
  are ignored.

Drops the number of failing language_2 tests with `--compiler
compare_analyzer_cfe` from 22 to 11.  I believe the remaining failures
are genuine bugs in either the front end or the analyzer.

Change-Id: I452ee92c418c04661d35cda1ed129ee5715879cd
Reviewed-on: https://dart-review.googlesource.com/75207
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-17 21:25:40 +00:00
Paul Berry e8880fdbc8 Fix handling of unary- in the analyzer/FE comparison tool.
Drops the number of failing language_2 tests with `--compiler
compare_analyzer_cfe` from 34 to 22.

Change-Id: I1d35d0ac11816d29a5f3044db81a5c24e1b25477
Reviewed-on: https://dart-review.googlesource.com/75129
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-16 18:19:22 +00:00
Paul Berry 4fab5650bc Several minor fixes to the analyzer/FE comparison tool.
- Mixin applications are now handled correctly.

- The front end's synthetic field "_exports#" is now ignored.

- Forwarding semi-stubs were erroneously being skipped; they are now
  included, as they should be (since they correspond to methods
  explictly declared in the source code).

- Named parameters in function types are now annotated properly (the
  annotation was previously missing a ": ").

Drops the number of failing language_2 tests with `--compiler
compare_analyzer_cfe` from 405 to 34.

Change-Id: I148269c967cc0fdf67bcfcd698cba36fc0b66368
Reviewed-on: https://dart-review.googlesource.com/75121
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-14 20:34:24 +00:00
Paul Berry bf4facdd66 Handle errors when comparing analyzer and front end behaviors.
For now, if the front end detects an error, we just consider the test
to have passed; we don't try to verify that the analyzer also detects
an error.  This will be improved in a future CL.

Drops the number of failing language_2 tests with `--compiler
compare_analyzer_cfe` from 2676 to 405.

Change-Id: Ib4f3c99710df4a0f0aac9a1c22a9a3279c6a6479
Reviewed-on: https://dart-review.googlesource.com/74968
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-14 17:12:43 +00:00
Paul Berry a48120aabd Wire up placeholder executable in pkg/analyzer_fe_comparison.
The placeholder executable is replaced by a shell script that invokes
pkg/analyzer_fe_comparison (in a similar way to how
sdk/bin/dartanalyzer invokes pkg/analyzer_cli).  This required some
rewriting of pkg/analyzer_fe_comparison to support analysis of a
single test case (as opposed to analysis of a package, which is what
it did before).

It's now possible to run the comparison tool over the test suite in
language_2.  There are many failures, which I'll begin addressing in
follow-up CLs.

Change-Id: I52d8f3b53064e8e29028571d416f2573c6cba35d
Reviewed-on: https://dart-review.googlesource.com/74820
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-13 16:41:20 +00:00
Paul Berry c925fa6b00 Lay the groundwork for comparing language_2 compilation results between analyzer and CFE.
This CL just adds the compiler=compareAnalyzerCfe option to the test
framework, and updates the status files so that no language_2 failures
are expected when this "compiler" is used.  A placeholder executable
has been added to sdk/bin, but it is not wired up yet--that will be
done in a future CL.

In a future CL I will wire up the placeholder executable to the code
in pkg/analyzer_fe_comparison, and fill in the methods in
CompareAnalyzerCfeCommandOutput to process the output accordingly.

Change-Id: I27439de4ac609cb8b003f157a0ff88d181bfbcae
Reviewed-on: https://dart-review.googlesource.com/73561
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2018-09-08 15:25:05 +00:00
Paul Berry 4160d34ad7 Compare types between analyzer and front_end.
Change-Id: I8d0c0eba60a2c2a1fe5a3e4e0c72249941d252d6
Reviewed-on: https://dart-review.googlesource.com/72880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-04 18:28:41 +00:00
Paul Berry 17a2b43cfe Compare names of class members, and refactor analyzer visitor.
The analyzer visitor now follows the suggestion of
https://dart-review.googlesource.com/c/sdk/+/72541/1/pkg/analyzer_fe_comparison/lib/src/analyzer.dart#51

Change-Id: I093f994b36d835ae6db0dc6a24ed3357dc53c8b7
Reviewed-on: https://dart-review.googlesource.com/72550
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-09-01 04:26:36 +00:00
Paul Berry b91ea9b7c5 Compare names of typedefs, top level variables, and top level functions.
Change-Id: I5d5b5a4e7609c8f6bcb63ca32ce83e49c42140ca
Reviewed-on: https://dart-review.googlesource.com/72541
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-08-31 18:38:21 +00:00
Paul Berry 0f7abef23c Begin writing code to compare analyzer and front_end behaviors.
This will help us ensure that the analyzer and the front end interpret
programs in the same way, e.g. they should produce the same type
inference results.

This code is in its own package for now to avoid making the analyzer
package unnecessarily depend on the details of the kernel
representation (which would couple it even more tightly to kernel than
it's already coupled).  We can move it into the analyzer later if we
see fit.

Change-Id: I055e83c7b83b6cd9b1082b4424a2f4144b5abf0e
Reviewed-on: https://dart-review.googlesource.com/72480
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-08-31 17:54:59 +00:00