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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/nodes.dart

Issue 190763013: Detect total switches to prevent type pollution by default cases. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address review comments Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart b/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
index 774ab84a4384117b534b3d3d3ba1c4ae3aeb6b0b..e8884405003b1322ab98dbf25ada8881c3b20169 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
@@ -1716,6 +1716,12 @@ class HSwitch extends HControlFlow {
*/
HBasicBlock get defaultTarget => block.successors.last;
+ /**
+ * Set to true if we statically know that the case statements
+ * are exhaustive wrt the range of the expression.
+ */
+ bool isTotal = false;
+
accept(HVisitor visitor) => visitor.visitSwitch(this);
String toString() => "HSwitch cases = $inputs";

Powered by Google App Engine
This is Rietveld 408576698