您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ tree_cons函数代码示例

51自学网 2021-06-03 08:58:32
  C++
这篇教程C++ tree_cons函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中tree_cons函数的典型用法代码示例。如果您正苦于以下问题:C++ tree_cons函数的具体用法?C++ tree_cons怎么用?C++ tree_cons使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了tree_cons函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: make_attribute

treemake_attribute (const char *name, const char *arg_name, tree chain){  tree attr_name;  tree attr_arg_name;  tree attr_args;  tree attr;  attr_name = get_identifier (name);  attr_arg_name = build_string (strlen (arg_name), arg_name);  attr_args = tree_cons (NULL_TREE, attr_arg_name, NULL_TREE);  attr = tree_cons (attr_name, attr_args, chain);  return attr;}
开发者ID:krichter722,项目名称:gcc,代码行数:14,


示例2: do_free_exception

static treedo_free_exception (tree ptr){  tree fn;  fn = get_identifier ("__cxa_free_exception");  if (!get_global_value_if_present (fn, &fn))    {      /* Declare void __cxa_free_exception (void *).  */      fn = push_void_library_fn (fn, tree_cons (NULL_TREE, ptr_type_node,						void_list_node));    }  return build_function_call (fn, tree_cons (NULL_TREE, ptr, NULL_TREE));}
开发者ID:aosm,项目名称:libstdcxx_SUPanWheat,代码行数:15,


示例3: oacc_build_routine_dims

treeoacc_build_routine_dims (tree clauses){  /* Must match GOMP_DIM ordering.  */  static const omp_clause_code ids[]    = {OMP_CLAUSE_GANG, OMP_CLAUSE_WORKER, OMP_CLAUSE_VECTOR, OMP_CLAUSE_SEQ};  int ix;  int level = -1;  for (; clauses; clauses = OMP_CLAUSE_CHAIN (clauses))    for (ix = GOMP_DIM_MAX + 1; ix--;)      if (OMP_CLAUSE_CODE (clauses) == ids[ix])	{	  if (level >= 0)	    error_at (OMP_CLAUSE_LOCATION (clauses),		      "multiple loop axes specified for routine");	  level = ix;	  break;	}  /* Default to SEQ.  */  if (level < 0)    level = GOMP_DIM_MAX;  tree dims = NULL_TREE;  for (ix = GOMP_DIM_MAX; ix--;)    dims = tree_cons (build_int_cst (boolean_type_node, ix >= level),		      build_int_cst (integer_type_node, ix < level), dims);  return dims;}
开发者ID:WojciechMigda,项目名称:gcc,代码行数:32,


示例4: init_exception_processing

voidinit_exception_processing (void){  tree tmp;  /* void std::terminate (); */  push_namespace (std_identifier);  tmp = build_function_type (void_type_node, void_list_node);  terminate_node = build_cp_library_fn_ptr ("terminate", tmp);  TREE_THIS_VOLATILE (terminate_node) = 1;  TREE_NOTHROW (terminate_node) = 1;  pop_namespace ();  /* void __cxa_call_unexpected(void *); */  tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node);  tmp = build_function_type (void_type_node, tmp);  call_unexpected_node    = push_throw_library_fn (get_identifier ("__cxa_call_unexpected"), tmp);  eh_personality_libfunc = init_one_libfunc (USING_SJLJ_EXCEPTIONS					     ? "__gxx_personality_sj0"					     : "__gxx_personality_v0");  lang_eh_runtime_type = build_eh_type_type;  lang_protect_cleanup_actions = &cp_protect_cleanup_actions;}
开发者ID:aosm,项目名称:libstdcxx_SUPanWheat,代码行数:26,


示例5: sh_add_function_attribute

/* Add ATTR to the attributes of the current function.  If there is no   such function, save it to be added to the attributes of the next   function.  */static voidsh_add_function_attribute (const char *attr){  tree id = get_identifier (attr);  if (current_function_decl)    decl_attributes (&current_function_decl,		     tree_cons (id, NULL_TREE, NULL_TREE), 0);  else    {      *sh_deferred_function_attributes_tail	= tree_cons (id, NULL_TREE, *sh_deferred_function_attributes_tail);      sh_deferred_function_attributes_tail	= &TREE_CHAIN (*sh_deferred_function_attributes_tail);    }}
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.toolchain,代码行数:19,


示例6: declare_nothrow_library_fn

static treedeclare_nothrow_library_fn (tree name, tree return_type, tree parm_type){  tree tmp = tree_cons (NULL_TREE, parm_type, void_list_node);  return push_library_fn (name, build_function_type (return_type, tmp),			  empty_except_spec);}
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.toolchain,代码行数:7,


示例7: parse_signature_string

treeparse_signature_string (const unsigned char *sig_string, int sig_length){  tree result_type;  const unsigned char *str = sig_string;  const unsigned char *limit = str + sig_length;  if (str < limit && str[0] == '(')    {      tree argtype_list = NULL_TREE;      str++;      while (str < limit && str[0] != ')')	{	  tree argtype = parse_signature_type (&str, limit);	  argtype_list = tree_cons (NULL_TREE, argtype, argtype_list);	}      if (str++, str >= limit)	abort ();      result_type = parse_signature_type (&str, limit);      argtype_list = chainon (nreverse (argtype_list), end_params_node);      result_type = build_function_type (result_type, argtype_list);    }  else    result_type = parse_signature_type (&str, limit);  if (str != limit)    error ("junk at end of signature string");  return result_type;}
开发者ID:AHelper,项目名称:gcc,代码行数:28,


示例8: do_begin_catch

static treedo_begin_catch (void){  tree fn;  fn = get_identifier ("__cxa_begin_catch");  if (!get_global_value_if_present (fn, &fn))    {      /* Declare void* __cxa_begin_catch (void *).  */      tree tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node);      fn = push_library_fn (fn, build_function_type (ptr_type_node, tmp));    }  return build_function_call (fn, tree_cons (NULL_TREE, build_exc_ptr (),					     NULL_TREE));}
开发者ID:aosm,项目名称:libstdcxx_SUPanWheat,代码行数:16,


示例9: finish_eh_spec_block

voidfinish_eh_spec_block (tree raw_raises, tree eh_spec_block){  tree raises;  TREE_OPERAND (eh_spec_block, 0)    = pop_stmt_list (TREE_OPERAND (eh_spec_block, 0));  if (TREE_CODE (eh_spec_block) == MUST_NOT_THROW_EXPR)    return;  /* Strip cv quals, etc, from the specification types.  */  for (raises = NULL_TREE;       raw_raises && TREE_VALUE (raw_raises);       raw_raises = TREE_CHAIN (raw_raises))    {      tree type = prepare_eh_type (TREE_VALUE (raw_raises));      tree tinfo = eh_type_info (type);      mark_used (tinfo);      raises = tree_cons (NULL_TREE, type, raises);    }  EH_SPEC_RAISES (eh_spec_block) = raises;}
开发者ID:kusumi,项目名称:DragonFlyBSD,代码行数:25,


示例10: do_allocate_exception

static treedo_allocate_exception (tree type){  tree fn;  fn = get_identifier ("__cxa_allocate_exception");  if (!get_global_value_if_present (fn, &fn))    {      /* Declare void *__cxa_allocate_exception(size_t).  */      tree tmp = tree_cons (NULL_TREE, size_type_node, void_list_node);      fn = push_library_fn (fn, build_function_type (ptr_type_node, tmp));    }    return build_function_call (fn, tree_cons (NULL_TREE, size_in_bytes (type),					     NULL_TREE));}
开发者ID:aosm,项目名称:libstdcxx_SUPanWheat,代码行数:16,


示例11: start_cdtor

static treestart_cdtor (int method_type){  tree fnname = get_file_function_name (method_type);  tree void_list_node_1 = build_tree_list (NULL_TREE, void_type_node);  tree body;  start_function (void_list_node_1,		  build_nt (CALL_EXPR, fnname,			    tree_cons (NULL_TREE, NULL_TREE, void_list_node_1),			    NULL_TREE),		  NULL_TREE);  store_parm_decls ();  current_function_cannot_inline    = "static constructors and destructors cannot be inlined";  body = c_begin_compound_stmt ();  pushlevel (0);  clear_last_expr ();  add_scope_stmt (/*begin_p=*/1, /*partial_p=*/0);  return body;}
开发者ID:matrixsmaster,项目名称:zpugcc,代码行数:25,


示例12: tree_gen_one_value_profiler

static voidtree_gen_one_value_profiler (histogram_value value, unsigned tag, unsigned base){    tree stmt = value->hvalue.stmt;    block_stmt_iterator bsi = bsi_for_stmt (stmt);    tree ref = tree_coverage_counter_ref (tag, base), ref_ptr;    tree args, call, val;    ref_ptr = force_gimple_operand_bsi (&bsi,                                        build_addr (ref, current_function_decl),                                        true, NULL_TREE);    val = prepare_instrumented_value (&bsi, value);    args = tree_cons (NULL_TREE, ref_ptr,                      tree_cons (NULL_TREE, val,                                 NULL_TREE));    call = build_function_call_expr (tree_one_value_profiler_fn, args);    bsi_insert_before (&bsi, call, BSI_SAME_STMT);}
开发者ID:mbref,项目名称:gcc-412-microblaze,代码行数:18,


示例13: wrapper_parm_cb

static boolwrapper_parm_cb (const void *key0, void **val0, void *data){  struct wrapper_data *wd = (struct wrapper_data *) data;  tree arg = * (tree *)&key0;  tree val = (tree)*val0;  tree parm;  if (val == error_mark_node || val == arg)    return true;  if (TREE_CODE (val) == PAREN_EXPR)    {      /* We should not reach here with a register receiver.	 We may see a register variable modified in the	 argument list.  Because register variables are	 worker-local we don't need to work hard to support	 them in code that spawns.  */      if ((TREE_CODE (arg) == VAR_DECL) && DECL_HARD_REGISTER (arg))	{	  error_at (EXPR_LOCATION (arg),		    "explicit register variable %qD may not be modified in "		    "spawn", arg);	  arg = null_pointer_node;	}      else	arg = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (arg)), arg);	      val = TREE_OPERAND (val, 0);      *val0 = val;      gcc_assert (TREE_CODE (val) == INDIRECT_REF);      parm = TREE_OPERAND (val, 0);      STRIP_NOPS (parm);    }  else    parm = val;  TREE_CHAIN (parm) = wd->parms;  wd->parms = parm;  wd->argtypes = tree_cons (NULL_TREE, TREE_TYPE (parm), wd->argtypes);   wd->arglist = tree_cons (NULL_TREE, arg, wd->arglist);   return true;}
开发者ID:ChillyWillyGuru,项目名称:gcc-4.9.0-PS3,代码行数:42,


示例14: oacc_replace_fn_attrib

voidoacc_replace_fn_attrib (tree fn, tree dims){  tree ident = get_identifier (OACC_FN_ATTRIB);  tree attribs = DECL_ATTRIBUTES (fn);  /* If we happen to be present as the first attrib, drop it.  */  if (attribs && TREE_PURPOSE (attribs) == ident)    attribs = TREE_CHAIN (attribs);  DECL_ATTRIBUTES (fn) = tree_cons (ident, dims, attribs);}
开发者ID:WojciechMigda,项目名称:gcc,代码行数:11,


示例15: tree_code_add_parameter

tree tree_code_add_parameter (tree list, tree proto_exp, tree exp){  tree new_exp;  new_exp = tree_cons (NULL_TREE,                     build1 (CONVERT_EXPR, TREE_TYPE (proto_exp), exp),                    NULL_TREE);  if (!list)    return new_exp;  return chainon (new_exp, list);}
开发者ID:aosm,项目名称:gccfast,代码行数:11,


示例16: ptr_initializer

static treeptr_initializer (tree desc, tree target){  tree init = tinfo_base_init (desc, target);  tree to = TREE_TYPE (target);  int flags = qualifier_flags (to);  bool incomplete = target_incomplete_p (to);    if (incomplete)    flags |= 8;  init = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, flags), init);  init = tree_cons (NULL_TREE,                    get_tinfo_ptr (TYPE_MAIN_VARIANT (to)),                    init);    init = build_constructor (NULL_TREE, nreverse (init));  TREE_CONSTANT (init) = 1;  TREE_INVARIANT (init) = 1;  TREE_STATIC (init) = 1;  return init;}
开发者ID:DJHartley,项目名称:iphone-dev,代码行数:21,


示例17: maybe_add_dllexport

static inline void maybe_add_dllexport (tree decl) {  if (i386_pe_type_dllexport_p (decl))    {         tree decl_attrs = DECL_ATTRIBUTES (decl);      if (lookup_attribute ("dllexport", decl_attrs) != NULL_TREE)	/* Already done.  */	return;      DECL_ATTRIBUTES (decl) = tree_cons (get_identifier ("dllexport"),					  NULL_TREE, decl_attrs);    }}
开发者ID:nevinhappy,项目名称:gcc,代码行数:12,


示例18: mudflap_register_call

static voidmudflap_register_call (tree obj, tree object_size, tree varname){  tree arg, args, call_stmt;  args = tree_cons (NULL_TREE, varname, NULL_TREE);  arg = build_int_cst (NULL_TREE, 4); /* __MF_TYPE_STATIC */  args = tree_cons (NULL_TREE, arg, args);  arg = convert (size_type_node, object_size);  args = tree_cons (NULL_TREE, arg, args);  arg = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (obj)), obj);  arg = convert (ptr_type_node, arg);  args = tree_cons (NULL_TREE, arg, args);  call_stmt = build_function_call_expr (mf_register_fndecl, args);  append_to_statement_list (call_stmt, &enqueued_call_stmt_chain);}
开发者ID:0mp,项目名称:freebsd,代码行数:21,


示例19: genericize_eh_spec_block

static voidgenericize_eh_spec_block (tree *stmt_p){  tree body = EH_SPEC_STMTS (*stmt_p);  tree allowed = EH_SPEC_RAISES (*stmt_p);  tree failure = build_call (call_unexpected_node,			     tree_cons (NULL_TREE, build_exc_ptr (),					NULL_TREE));  gimplify_stmt (&body);  *stmt_p = gimple_build_eh_filter (body, allowed, failure);}
开发者ID:KrisChaplin,项目名称:octeon_toolchain-4.1,代码行数:12,


示例20: do_begin_catch

static tree/* APPLE LOCAL radar 2848255 */do_begin_catch (tree type){  tree fn;  /* APPLE LOCAL begin radar 2848255 */  if (c_dialect_objc () && objc2_valid_objc_catch_type (type))    fn = get_identifier ("objc_begin_catch");  else    fn = get_identifier ("__cxa_begin_catch");  /* APPLE LOCAL end radar 2848255 */  if (!get_global_value_if_present (fn, &fn))    {      /* Declare void* __cxa_begin_catch (void *).  */      tree tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node);      fn = push_library_fn (fn, build_function_type (ptr_type_node, tmp));    }  return build_function_call (fn, tree_cons (NULL_TREE, build_exc_ptr (),					     NULL_TREE));}
开发者ID:DJHartley,项目名称:iphone-dev,代码行数:22,


示例21: do_free_exception

static treedo_free_exception (tree ptr){  tree fn;  fn = get_identifier ("__cxa_free_exception");  if (!get_global_value_if_present (fn, &fn))    {      /* Declare void __cxa_free_exception (void *) throw().  */      fn = declare_nothrow_library_fn (fn, void_type_node, ptr_type_node);    }  return cp_build_function_call (fn, tree_cons (NULL_TREE, ptr, NULL_TREE),				 tf_warning_or_error);}
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.toolchain,代码行数:15,


示例22: add_objc_string

treeadd_objc_string (tree ident, string_section section){  tree *chain, decl, type;  char buf[BUFSIZE];  switch (section)    {    case class_names:      chain = &class_names_chain;      snprintf (buf, BUFSIZE, "_OBJC_ClassName_%s", IDENTIFIER_POINTER (ident));      break;    case meth_var_names:      chain = &meth_var_names_chain;      snprintf (buf, BUFSIZE, "_OBJC_METH_VAR_NAME_%d", meth_var_names_idx++);      break;    case meth_var_types:      chain = &meth_var_types_chain;      snprintf (buf, BUFSIZE, "_OBJC_METH_VAR_TYPE_%d", meth_var_types_idx++);      break;    case prop_names_attr:      chain = &prop_names_attr_chain;      snprintf (buf, BUFSIZE, "_OBJC_PropertyAttributeOrName_%d", property_name_attr_idx++);      break;    default:      gcc_unreachable ();    }  while (*chain)    {      if (TREE_VALUE (*chain) == ident)	return convert (string_type_node,			build_unary_op (input_location,					ADDR_EXPR, TREE_PURPOSE (*chain), 1));      chain = &TREE_CHAIN (*chain);    }  type = build_sized_array_type (char_type_node, IDENTIFIER_LENGTH (ident) + 1);  /* Get a runtime-specific string decl which will be finish_var()'ed in     generate_strings ().  */  decl = (*runtime.string_decl) (type, buf, section);  TREE_CONSTANT (decl) = 1;  *chain = tree_cons (decl, ident, NULL_TREE);  return convert (string_type_node,		  build_unary_op (input_location, ADDR_EXPR, decl, 1));}
开发者ID:Nodplus,项目名称:gcc,代码行数:48,


示例23: do_begin_catch

static treedo_begin_catch (void){  tree fn;  fn = get_identifier ("__cxa_begin_catch");  if (!get_global_value_if_present (fn, &fn))    {      /* Declare void* __cxa_begin_catch (void *) throw().  */      fn = declare_nothrow_library_fn (fn, ptr_type_node, ptr_type_node);    }  return cp_build_function_call (fn, tree_cons (NULL_TREE, build_exc_ptr (),						NULL_TREE),				 tf_warning_or_error);}
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.toolchain,代码行数:16,


示例24: rewrite_reciprocal

static treerewrite_reciprocal (block_stmt_iterator *bsi){  tree stmt, lhs, rhs, stmt1, stmt2, var, name, tmp;  tree real_one;  stmt = bsi_stmt (*bsi);  lhs = GENERIC_TREE_OPERAND (stmt, 0);  rhs = GENERIC_TREE_OPERAND (stmt, 1);  /* stmt must be GIMPLE_MODIFY_STMT.  */  var = create_tmp_var (TREE_TYPE (rhs), "reciptmp");  add_referenced_var (var);  DECL_GIMPLE_REG_P (var) = 1;  if (TREE_CODE (TREE_TYPE (rhs)) == VECTOR_TYPE)    {      int i, len;      tree list = NULL_TREE;      real_one = build_real (TREE_TYPE (TREE_TYPE (rhs)), dconst1);      len = TYPE_VECTOR_SUBPARTS (TREE_TYPE (rhs));      for (i = 0; i < len; i++)	list = tree_cons (NULL, real_one, list);      real_one = build_vector (TREE_TYPE (rhs), list);    }  else    real_one = build_real (TREE_TYPE (rhs), dconst1);  tmp = build2 (RDIV_EXPR, TREE_TYPE (rhs),		real_one, TREE_OPERAND (rhs, 1));  stmt1 = build_gimple_modify_stmt (var, tmp);  name = make_ssa_name (var, stmt1);  GIMPLE_STMT_OPERAND (stmt1, 0) = name;  tmp = build2 (MULT_EXPR, TREE_TYPE (rhs),		name, TREE_OPERAND (rhs, 0));  stmt2 = build_gimple_modify_stmt (lhs, tmp);  /* Replace division stmt with reciprocal and multiply stmts.     The multiply stmt is not invariant, so update iterator     and avoid rescanning.  */  bsi_replace (bsi, stmt1, true);  bsi_insert_after (bsi, stmt2, BSI_NEW_STMT);  SSA_NAME_DEF_STMT (lhs) = stmt2;  /* Continue processing with invariant reciprocal statement.  */  return stmt1;}
开发者ID:mdezeeuw,项目名称:mb-rvex,代码行数:47,


示例25: do_allocate_exception

static treedo_allocate_exception (tree type){  tree fn;  fn = get_identifier ("__cxa_allocate_exception");  if (!get_global_value_if_present (fn, &fn))    {      /* Declare void *__cxa_allocate_exception(size_t) throw().  */      fn = declare_nothrow_library_fn (fn, ptr_type_node, size_type_node);    }  return cp_build_function_call (fn, 				 tree_cons (NULL_TREE, size_in_bytes (type),					    NULL_TREE),				 tf_warning_or_error);}
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.toolchain,代码行数:17,



注:本文中的tree_cons函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ tree_insert函数代码示例
C++ treeScope函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。