loci: store unmangled class name in inheritance_map

Instead of just the portion after the base class name.
diff --git a/c_gen/c_code_gen.py b/c_gen/c_code_gen.py
index c63b882..9a3bf28 100644
--- a/c_gen/c_code_gen.py
+++ b/c_gen/c_code_gen.py
@@ -1055,7 +1055,8 @@
     %(cls)s_header_t header; /* Generic instance */
 """ % dict(cls=cls))
         for subcls in sorted(subclasses):
-            out.write("    %s_%s_t %s;\n" % (cls, subcls, subcls))
+            instance = loxi_utils.class_to_instance(subcls, cls)
+            out.write("    %s_%s_t %s;\n" % (cls, instance, instance))
         out.write("};\n")
 
 def gen_struct_typedefs(out):
diff --git a/c_gen/loxi_utils_legacy.py b/c_gen/loxi_utils_legacy.py
index 5d6d1d9..2f5e672 100644
--- a/c_gen/loxi_utils_legacy.py
+++ b/c_gen/loxi_utils_legacy.py
@@ -219,6 +219,10 @@
     """
     return parent + "_" + instance
 
+def class_to_instance(cls, base_cls):
+    assert cls.startswith(base_cls + '_')
+    return cls[len(base_cls)+1:]
+
 def class_is_var_len(cls, version):
     # Match is special case.  Only version 1.2 (wire version 3) is var
     if cls == "of_match":
diff --git a/c_gen/type_maps.py b/c_gen/type_maps.py
index abbc2d5..b4d7df9 100644
--- a/c_gen/type_maps.py
+++ b/c_gen/type_maps.py
@@ -76,12 +76,9 @@
             if not root or root == ofclass:
                 continue
 
-            assert ofclass.name.startswith(root.name + '_')
-            subcls = ofclass.name[len(root.name)+1:]
-
             if root.name not in inheritance_map:
                 inheritance_map[root.name] = set()
-            inheritance_map[root.name].add(subcls)
+            inheritance_map[root.name].add(ofclass.name)
 
 def sub_class_map(base_type, version):
     """
@@ -92,10 +89,10 @@
     if base_type not in inheritance_map:
         return rv
 
-    for instance in inheritance_map[base_type]:
-        subcls = loxi_utils.instance_to_class(instance, base_type)
+    for subcls in inheritance_map[base_type]:
         if not loxi_utils.class_in_version(subcls, version):
             continue
+        instance = loxi_utils.class_to_instance(subcls, base_type)
         rv.append((instance, subcls))
 
     return rv