skip id_reg.py parsing its own output; stop outputting "0" on empty
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 25 Sep 2018 22:06:01 +0000 (23:06 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 25 Sep 2018 22:06:01 +0000 (23:06 +0100)
id_regs.py

index 1dd6cf458c78543dac5a2118947c897940d6389d..54443557e2f6e2c7022eca7f087e2874ec043b98 100644 (file)
@@ -26,6 +26,8 @@ def list_insns():
     for fname in os.listdir(insns_dir):
         if not fname.endswith(".h"):
             continue
+        if fname.startswith("regs_"):
+            continue
         insn = fname[:-2]
         res.append((os.path.join(insns_dir, fname), insn))
     return res
@@ -49,8 +51,6 @@ def find_registers(fname):
             if p.startswith('WRITE_'):
                 p = p[6:]
             res.append('#define USING_REG_%s' % p)
-    if len(res) == 0:
-        return "0"
     return '\n'.join(res)
 
 if __name__ == '__main__':