brianwilkerson@google.com
2a1657d467
Fix methods for getting source kind
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org//1131853003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45596 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-07 15:32:41 +00:00
paulberry@google.com
4bbe16a115
Ensure that nulls aren't added to constant eval dependency graph.
...
In r45541, I accidentally left out a null check causing nulls to get
inserted into the constant evaluation dependency graph. This caused a
log message to be printed when running the command-line analyzer, but
no test failures.
I've inserted the proper null check and added an assert statement so
that if the bug recurs it will be caught during testing.
BUG=dartbug.com/23407
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org//1133623002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45594 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-07 14:41:56 +00:00
brianwilkerson@google.com
654c4b4675
More renames
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org//1126353004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45592 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-07 13:19:04 +00:00
brianwilkerson@google.com
1124eaacd8
Rename EMPTY_ARRAY to EMPTY_LIST
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org//1127183003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45579 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-06 23:47:59 +00:00
paulberry@google.com
2ade74e561
Clone AST nodes of default formal parameters prior to constant evaluation.
...
We need to clone these nodes for the same reason we need to clone the
nodes for constant variables--because once constant evaluation is
moved into the new task model, we will not necessarily have access to
the AST at the time we need to evaluate these constants (they may be
depended upon by constant invocation expressions in other libraries).
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org//1115993005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45568 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-06 15:51:39 +00:00
paulberry@google.com
dc04ae1271
Remove const instance creation expressions from the dependency graph.
...
Instead of treating them as separate nodes in the dependency graph,
evaluate them directly in the ConstantVisitor at the time they are
needed. This makes the dependency graph more uniform, since
everything in it is now associated with an element. This should make
it easier to adapt constant evaluation to the new task model.
In order to avoid introducing regressions with this change, I had to
implement proper reporting of cycles in compile-time constants.
(Previously, this was unimplemented but worked correctly in most cases
by luck.)
Note: technically this constitutes a breaking API change, since it
removes the field constantHandle and the getter evaluationResult from
the InstanceCreationExpression class. I believe these members are not
used outside of analyzer, so I'm leaving the analyzer version number
as is.
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org//1124733008
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45541 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-05 21:46:25 +00:00
scheglov@google.com
76c543689d
Don't recurse into (external) compilation units.
...
I forgot to turn on assertions for local tests, so it broke on the bots instead...
TBR
R=brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org//1117143004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45538 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-05 20:54:54 +00:00
scheglov@google.com
b1ae4d74c2
Use IncrementalCompilationUnitElementBuilder in BuildCompilationUnitElementTask.
...
R=brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org//1113223006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45536 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-05 19:31:41 +00:00
scheglov@google.com
c236100c96
Incrementally build unit member elements.
...
R=brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org//1119683004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45534 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-05 18:36:56 +00:00
paulberry@google.com
3d770ab87a
Create a class for evaluating const instance creation expressions.
...
Previously the methods for evaluating const instance creation
expressions were all in the ConstantValueComputer class. Moving them
to their own class allows for the possibility of evaluating them in
the ConstantVisitor, which in a future CL should allow us to avoid
making these expressions part of the const dependency graph.
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org//1129563002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45533 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-05 17:47:35 +00:00
brianwilkerson@google.com
0305ce28e1
Compute explicit imports
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org//1124923002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45531 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-05 17:09:42 +00:00
scheglov@google.com
e5f7e02484
Initial steps for the incremental elements builder.
...
R=brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org//1124553005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45528 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-05 14:54:13 +00:00
paulberry@google.com
fe50987b74
Move validation logic for constant evaluation into its own class.
...
This will help facilitate some refactoring of constant evaluation that
needs to be done in order to prepare it for the new task model.
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org//1121313004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45527 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-05 14:22:53 +00:00
paulberry@google.com
f2b84f9988
Fix constant evaluation logic for String.length.
...
Previously, we used static resolution to determine whether
String.length was being referred to, causing incorrect results in the
presence of bad type annotations. Also, we were missing a null check,
causing constant evaluation to crash if an attempt was made to take
the length of a constant that couldn't be evaluated.
BUG=dartbug.com/23383
R=scheglov@google.com
Review URL: https://codereview.chromium.org//1124433007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45524 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-05 13:07:21 +00:00
scheglov@google.com
bbde73602d
Use memento in ParseDartTask.
...
R=brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org//1124703005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45509 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-04 20:51:12 +00:00
scheglov@google.com
1827a0715d
Use memento in ScanDartTask.
...
R=brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org//1113103003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45503 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-04 20:10:49 +00:00
scheglov@google.com
e54d46d2d8
Get memento objects from tasks, remember in cache and pass back to tasks.
...
R=brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org//1120313004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45496 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-04 17:13:31 +00:00
paulberry@google.com
a924c66fc5
Add a flag to the element model to identify mixin applications.
...
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org//1120623003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45495 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-04 17:00:34 +00:00
paulberry@google.com
7138d01444
In constant evaluation, handle final vars initialized at declaration site.
...
Previously final variables initialized at the declaration site
would simply be ignored, causing some checked-mode compile time
errors to be missed, and causing the analyzer to produce
incorrect values for any such constants.
BUG=dartbug.com/23292
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org//1099953004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45494 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-04 16:21:54 +00:00
paulberry@google.com
34d8b562be
Make sure to visit function annotations in ElementBuilder.
...
Since r44861, ElementBuilder is responsible for creating the
ConstantInstanceCreationHandle objects associated with
InstanceCreationExpressions. Since InstanceCreationExpressions may
appear inside annotations, we must make sure the ElementBuilder visits
all annotations. Previous to this change, it didn't visit function
annotations.
BUG=dartbug.com/23354
R=scheglov@google.com
Review URL: https://codereview.chromium.org//1125613003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45489 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-04 13:25:08 +00:00
scheglov@google.com
b909e13241
Ignore synthetic tokens when search for AstNode.
...
This fixes the exception you saw during 'Extract Local' refactoring.
R=brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org//1117183002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45481 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-03 20:29:38 +00:00
scheglov@google.com
79aea09150
Record dependencies and invalidate results.
...
R=brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org//1121963002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45480 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-03 20:26:51 +00:00
brianwilkerson@google.com
bfbaadca44
More fixes to the new analysis context implementation
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org//1127483002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45479 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-03 15:06:06 +00:00
brianwilkerson@google.com
55fe371ca0
Fix NPE when analyzing Object
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org//1119973003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45478 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-03 15:02:11 +00:00
brianwilkerson@google.com
8a294a09ac
Add an option to enable the new task model
...
R=jwren@google.com , scheglov@google.com
Review URL: https://codereview.chromium.org//1119983004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45477 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-02 14:17:17 +00:00
scheglov@google.com
f92f340ab8
Remove AnalysisContext.refactoringUnsafeSources.
...
It is not used anyway.
R=brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org//1113423003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45474 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-01 20:36:51 +00:00
scheglov@google.com
89514d6799
Finish AnalysisContext.getLaunchableServerLibrarySources implementation.
...
R=brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org//1120973003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45473 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-01 20:34:55 +00:00
scheglov@google.com
aad45934a4
Fix for computing IS_CLIENT.
...
Also start using it in AnalysisContextImpl.
R=brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org//1118963003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45469 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-01 16:06:12 +00:00
brianwilkerson@google.com
ac3613e2bb
Re-apply change to move to plugin package
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org//1094083003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45408 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-24 18:54:24 +00:00
brianwilkerson@google.com
20a2f86f6b
Re-add missed files
...
Review URL: https://codereview.chromium.org//1102473006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45386 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-23 22:29:37 +00:00
brianwilkerson@google.com
3d536efcfe
Revert breaking change
...
Review URL: https://codereview.chromium.org//1101213002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45384 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-23 22:12:20 +00:00
brianwilkerson@google.com
24c853446a
Convert analyzer and analysis_server to use the plugin package
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org//1063153004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45382 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-23 20:32:35 +00:00
pquitslund@google.com
49d0f16a2a
Analyzer CLI removal.
...
CLI now lives in dedicated `analyzer_cli` package.
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org//1102613002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45362 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-22 20:32:05 +00:00
scheglov@google.com
145cbc3750
Convert EnginePlugin.taskDescriptors into a getter.
...
R=brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org//1095113003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45289 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-20 16:12:43 +00:00
brianwilkerson@google.com
5c5bc38ac3
Initial re-write of analysis context for the new task model
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org//1053673008
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45284 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-20 15:00:01 +00:00
brianwilkerson@google.com
d1d92d63fc
Bug fixes and clean-up
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org//1096613004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45244 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-17 17:03:01 +00:00
brianwilkerson@google.com
9bb1c7ff18
Rename EMPTY_ARRAY to EMPTY_LIST in element model
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org//1061993003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45212 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-16 15:54:10 +00:00
scheglov@google.com
1ea1b3ac49
Move LibraryUnitTarget into API.
...
We need this Target to use it in the Angular plugin.
Also increment version with the goal to publish the analyzer package and use in the Angular plugin.
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org//1082913007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45192 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-16 00:06:20 +00:00
scheglov@google.com
031234d37f
Another fix for unused elements.
...
It turned out that the way I run analyzer tests misses the new task model tests.
And (un)fortunately bots run them correctly, so some of the are red now.
TBR
R=brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org//1089653002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45180 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-15 20:32:15 +00:00
scheglov@google.com
b1dd0f8843
Fix another false positive for not used function type alias.
...
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org//1061003004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45178 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-15 19:45:49 +00:00
brianwilkerson@google.com
c699a9b79d
Stop generating error when ignoring function bodies (issue 23207)
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org//1059753005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45172 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-15 16:11:12 +00:00
brianwilkerson@google.com
d2af892e6a
Capture annotations on enums (issue 23071)
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org//1087223002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45167 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-15 14:33:39 +00:00
paulberry@google.com
0457770df5
Don't permit annotations inside variable declarations.
...
This addresses the root cause of dartbug.com/23176.
BUG=dartbug.com/23204
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org//1083093002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45165 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-15 13:28:38 +00:00
brianwilkerson@google.com
ba5b3ccde4
Fix resolution of stack trace parameters
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org//1060373003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45140 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-14 15:01:45 +00:00
scheglov@google.com
9cdd2dd31f
Issue 23190. Type check with a function type alias is its usage.
...
R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=23190
Review URL: https://codereview.chromium.org//1081233002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45124 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-14 00:35:56 +00:00
scheglov@google.com
548fcacd52
Issue 23181. Fix for ParameterElement.node.
...
R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=23181
Review URL: https://codereview.chromium.org//1084643002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45115 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-13 18:00:52 +00:00
scheglov@google.com
2e2bb91f26
Move getElementAt() to CompilationUnitElement.
...
R=brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org//1080503003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45072 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-10 16:57:51 +00:00
scheglov@google.com
688cb9f67a
Issue 23155. Don't perform incremental resolution if a constructor initializer is changed.
...
R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=23155
Review URL: https://codereview.chromium.org//1078953002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45037 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-09 21:17:30 +00:00
scheglov@google.com
ed26cdbf05
Remove old debug output.
...
R=brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org//1070223002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45025 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-09 18:40:00 +00:00
scheglov@google.com
28c4a74388
Tweaks for Element encoding and decoding.
...
R=brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org//1067363003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45016 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-09 16:09:07 +00:00