Browse files

Generate refs for orphan objects properly

  • Loading branch information...
1 parent b691796 commit b95f0ece092d5c6a7cda6e3491a4ed3e0d82b5a6 @CyberShadow CyberShadow committed Nov 5, 2010
Showing with 6 additions and 2 deletions.
  1. +6 −2 disassembler.d
View
8 disassembler.d
@@ -109,6 +109,10 @@ final class RefBuilder : ASTraitsVisitor
{
foreach (i, ref v; as.scripts)
addMethod(v.sinit, "script" ~ .toString(i) ~ "_sinit");
+ foreach (vclass; as.orphanClasses)
+ addClass(vclass, "orphan");
+ foreach (method; as.orphanMethods)
+ addMethod(method, "orphan");
super.run();
}
@@ -257,9 +261,9 @@ final class RefBuilder : ASTraitsVisitor
return uniqueName;
}
- void addClass(ASProgram.Class vclass)
+ void addClass(ASProgram.Class vclass, string field = null)
{
- addObject(vclass, classByName, string.init);
+ addObject(vclass, classByName, field);
addMethod(vclass.cinit, "cinit");
addMethod(vclass.instance.iinit, "iinit");
}

0 comments on commit b95f0ec

Please sign in to comment.