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

Side by Side Diff: pkg/compiler/lib/src/dart_backend/backend.dart

Issue 1167353003: Opt-in to generate code for compile-time error. Only supported for SSA. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/compiler/lib/src/dart2js.dart ('k') | pkg/compiler/lib/src/deferred_load.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart_backend; 5 part of dart_backend;
6 6
7 // TODO(ahe): This class is simply wrong. This backend should use 7 // TODO(ahe): This class is simply wrong. This backend should use
8 // elements when it can, not AST nodes. Perhaps a [Map<Element, 8 // elements when it can, not AST nodes. Perhaps a [Map<Element,
9 // TreeElements>] is what is needed. 9 // TreeElements>] is what is needed.
10 class ElementAst { 10 class ElementAst {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 DartResolutionCallbacks resolutionCallbacks; 43 DartResolutionCallbacks resolutionCallbacks;
44 44
45 final Set<ClassElement> usedTypeLiterals = new Set<ClassElement>(); 45 final Set<ClassElement> usedTypeLiterals = new Set<ClassElement>();
46 46
47 /// The set of visible platform classes that are implemented by instantiated 47 /// The set of visible platform classes that are implemented by instantiated
48 /// user classes. 48 /// user classes.
49 final Set<ClassElement> _userImplementedPlatformClasses = 49 final Set<ClassElement> _userImplementedPlatformClasses =
50 new Set<ClassElement>(); 50 new Set<ClassElement>();
51 51
52 bool get canHandleCompilationFailed => false; 52 bool enableCodegenWithErrorsIfSupported(Spannable node) {
53 compiler.reportHint(node,
54 MessageKind.GENERIC,
55 {'text': "Generation of code with compile time errors is not "
56 "supported for dart2dart."});
57 return false;
58 }
53 59
54 /** 60 /**
55 * Tells whether it is safe to remove type declarations from variables, 61 * Tells whether it is safe to remove type declarations from variables,
56 * functions parameters. It becomes not safe if: 62 * functions parameters. It becomes not safe if:
57 * 1) TypeError is used somewhere in the code, 63 * 1) TypeError is used somewhere in the code,
58 * 2) The code has typedefs in right hand side of IS checks, 64 * 2) The code has typedefs in right hand side of IS checks,
59 * 3) The code has classes which extend typedefs, have type arguments typedefs 65 * 3) The code has classes which extend typedefs, have type arguments typedefs
60 * or type variable bounds typedefs. 66 * or type variable bounds typedefs.
61 * These restrictions can be less strict. 67 * These restrictions can be less strict.
62 */ 68 */
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 } 313 }
308 }); 314 });
309 } 315 }
310 } 316 }
311 } 317 }
312 } 318 }
313 319
314 } 320 }
315 321
316 @override 322 @override
317 bool registerDeferredLoading(Spannable node, Registry registry) { 323 bool enableDeferredLoadingIfSupported(Spannable node, Registry registry) {
318 // TODO(sigurdm): Implement deferred loading for dart2dart. 324 // TODO(sigurdm): Implement deferred loading for dart2dart.
319 compiler.reportWarning(node, MessageKind.DEFERRED_LIBRARY_DART_2_DART); 325 compiler.reportWarning(node, MessageKind.DEFERRED_LIBRARY_DART_2_DART);
320 return false; 326 return false;
321 } 327 }
322 } 328 }
323 329
324 class DartResolutionCallbacks extends ResolutionCallbacks { 330 class DartResolutionCallbacks extends ResolutionCallbacks {
325 final DartBackend backend; 331 final DartBackend backend;
326 332
327 DartResolutionCallbacks(this.backend); 333 DartResolutionCallbacks(this.backend);
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 class _ElementAstCreationContext implements ElementAstCreationContext { 523 class _ElementAstCreationContext implements ElementAstCreationContext {
518 final Compiler compiler; 524 final Compiler compiler;
519 final ConstantSystem constantSystem; 525 final ConstantSystem constantSystem;
520 526
521 _ElementAstCreationContext(this.compiler, this.constantSystem); 527 _ElementAstCreationContext(this.compiler, this.constantSystem);
522 528
523 DartTypes get dartTypes => compiler.types; 529 DartTypes get dartTypes => compiler.types;
524 530
525 InternalErrorFunction get internalError => compiler.internalError; 531 InternalErrorFunction get internalError => compiler.internalError;
526 } 532 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/dart2js.dart ('k') | pkg/compiler/lib/src/deferred_load.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698