| Index: sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
|
| diff --git a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
|
| index 68646d9c9d8ba5f666e7307140517720efcb158d..44e35ac1ed5fc8017770125eadede7a03e08cc6c 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
|
| @@ -19,23 +19,33 @@ class SsaCodeGeneratorTask extends CompilerTask {
|
| // TODO(sra): Attaching positions might be cleaner if the source position
|
| // was on a wrapping node.
|
| SourceFile sourceFile = sourceFileOfElement(element);
|
| - Node expression = element.implementation.parseNode(backend.compiler);
|
| - Token beginToken;
|
| - Token endToken;
|
| - if (expression == null) {
|
| - // Synthesized node. Use the enclosing element for the location.
|
| - beginToken = endToken = element.position();
|
| + if (compiler.irBuilder.hasIr(element)) {
|
| + IrFunction function = compiler.irBuilder.getIr(element);
|
| + node.sourcePosition = new OffsetSourceFileLocation(
|
| + sourceFile, function.offset, function.sourceName);
|
| + node.endSourcePosition = new OffsetSourceFileLocation(
|
| + sourceFile, function.endOffset);
|
| } else {
|
| - beginToken = expression.getBeginToken();
|
| - endToken = expression.getEndToken();
|
| - }
|
| - // TODO(podivilov): find the right sourceFile here and remove offset checks
|
| - // below.
|
| - if (beginToken.charOffset < sourceFile.length) {
|
| - node.sourcePosition = new SourceFileLocation(sourceFile, beginToken);
|
| - }
|
| - if (endToken.charOffset < sourceFile.length) {
|
| - node.endSourcePosition = new SourceFileLocation(sourceFile, endToken);
|
| + Node expression = element.implementation.parseNode(backend.compiler);
|
| + Token beginToken;
|
| + Token endToken;
|
| + if (expression == null) {
|
| + // Synthesized node. Use the enclosing element for the location.
|
| + beginToken = endToken = element.position();
|
| + } else {
|
| + beginToken = expression.getBeginToken();
|
| + endToken = expression.getEndToken();
|
| + }
|
| + // TODO(podivilov): find the right sourceFile here and remove offset
|
| + // checks below.
|
| + if (beginToken.charOffset < sourceFile.length) {
|
| + node.sourcePosition =
|
| + new TokenSourceFileLocation(sourceFile, beginToken);
|
| + }
|
| + if (endToken.charOffset < sourceFile.length) {
|
| + node.endSourcePosition =
|
| + new TokenSourceFileLocation(sourceFile, endToken);
|
| + }
|
| }
|
| return node;
|
| }
|
|
|