[RFC PATCH 20/48] dump-ir: make it more flexible

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 lib.c                                  | 17 +++++++++--------
 validation/linear/bitfield-init-mask.c |  2 +-
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/lib.c b/lib.c
index c107505a7..d3aaf10d2 100644
--- a/lib.c
+++ b/lib.c
@@ -490,7 +490,6 @@ static unsigned long lookup_mask(const char *name, const struct mask_map *map)
 	return 0;
 }
 
-inline
 static unsigned long handle_suboption_mask(char *arg, const struct mask_map *map)
 {
 	const char *token;
@@ -757,16 +756,18 @@ static char **handle_switch_ftabstop(char *arg, char **next)
 	return next;
 }
 
+static const struct mask_map dump_ir_options[] = {
+	{ "$default",		DUMP_IR_LINEARIZE },
+	{ "linearize",		DUMP_IR_LINEARIZE },
+	{ "only",		DUMP_IR_ONLY },
+	{ },
+};
+
 static char **handle_switch_fdump(char *arg, char **next)
 {
 	if (!strncmp(arg, "ir", 2)) {
-		fdump_ir = DUMP_IR_LINEARIZE;
-		arg += 2;
-		if (*arg == '\0')
-			fdump_ir = DUMP_IR_LINEARIZE;
-		else if (!strcmp(arg, "=only"))
-			fdump_ir |= DUMP_IR_ONLY;
-		else
+		fdump_ir = handle_suboption_mask(arg+2, dump_ir_options);
+		if (fdump_ir == ~0UL)
 			goto err;
 	}
 
diff --git a/validation/linear/bitfield-init-mask.c b/validation/linear/bitfield-init-mask.c
index f43605855..fa91fec90 100644
--- a/validation/linear/bitfield-init-mask.c
+++ b/validation/linear/bitfield-init-mask.c
@@ -18,7 +18,7 @@ struct bfu bfu_init_20_23(int a)
 
 /*
  * check-name: bitfield initializer mask
- * check-command: test-linearize -fdump-ir=only -Wno-decl $file
+ * check-command: test-linearize -fdump-ir=linearize,only -Wno-decl $file
  * check-output-ignore
  *
  * check-output-contains: and\\..*fffff800\$
-- 
2.14.0

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux