aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2021-02-21 23:54:42 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2021-02-28 22:14:41 +0100
commitc2d25e6aad7dd78fb2e1a4f2afd38a42f3ffa614 (patch)
treefb3743df340e36ca5f112074c81d2fd919c22228
parenteaceeafad39ade20c28b6634d30379763511c6e6 (diff)
downloadsparse-c2d25e6aad7dd78fb2e1a4f2afd38a42f3ffa614.tar.gz
slice: remove unneeded len from OP_SLICE
OP_SLICE::len is necessarily equal to the result size. So remove this redundancy. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--Documentation/IR.rst2
-rw-r--r--linearize.c3
-rw-r--r--linearize.h2
3 files changed, 3 insertions, 4 deletions
diff --git a/Documentation/IR.rst b/Documentation/IR.rst
index 38df84ff..e1613402 100644
--- a/Documentation/IR.rst
+++ b/Documentation/IR.rst
@@ -408,7 +408,7 @@ Others
Extract a "slice" from an aggregate.
* .base: (pseudo_t) aggregate (alias .src)
- * .from, .len: offet & size of the "slice" within the aggregate
+ * .from: offset of the "slice" within the aggregate
* .target: result
* .type: type of .target
diff --git a/linearize.c b/linearize.c
index 0c9b0e59..96a717bc 100644
--- a/linearize.c
+++ b/linearize.c
@@ -470,7 +470,7 @@ const char *show_instruction(struct instruction *insn)
break;
case OP_SLICE:
- buf += sprintf(buf, "%s <- %s, %d, %d", show_pseudo(insn->target), show_pseudo(insn->base), insn->from, insn->len);
+ buf += sprintf(buf, "%s <- %s, %d", show_pseudo(insn->target), show_pseudo(insn->base), insn->from);
break;
case OP_NOT: case OP_NEG:
@@ -1239,7 +1239,6 @@ static pseudo_t linearize_slice(struct entrypoint *ep, struct expression *expr)
insn->target = new;
insn->from = expr->r_bitpos;
- insn->len = expr->r_nrbits;
use_pseudo(insn, pre, &insn->base);
add_one_insn(ep, insn);
return new;
diff --git a/linearize.h b/linearize.h
index cf0cf066..4d83675c 100644
--- a/linearize.h
+++ b/linearize.h
@@ -129,7 +129,7 @@ struct instruction {
};
struct /* slice */ {
pseudo_t base;
- unsigned from, len;
+ unsigned from;
};
struct /* setval */ {
struct expression *val;