diff options
author | Jeff Law <law@gcc.gnu.org> | 1998-06-29 15:40:49 -0600 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1998-06-29 15:40:49 -0600 |
commit | 9ec36da574f8272705a3ead59bbd289f23793429 (patch) | |
tree | 1ec056a51ca5f7af70d48889aab8bbf9c1f9d9aa /gcc/tree.c | |
parent | ad2c71b764c066471608c85695392c7fb49c7bc7 (diff) | |
download | gcc-9ec36da574f8272705a3ead59bbd289f23793429.zip gcc-9ec36da574f8272705a3ead59bbd289f23793429.tar.gz gcc-9ec36da574f8272705a3ead59bbd289f23793429.tar.bz2 |
* Merge from gcc2 June 9, 1998 snapshot. See ChangeLog.13 for
details.
From-SVN: r20808
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 50 |
1 files changed, 26 insertions, 24 deletions
@@ -4950,9 +4950,15 @@ get_set_constructor_bytes (init, buffer, wd_size) } return non_const_bits; } - + #ifdef ENABLE_CHECKING -/* Complain if the tree code does not match the expected one. */ + +/* Complain if the tree code does not match the expected one. + NODE is the tree node in question, CODE is the expected tree code, + and FILE and LINE are the filename and line number, respectively, + of the line on which the check was done. If NONFATAL is nonzero, + don't abort if the reference is invalid; instead, return 0. + If the reference is valid, return NODE. */ tree tree_check (node, code, file, line, nofatal) @@ -4962,19 +4968,17 @@ tree_check (node, code, file, line, nofatal) int line; int nofatal; { - if (TREE_CODE (node) != code) - { - if (nofatal) - return 0; - else - fatal ("%s:%d: Expect %s, have %s\n", file, line, - tree_code_name[code], tree_code_name[TREE_CODE (node)]); - } - - return node; + if (TREE_CODE (node) == code) + return node; + else if (nofatal) + return 0; + else + fatal ("%s:%d: Expect %s, have %s\n", file, line, + tree_code_name[code], tree_code_name[TREE_CODE (node)]); } -/* Complain if the class of the tree node does not match. */ +/* Similar to above, except that we check for a class of tree + code, given in CL. */ tree tree_class_check (node, cl, file, line, nofatal) @@ -4984,18 +4988,16 @@ tree_class_check (node, cl, file, line, nofatal) int line; int nofatal; { - if (TREE_CODE_CLASS (TREE_CODE (node)) != cl) - { - if (nofatal) - return 0; - else - fatal ("%s:%d: Expect '%c', have '%s'\n", file, line, - cl, tree_code_name[TREE_CODE (node)]); - } - - return node; + if (TREE_CODE_CLASS (TREE_CODE (node)) == cl) + return node; + else if (nofatal) + return 0; + else + fatal ("%s:%d: Expect '%c', have '%s'\n", file, line, + cl, tree_code_name[TREE_CODE (node)]); } -/* Complain if the node is not an expression. */ + +/* Likewise, but complain if the tree node is not an expression. */ tree expr_check (node, ignored, file, line, nofatal) |