This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][cilkplus] fix c++ implicit conversions with cilk_spawn (PR/69024, PR/68997)


On 01/20/2016 12:57 PM, Ryan Burn wrote:
      case AGGR_INIT_EXPR:
+      {
+	int len = 0;
+	int ii = 0;
+	extract_free_variables (TREE_OPERAND (t, 1), wd, ADD_READ);
+	if (TREE_CODE (TREE_OPERAND (t, 0)) == INTEGER_CST)
+	  {
+	    len = TREE_INT_CST_LOW (TREE_OPERAND (t, 0));
+
+	    for (ii = 3; ii < len; ii++)
+	      extract_free_variables (TREE_OPERAND (t, ii), wd, ADD_READ);
+	    extract_free_variables (TREE_TYPE (t), wd, ADD_READ);
+	  }
+	break;
+      }

Please add a comment about skipping operand 2 (the slot). Would it make sense to skip operand 2 (the static chain) for CALL_EXPR, too?

+is_conversion_operator_function_decl_p (tree t) {

Open brace gets its own line.

+	tree fn = AGGR_INIT_EXPR_FN (exp);
+	if (TREE_CODE (fn) == ADDR_EXPR
+	    && is_conversion_operator_function_decl_p (TREE_OPERAND (fn, 0))

It would be good to have a cp_get_callee_fndecl like the normal get_callee_fndecl, but supporting AGGR_INIT_EXPR as well. That would replace the less capable get_function_named_in_call function in constexpr.c and various other places that access AGGR_INIT_EXPR_FN directly. Mind doing that, either in this patch or as a follow-up?

Jason


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]