Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart |
| diff --git a/sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart b/sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart |
| index 4132db247bd0d23f14ed74937d4294ac47356547..351e18bc84348dbcb638c4fa344238873fe490ef 100644 |
| --- a/sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart |
| +++ b/sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart |
| @@ -83,6 +83,7 @@ class IrBuilderTask extends CompilerTask { |
| unlinkTreeAndToken(element); |
| } |
| } |
| + ensureIr(element); |
| }); |
| }); |
| } |
| @@ -114,9 +115,23 @@ class IrBuilderTask extends CompilerTask { |
| // TODO(lry): support native functions (also in [visitReturn]). |
| if (function.isNative()) return false; |
| + // Methods annotated @IrRepresentation(false). |
| + if (backend.enforceAstRepresentation(function)) return false; |
| + |
| return true; |
| } |
| + /** |
| + * If no IR was built for [element], ensure it is not annotated |
| + * @IrRepresentation(true). |
| + */ |
| + bool ensureIr(Element element) { |
| + // Ensure that the method is not annotated |
| + if (!compiler.irBuilder.hasIr(element) && |
|
ngeoffray
2013/12/17 12:52:33
Since this is for testing purposes, should you ass
lukas
2013/12/17 13:03:43
Then the "ir_representation_test.dart" would compi
|
| + compiler.backend.enforceIrRepresentation(element)) |
| + compiler.internalError("coult not build IR", element: element); |
| + } |
| + |
| void unlinkTreeAndToken(element) { |
| // Ensure the function signature has been computed (requires the AST). |
| assert(element is !FunctionElementX || element.functionSignature != null); |