c-common.c (259694) | c-common.c (259947) |
---|---|
1/* Subroutines shared by all languages that are variants of C. 2 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 3 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 4 5This file is part of GCC. 6 7GCC is free software; you can redistribute it and/or modify it under 8the terms of the GNU General Public License as published by the Free --- 1974 unchanged lines hidden (view full) --- 1983 log = 0; 1984 else 1985 log = tree_floor_log2 (value); 1986 1987 return log + 1 + !unsignedp; 1988} 1989 1990/* Print an error message for invalid operands to arith operation | 1/* Subroutines shared by all languages that are variants of C. 2 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 3 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 4 5This file is part of GCC. 6 7GCC is free software; you can redistribute it and/or modify it under 8the terms of the GNU General Public License as published by the Free --- 1974 unchanged lines hidden (view full) --- 1983 log = 0; 1984 else 1985 log = tree_floor_log2 (value); 1986 1987 return log + 1 + !unsignedp; 1988} 1989 1990/* Print an error message for invalid operands to arith operation |
1991 CODE. */ | 1991 CODE with TYPE0 for operand 0, and TYPE1 for operand 1. */ |
1992 1993void | 1992 1993void |
1994binary_op_error (enum tree_code code) | 1994binary_op_error (enum tree_code code, tree type0, tree type1) |
1995{ 1996 const char *opname; 1997 1998 switch (code) 1999 { 2000 case PLUS_EXPR: 2001 opname = "+"; break; 2002 case MINUS_EXPR: --- 34 unchanged lines hidden (view full) --- 2037 opname = "&&"; break; 2038 case TRUTH_ORIF_EXPR: 2039 opname = "||"; break; 2040 case BIT_XOR_EXPR: 2041 opname = "^"; break; 2042 default: 2043 gcc_unreachable (); 2044 } | 1995{ 1996 const char *opname; 1997 1998 switch (code) 1999 { 2000 case PLUS_EXPR: 2001 opname = "+"; break; 2002 case MINUS_EXPR: --- 34 unchanged lines hidden (view full) --- 2037 opname = "&&"; break; 2038 case TRUTH_ORIF_EXPR: 2039 opname = "||"; break; 2040 case BIT_XOR_EXPR: 2041 opname = "^"; break; 2042 default: 2043 gcc_unreachable (); 2044 } |
2045 error ("invalid operands to binary %s", opname); | 2045 error ("invalid operands to binary %s (have %qT and %qT)", opname, 2046 type0, type1); |
2046} 2047 2048/* Subroutine of build_binary_op, used for comparison operations. 2049 See if the operands have both been converted from subword integer types 2050 and, if so, perhaps change them both back to their original type. 2051 This function is also responsible for converting the two operands 2052 to the proper common type for comparison. 2053 --- 4568 unchanged lines hidden --- | 2047} 2048 2049/* Subroutine of build_binary_op, used for comparison operations. 2050 See if the operands have both been converted from subword integer types 2051 and, if so, perhaps change them both back to their original type. 2052 This function is also responsible for converting the two operands 2053 to the proper common type for comparison. 2054 --- 4568 unchanged lines hidden --- |