Chromium Code Reviews| 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..c17ae6f84878d121fe69827355bb85f1e33e8c46 100644 |
| --- a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart |
| +++ b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart |
| @@ -19,23 +19,34 @@ 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(); |
| + Element implementation = element.implementation; |
|
ngeoffray
2013/11/22 12:21:04
In hasIrNode/irNode.
lukas
2013/11/22 16:33:03
Done.
|
| + if (implementation.hasIrNode(compiler)) { |
| + IrFunction function = implementation.irNode(compiler); |
| + 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 = 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; |
| } |