On 06/27/2011 07:15 AM, Matt Turner wrote:
> class arch_mips(generic):
>     "MIPS class"
>     def __init__(self, Olevel, arch, additional_cflags, include_workarounds):
>         generic.__init__(self)
> 
>         self.settings["CFLAGS"] = "-O" + Olevel
>         self.settings["CFLAGS"] += " -march=" + arch
>         if additional_cflags != "":
>             self.settings["CFLAGS"] += " " + additional_cflags
>         if include_workarounds:
>             if arch == "mips3":
>                 self.settings["CFLAGS"] += " -mfix-r4000 -mfix-r4400"
>             elif arch == "r4000" or arch == "r4k":
>                 self.settings["CFLAGS"] += " -mfix-r4000"
>             elif arch == "r4300":
>                 self.settings["CFLAGS"] += " -mfix-r4300"
>             elif arch == "r10000" or arch == "r10k":
>                 self.settings["CFLAGS"] += " -mfix-r10000"
>         self.settings["CFLAGS"] += " -pipe"

Thoughts:

 - How are you going to ensure that such refactoring keeps all
   ~50 cases working without writing 50 explicit, data-duplicating
   test cases?  Would you be willing to write these?

 - The code above adds flexibility but is less obvious than
   the current code.  So while it improves on one aspect
   it worsens on another.

 - Such refactoring would have to be done on both 2.x and 3.x branches.
   Better wait until we are clear on their future.

Best,



Sebastian

Reply via email to