[svn:parrot] r47727 - trunk/lib/Parrot/Pmc2c

NotFound at svn.parrot.org NotFound at svn.parrot.org
Sun Jun 20 10:55:24 UTC 2010


Author: NotFound
Date: Sun Jun 20 10:55:23 2010
New Revision: 47727
URL: https://trac.parrot.org/parrot/changeset/47727

Log:
subtle change in Parrot_${classname}_get_isa generation to shorten generated code

Modified:
   trunk/lib/Parrot/Pmc2c/PMCEmitter.pm

Modified: trunk/lib/Parrot/Pmc2c/PMCEmitter.pm
==============================================================================
--- trunk/lib/Parrot/Pmc2c/PMCEmitter.pm	Sun Jun 20 10:00:26 2010	(r47726)
+++ trunk/lib/Parrot/Pmc2c/PMCEmitter.pm	Sun Jun 20 10:55:23 2010	(r47727)
@@ -874,10 +874,19 @@
 PARROT_CANNOT_RETURN_NULL
 PARROT_WARN_UNUSED_RESULT
 Hash* Parrot_${classname}_get_isa(PARROT_INTERP, Hash* isa) {
+EOC
+
+    if ($get_isa ne '') {
+        $cout .= $get_isa;
+    }
+    else {
+        $cout .= <<"EOC";
     if (isa == NULL) {
         isa = parrot_new_hash(interp);
     }
-$get_isa
+EOC
+    }
+    $cout .= <<"EOC";
     parrot_hash_put(interp, isa, (void *)(CONST_STRING_GEN(interp, "$classname")), PMCNULL);
     return isa;
 }


More information about the parrot-commits mailing list