]> granicus.if.org Git - yasm/commitdiff
gen_x86_insn.py: Warn if any groups are unused (due to a typo, for example).
authorPeter Johnson <peter@tortall.net>
Thu, 2 Oct 2008 02:15:56 +0000 (02:15 -0000)
committerPeter Johnson <peter@tortall.net>
Thu, 2 Oct 2008 02:15:56 +0000 (02:15 -0000)
svn path=/trunk/yasm/; revision=2124

modules/arch/x86/gen_x86_insn.py

index d9ddb7c49e5cc3d994b38010d3ea60fcfb3c9ccf..7af53a8bc1c5cdf78944af12cd162198dcbd8627 100755 (executable)
@@ -494,9 +494,11 @@ def add_prefix(name, groupname, value, parser=None, **kwargs):
         nasm_insns[name] = prefix
 
 def finalize_insns():
+    unused_groups = set(groups.keys())
     for name, opts in insns.iteritems():
         for insn in opts:
             group = groups[insn.groupname]
+            unused_groups.discard(insn.groupname)
 
             parsers = set()
             for form in group:
@@ -539,6 +541,11 @@ def finalize_insns():
                 newinsn.auto_misc_flags("nasm")
                 nasm_insns[keyword] = newinsn
 
+    unused_groups.discard("empty")
+    unused_groups.discard("not64")
+    if unused_groups:
+        print "warning: unused groups: %s" % ", ".join(unused_groups)
+
 def output_insns(f, parser, insns):
     print >>f, "/* Generated by %s r%s, do not edit */" % \
         (scriptname, scriptrev)