Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/xlint/lint1 lint: reorder table of operator properties



details:   https://anonhg.NetBSD.org/src/rev/34d24dc8eee8
branches:  trunk
changeset: 1017789:34d24dc8eee8
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Jan 09 17:36:10 2021 +0000

description:
lint: reorder table of operator properties

The 4 "requires" properties are now listed together, in descending
strictness.

diffstat:

 usr.bin/xlint/lint1/op.h    |    6 +-
 usr.bin/xlint/lint1/ops.def |  104 ++++++++++++++++++++++----------------------
 2 files changed, 55 insertions(+), 55 deletions(-)

diffs (155 lines):

diff -r 9214febe2f13 -r 34d24dc8eee8 usr.bin/xlint/lint1/op.h
--- a/usr.bin/xlint/lint1/op.h  Sat Jan 09 17:21:33 2021 +0000
+++ b/usr.bin/xlint/lint1/op.h  Sat Jan 09 17:36:10 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: op.h,v 1.10 2021/01/05 23:50:29 rillig Exp $   */
+/*     $NetBSD: op.h,v 1.11 2021/01/09 17:36:10 rillig Exp $   */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -40,8 +40,9 @@
        bool    m_binary : 1;   /* binary operator */
        bool    m_logical : 1;  /* logical operator, result is int */
        bool    m_requires_integer : 1;
+       bool    m_requires_integer_or_complex : 1;
+       bool    m_requires_arith : 1;
        bool    m_requires_scalar : 1;
-       bool    m_requires_arith : 1;
        bool    m_fold : 1;     /* operands should be folded */
        bool    m_vctx : 1;     /* value context for left operand */
        bool    m_tctx : 1;     /* test context for left operand */
@@ -54,7 +55,6 @@
        bool    m_valid_on_enum : 1;    /* valid operation on enums */
        bool    m_bad_on_enum : 1;      /* dubious operation on enums */
        bool    m_eqwarn : 1;   /* warning if on operand stems from == */
-       bool    m_requires_integer_or_complex : 1;
        const char *m_name;     /* name of op. */
 } mod_t;
 
diff -r 9214febe2f13 -r 34d24dc8eee8 usr.bin/xlint/lint1/ops.def
--- a/usr.bin/xlint/lint1/ops.def       Sat Jan 09 17:21:33 2021 +0000
+++ b/usr.bin/xlint/lint1/ops.def       Sat Jan 09 17:36:10 2021 +0000
@@ -1,71 +1,71 @@
-/*     $NetBSD: ops.def,v 1.7 2021/01/05 23:50:29 rillig Exp $ */
+/*     $NetBSD: ops.def,v 1.8 2021/01/09 17:36:10 rillig Exp $ */
 
 begin_ops()
-/*     name    repr            b l i s a f v t b s l r p c e e q c     act */
+/*     name    repr            b l i c a s f v t b s l r p c e e =     act */
 op(    NOOP,   "no-op",        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,    0)
-op(    ARROW,  "->",           1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,    1)
+op(    ARROW,  "->",           1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,    1)
 op(    POINT,  ".",            1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,    1)
-op(    NOT,    "!",            0,1,0,1,0,1,0,1,0,0,0,0,0,0,0,1,0,0,    1)
-op(    COMPL,  "~",            0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,1,1,1,    1)
+op(    NOT,    "!",            0,1,0,0,0,1,1,0,1,0,0,0,0,0,0,0,1,0,    1)
+op(    COMPL,  "~",            0,0,0,1,0,0,1,1,0,0,0,0,0,0,0,0,1,1,    1)
 op(    INC,    "++",           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,    0)
 op(    DEC,    "--",           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,    0)
-op(    INCBEF, "++x",          0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,    1)
-op(    DECBEF, "--x",          0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,    1)
-op(    INCAFT, "x++",          0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,    1)
-op(    DECAFT, "x--",          0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,    1)
-op(    UPLUS,  "+",            0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,1,1,0,    1)
-op(    UMINUS, "-",            0,0,0,0,1,1,1,0,0,0,1,0,0,0,0,1,1,0,    1)
-op(    STAR,   "*",            0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,    1)
+op(    INCBEF, "++x",          0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,    1)
+op(    DECBEF, "--x",          0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,    1)
+op(    INCAFT, "x++",          0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,    1)
+op(    DECAFT, "x--",          0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,    1)
+op(    UPLUS,  "+",            0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,1,1,    1)
+op(    UMINUS, "-",            0,0,0,0,1,0,1,1,0,0,0,1,0,0,0,0,1,1,    1)
+op(    STAR,   "*",            0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,    1)
 op(    AMPER,  "&",            0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,    1)
-op(    MULT,   "*",            1,0,0,0,1,1,1,0,1,0,0,1,0,0,0,1,1,0,    1)
-op(    DIV,    "/",            1,0,0,0,1,1,1,0,1,0,1,1,0,0,0,1,1,0,    1)
-op(    MOD,    "%",            1,0,1,0,0,1,1,0,1,0,1,1,0,0,0,1,1,0,    1)
-op(    PLUS,   "+",            1,0,0,1,0,1,1,0,1,0,0,0,0,0,0,1,0,0,    1)
-op(    MINUS,  "-",            1,0,0,1,0,1,1,0,1,0,0,0,0,0,0,1,0,0,    1)
-op(    SHL,    "<<",           1,0,1,0,0,1,1,0,0,0,0,0,1,0,0,1,1,0,    1)
-op(    SHR,    ">>",           1,0,1,0,0,1,1,0,0,0,1,0,1,0,0,1,1,0,    1)
-op(    LT,     "<",            1,1,0,1,0,1,1,0,1,0,1,1,0,1,1,0,1,0,    1)
-op(    LE,     "<=",           1,1,0,1,0,1,1,0,1,0,1,1,0,1,1,0,1,0,    1)
-op(    GT,     ">",            1,1,0,1,0,1,1,0,1,0,1,1,0,1,1,0,1,0,    1)
-op(    GE,     ">=",           1,1,0,1,0,1,1,0,1,0,1,1,0,1,1,0,1,0,    1)
-op(    EQ,     "==",           1,1,0,1,0,1,1,0,1,0,0,0,0,1,1,0,1,0,    1)
-op(    NE,     "!=",           1,1,0,1,0,1,1,0,1,0,0,0,0,1,1,0,1,0,    1)
-op(    AND,    "&",            1,0,1,0,0,1,1,0,1,0,0,0,1,0,0,1,0,0,    1)
-op(    XOR,    "^",            1,0,1,0,0,1,1,0,1,0,0,0,1,0,0,1,0,0,    1)
-op(    OR,     "|",            1,0,1,0,0,1,1,0,1,0,0,0,1,0,0,1,0,0,    1)
-op(    LOGAND, "&&",           1,1,0,1,0,1,0,1,0,0,0,0,0,0,0,1,0,0,    1)
-op(    LOGOR,  "||",           1,1,0,1,0,1,0,1,0,0,0,0,1,0,0,1,0,0,    1)
-op(    QUEST,  "?",            1,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,    1)
-op(    COLON,  ":",            1,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,    1)
-op(    ASSIGN, "=",            1,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,    1)
-op(    MULASS, "*=",           1,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,    1)
-op(    DIVASS, "/=",           1,0,0,0,1,0,0,0,0,1,0,1,0,0,0,1,0,0,    1)
-op(    MODASS, "%=",           1,0,1,0,0,0,0,0,0,1,0,1,0,0,0,1,0,0,    1)
-op(    ADDASS, "+=",           1,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,    1)
-op(    SUBASS, "-=",           1,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,    1)
-op(    SHLASS, "<<=",          1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,    1)
-op(    SHRASS, ">>=",          1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,    1)
-op(    ANDASS, "&=",           1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,    1)
-op(    XORASS, "^=",           1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,    1)
-op(    ORASS,  "|=",           1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,    1)
+op(    MULT,   "*",            1,0,0,0,1,0,1,1,0,1,0,0,1,0,0,0,1,1,    1)
+op(    DIV,    "/",            1,0,0,0,1,0,1,1,0,1,0,1,1,0,0,0,1,1,    1)
+op(    MOD,    "%",            1,0,1,0,0,0,1,1,0,1,0,1,1,0,0,0,1,1,    1)
+op(    PLUS,   "+",            1,0,0,0,0,1,1,1,0,1,0,0,0,0,0,0,1,0,    1)
+op(    MINUS,  "-",            1,0,0,0,0,1,1,1,0,1,0,0,0,0,0,0,1,0,    1)
+op(    SHL,    "<<",           1,0,1,0,0,0,1,1,0,0,0,0,0,1,0,0,1,1,    1)
+op(    SHR,    ">>",           1,0,1,0,0,0,1,1,0,0,0,1,0,1,0,0,1,1,    1)
+op(    LT,     "<",            1,1,0,0,0,1,1,1,0,1,0,1,1,0,1,1,0,1,    1)
+op(    LE,     "<=",           1,1,0,0,0,1,1,1,0,1,0,1,1,0,1,1,0,1,    1)
+op(    GT,     ">",            1,1,0,0,0,1,1,1,0,1,0,1,1,0,1,1,0,1,    1)
+op(    GE,     ">=",           1,1,0,0,0,1,1,1,0,1,0,1,1,0,1,1,0,1,    1)
+op(    EQ,     "==",           1,1,0,0,0,1,1,1,0,1,0,0,0,0,1,1,0,1,    1)
+op(    NE,     "!=",           1,1,0,0,0,1,1,1,0,1,0,0,0,0,1,1,0,1,    1)
+op(    AND,    "&",            1,0,1,0,0,0,1,1,0,1,0,0,0,1,0,0,1,0,    1)
+op(    XOR,    "^",            1,0,1,0,0,0,1,1,0,1,0,0,0,1,0,0,1,0,    1)
+op(    OR,     "|",            1,0,1,0,0,0,1,1,0,1,0,0,0,1,0,0,1,0,    1)
+op(    LOGAND, "&&",           1,1,0,0,0,1,1,0,1,0,0,0,0,0,0,0,1,0,    1)
+op(    LOGOR,  "||",           1,1,0,0,0,1,1,0,1,0,0,0,0,1,0,0,1,0,    1)
+op(    QUEST,  "?",            1,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,    1)
+op(    COLON,  ":",            1,0,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,0,    1)
+op(    ASSIGN, "=",            1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,    1)
+op(    MULASS, "*=",           1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,    1)
+op(    DIVASS, "/=",           1,0,0,0,1,0,0,0,0,0,1,0,1,0,0,0,1,0,    1)
+op(    MODASS, "%=",           1,0,1,0,0,0,0,0,0,0,1,0,1,0,0,0,1,0,    1)
+op(    ADDASS, "+=",           1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,    1)
+op(    SUBASS, "-=",           1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,    1)
+op(    SHLASS, "<<=",          1,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,    1)
+op(    SHRASS, ">>=",          1,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,    1)
+op(    ANDASS, "&=",           1,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,    1)
+op(    XORASS, "^=",           1,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,    1)
+op(    ORASS,  "|=",           1,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,    1)
 op(    NAME,   "name",         0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,    1)
 op(    CON,    "const",        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,    1)
 op(    STRING, "string",       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,    1)
 op(    FSEL,   "fsel",         0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,    1)
-op(    CALL,   "call",         1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,    1)
-op(    COMMA,  ",",            1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,    1)
-op(    CVT,    "convert",      0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,    1)
-op(    ICALL,  "icall",        1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,    1)
+op(    CALL,   "call",         1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,    1)
+op(    COMMA,  ",",            1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,    1)
+op(    CVT,    "convert",      0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,    1)
+op(    ICALL,  "icall",        1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,    1)
 op(    LOAD,   "load",         0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,    1)
-op(    PUSH,   "push",         0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,    1)
-op(    RETURN, "return",       1,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,    1)
+op(    PUSH,   "push",         0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,    1)
+op(    RETURN, "return",       1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,    1)
 op(    REAL,   "real",         0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,    0)
 op(    IMAG,   "imag",         0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,    0)
 /* INIT, CASE and FARG are pseudo operators that don't appear in the tree. */
-op(    INIT,   "init",         1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,    1)
+op(    INIT,   "init",         1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,    1)
 op(    CASE,   "case",         0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,    0)
-op(    FARG,   "farg",         1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,    1)
-/*     name    repr            b l i s a f v t b s l r p c e e q c     act */
+op(    FARG,   "farg",         1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,    1)
+/*     name    repr            b l i c a s f v t b s l r p c e e =     act */
 end_ops()
 
 #ifndef NOPS



Home | Main Index | Thread Index | Old Index