call.c (171826) | call.c (220150) |
---|---|
1/* Functions related to invoking methods and overloaded functions. 2 Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 3 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 4 Contributed by Michael Tiemann (tiemann@cygnus.com) and 5 modified by Brendan Kehoe (brendan@cygnus.com). 6 7This file is part of GCC. 8 --- 4660 unchanged lines hidden (view full) --- 4669 return type; 4670} 4671 4672/* Actually perform the appropriate conversion. */ 4673 4674tree 4675convert_for_arg_passing (tree type, tree val) 4676{ | 1/* Functions related to invoking methods and overloaded functions. 2 Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 3 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 4 Contributed by Michael Tiemann (tiemann@cygnus.com) and 5 modified by Brendan Kehoe (brendan@cygnus.com). 6 7This file is part of GCC. 8 --- 4660 unchanged lines hidden (view full) --- 4669 return type; 4670} 4671 4672/* Actually perform the appropriate conversion. */ 4673 4674tree 4675convert_for_arg_passing (tree type, tree val) 4676{ |
4677 val = convert_bitfield_to_declared_type (val); | 4677 tree bitfield_type; 4678 4679 /* If VAL is a bitfield, then -- since it has already been converted 4680 to TYPE -- it cannot have a precision greater than TYPE. 4681 4682 If it has a smaller precision, we must widen it here. For 4683 example, passing "int f:3;" to a function expecting an "int" will 4684 not result in any conversion before this point. 4685 4686 If the precision is the same we must not risk widening. For 4687 example, the COMPONENT_REF for a 32-bit "long long" bitfield will 4688 often have type "int", even though the C++ type for the field is 4689 "long long". If the value is being passed to a function 4690 expecting an "int", then no conversions will be required. But, 4691 if we call convert_bitfield_to_declared_type, the bitfield will 4692 be converted to "long long". */ 4693 bitfield_type = is_bitfield_expr_with_lowered_type (val); 4694 if (bitfield_type 4695 && TYPE_PRECISION (TREE_TYPE (val)) < TYPE_PRECISION (type)) 4696 val = convert_to_integer (TYPE_MAIN_VARIANT (bitfield_type), val); 4697 |
4678 if (val == error_mark_node) 4679 ; 4680 /* Pass classes with copy ctors by invisible reference. */ 4681 else if (TREE_ADDRESSABLE (type)) 4682 val = build1 (ADDR_EXPR, build_reference_type (type), val); 4683 else if (targetm.calls.promote_prototypes (type) 4684 && INTEGRAL_TYPE_P (type) 4685 && COMPLETE_TYPE_P (type) --- 2063 unchanged lines hidden --- | 4698 if (val == error_mark_node) 4699 ; 4700 /* Pass classes with copy ctors by invisible reference. */ 4701 else if (TREE_ADDRESSABLE (type)) 4702 val = build1 (ADDR_EXPR, build_reference_type (type), val); 4703 else if (targetm.calls.promote_prototypes (type) 4704 && INTEGRAL_TYPE_P (type) 4705 && COMPLETE_TYPE_P (type) --- 2063 unchanged lines hidden --- |