freedreno/tools: check rnn parse status
authorRob Clark <robdclark@chromium.org>
Tue, 28 Jul 2020 14:55:49 +0000 (07:55 -0700)
committerMarge Bot <eric+marge@anholt.net>
Wed, 29 Jul 2020 14:30:35 +0000 (14:30 +0000)
Don't silently ignore issues.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107>

src/freedreno/afuc/asm.c
src/freedreno/afuc/disasm.c
src/freedreno/decode/rnnutil.c

index 321d06adfef5100c317f0d348a9d40696a599ea9..5b19c7fd9c0f806ac266ff63dcf1bc9f93a4e0c7 100644 (file)
@@ -21,6 +21,7 @@
  * SOFTWARE.
  */
 
+#include <err.h>
 #include <stdint.h>
 #include <stdbool.h>
 #include <unistd.h>
@@ -416,6 +417,8 @@ int main(int argc, char **argv)
        ctx = rnndec_newcontext(db);
 
        rnn_parsefile(db, "adreno.xml");
+       if (db->estatus)
+               errx(db->estatus, "failed to parse register database");
        dom[0] = rnn_finddomain(db, name);
        dom[1] = rnn_finddomain(db, "AXXX");
        control_regs = rnn_finddomain(db, control_reg_name);
index ea9f34cd97fb8e5d710e49f14e8b40ac1845ec9b..66e40c1d188e1569e2f2dfcf6356e6154f817ae8 100644 (file)
@@ -21,6 +21,7 @@
  * SOFTWARE.
  */
 
+#include <err.h>
 #include <stdint.h>
 #include <stdbool.h>
 #include <unistd.h>
@@ -815,6 +816,8 @@ int main(int argc, char **argv)
        ctx->colors = colors ? &envy_def_colors : &envy_null_colors;
 
        rnn_parsefile(db, "adreno.xml");
+       if (db->estatus)
+               errx(db->estatus, "failed to parse register database");
        dom[0] = rnn_finddomain(db, variant);
        dom[1] = rnn_finddomain(db, "AXXX");
        control_regs = rnn_finddomain(db, control_reg_name);
index 78915977de486201335d73582af12c11efc4b709..ae5fe82683457e720cda77316f8a1d26d2844213 100644 (file)
@@ -26,6 +26,7 @@
  *    Rob Clark <robclark@freedesktop.org>
  */
 
+#include <err.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
@@ -87,6 +88,8 @@ static void init(struct rnn *rnn, char *file, char *domain)
        rnndec_varadd(rnn->vc, "chip", domain);
        if (rnn->vc != rnn->vc_nocolor)
                rnndec_varadd(rnn->vc_nocolor, "chip", domain);
+       if (rnn->db->estatus)
+               errx(rnn->db->estatus, "failed to parse register database");
 }
 
 void rnn_load_file(struct rnn *rnn, char *file, char *domain)