improve tarval printer
authorMatthias Braun <matthias.braun@kit.edu>
Tue, 28 Aug 2012 18:12:33 +0000 (20:12 +0200)
committerMatthias Braun <matthias.braun@kit.edu>
Tue, 28 Aug 2012 19:02:46 +0000 (21:02 +0200)
ir/tv/tv.c

index 2100c29..8552fc8 100644 (file)
@@ -1474,7 +1474,16 @@ int tarval_snprintf(char *buf, size_t len, ir_tarval *tv)
                }
 
        default:
-               return snprintf(buf, len, "<TV_??""?>");
+               if (tv == tarval_bad)
+                       return snprintf(buf, len, "<TV_BAD>");
+               else if (tv == tarval_undefined)
+                       return snprintf(buf, len, "<TV_UNDEFINED>");
+               else if (tv == tarval_reachable)
+                       return snprintf(buf, len, "<TV_REACHABLE>");
+               else if (tv == tarval_unreachable)
+                       return snprintf(buf, len, "<TV_UNREACHABLE>");
+               else
+                       return snprintf(buf, len, "<TV_??""?>");
        }
 }