Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Issue 10389143: Add locations to diagnostics. (Closed)

Created:
8 years, 7 months ago by ahe
Modified:
8 years, 7 months ago
Reviewers:
kasperl
CC:
reviews_dartlang.org, Lasse Reichstein Nielsen, floitsch
Visibility:
Public.

Description

Add locations to diagnostics. Committed: https://code.google.com/p/dart/source/detail?r=7660

Patch Set 1 #

Total comments: 2

Patch Set 2 : Remove all references to unreachable() #

Unified diffs Side-by-side diffs Delta from patch set Stats (+91 lines, -67 lines) Patch
M dart/lib/compiler/implementation/compile_time_constants.dart View 4 chunks +7 lines, -5 lines 0 comments Download
M dart/lib/compiler/implementation/compiler.dart View 3 chunks +17 lines, -12 lines 0 comments Download
M dart/lib/compiler/implementation/elements/elements.dart View 1 chunk +3 lines, -1 line 0 comments Download
M dart/lib/compiler/implementation/leg.dart View 1 chunk +0 lines, -4 lines 0 comments Download
M dart/lib/compiler/implementation/operations.dart View 1 chunk +2 lines, -2 lines 0 comments Download
M dart/lib/compiler/implementation/resolver.dart View 1 chunk +1 line, -1 line 0 comments Download
M dart/lib/compiler/implementation/ssa/builder.dart View 1 11 chunks +36 lines, -32 lines 0 comments Download
M dart/lib/compiler/implementation/ssa/codegen.dart View 3 chunks +8 lines, -4 lines 0 comments Download
M dart/lib/compiler/implementation/ssa/nodes.dart View 3 chunks +9 lines, -4 lines 0 comments Download
M dart/lib/compiler/implementation/ssa/tracer.dart View 2 chunks +8 lines, -2 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
ahe
8 years, 7 months ago (2012-05-15 12:04:29 UTC) #1
kasperl
I guess this will add a bunch of static warnings, right? Essentially all the places ...
8 years, 7 months ago (2012-05-15 12:09:15 UTC) #2
ahe
This is addressing part of http://code.google.com/p/dart/issues/detail?id=3062
8 years, 7 months ago (2012-05-15 12:09:38 UTC) #3
ahe
https://chromiumcodereview.appspot.com/10389143/diff/1/dart/lib/compiler/implementation/ssa/builder.dart File dart/lib/compiler/implementation/ssa/builder.dart (right): https://chromiumcodereview.appspot.com/10389143/diff/1/dart/lib/compiler/implementation/ssa/builder.dart#newcode684 dart/lib/compiler/implementation/ssa/builder.dart:684: unreachable(); On 2012/05/15 12:09:16, kasperl wrote: > Didn't you ...
8 years, 7 months ago (2012-05-15 12:28:04 UTC) #4
kasperl
I'm okay with this change (and it is always nice to get better error locations ...
8 years, 7 months ago (2012-05-15 13:27:52 UTC) #5
ahe
8 years, 7 months ago (2012-05-15 15:43:30 UTC) #6
On 2012/05/15 13:27:52, kasperl wrote:
> I'm okay with this change (and it is always nice to get better error locations
> for issues), so LGTM.
> 
> I think we should have a chat about good ways of making it easy to always be
an
> position where you have access to the compiler object and some kind of node.

Definitely. I need Lasse and Florian's help to figure out how to handle this. I
think we can afford to throw an exception like this:

class InternalCompilerError {
  String message;
  Node node;
  HInstruction instruction;
  Token token;
  Element element;
  InternalCompilerError(this.message, [this.node, this.instruction, this.token,
this.element]);
}

We can probably just catch this error in WorkItem.run and report a nicer
message.

This way we don't need access to the compiler object (essentially, we store it
on the stack).

It could make sense to have Node, HInstruction, Token, and Element all implement
a shared interface, say SourceLocation.

Powered by Google App Engine
This is Rietveld 408576698