]> git.cworth.org Git - apitrace/blobdiff - trace.py
Generate more compact switch statements for polymorphic types.
[apitrace] / trace.py
index 2c31c92073ee1db29eca5fc665e2a2ccf4283706..9cc2b0a77a3e746c424d05aae3f84c13af0a0fe1 100644 (file)
--- a/trace.py
+++ b/trace.py
@@ -207,13 +207,11 @@ class DumpImplementer(stdapi.Visitor):
 
     def visit_polymorphic(self, polymorphic, instance):
         print '    switch (%s) {' % polymorphic.switch_expr
-        for expr, type in polymorphic.switch_types:
-            print '    case %s:' % expr
+        for cases, type in polymorphic.iterswitch():
+            for case in cases:
+                print '    %s:' % case
             self.visit(type, 'static_cast<%s>(%s)' % (type, instance));
             print '        break;'
-        print '    default:'
-        self.visit(polymorphic.default_type, instance);
-        print '        break;'
         print '    }'