这篇教程C++ DECL_HAS_VALUE_EXPR_P函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中DECL_HAS_VALUE_EXPR_P函数的典型用法代码示例。如果您正苦于以下问题:C++ DECL_HAS_VALUE_EXPR_P函数的具体用法?C++ DECL_HAS_VALUE_EXPR_P怎么用?C++ DECL_HAS_VALUE_EXPR_P使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了DECL_HAS_VALUE_EXPR_P函数的21个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: varpool_assemble_decl/* Output one variable, if necessary. Return whether we output it. */boolvarpool_assemble_decl (struct varpool_node *node){ tree decl = node->decl; if (!TREE_ASM_WRITTEN (decl) && !node->alias && !DECL_EXTERNAL (decl) && (TREE_CODE (decl) != VAR_DECL || !DECL_HAS_VALUE_EXPR_P (decl))) { assemble_variable (decl, 0, 1, 0); if (TREE_ASM_WRITTEN (decl)) { struct varpool_node *alias; node->next_needed = varpool_assembled_nodes_queue; varpool_assembled_nodes_queue = node; node->finalized = 1; /* Also emit any extra name aliases. */ for (alias = node->extra_name; alias; alias = alias->next) { /* Update linkage fields in case they've changed. */ DECL_WEAK (alias->decl) = DECL_WEAK (decl); TREE_PUBLIC (alias->decl) = TREE_PUBLIC (decl); DECL_VISIBILITY (alias->decl) = DECL_VISIBILITY (decl); assemble_alias (alias->decl, DECL_ASSEMBLER_NAME (decl)); } return true; } } return false;}
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.toolchain,代码行数:36,
示例2: lto_input_ts_decl_common_tree_pointersstatic voidlto_input_ts_decl_common_tree_pointers (struct lto_input_block *ib, struct data_in *data_in, tree expr){ DECL_SIZE (expr) = stream_read_tree (ib, data_in); DECL_SIZE_UNIT (expr) = stream_read_tree (ib, data_in); DECL_ATTRIBUTES (expr) = stream_read_tree (ib, data_in); /* Do not stream DECL_ABSTRACT_ORIGIN. We cannot handle debug information for early inlining so drop it on the floor instead of ICEing in dwarf2out.c. */ if (TREE_CODE (expr) == PARM_DECL) TREE_CHAIN (expr) = streamer_read_chain (ib, data_in); if ((TREE_CODE (expr) == VAR_DECL || TREE_CODE (expr) == PARM_DECL) && DECL_HAS_VALUE_EXPR_P (expr)) SET_DECL_VALUE_EXPR (expr, stream_read_tree (ib, data_in)); if (TREE_CODE (expr) == VAR_DECL) { tree dexpr = stream_read_tree (ib, data_in); if (dexpr) SET_DECL_DEBUG_EXPR (expr, dexpr); }}
开发者ID:JuanMiguelBG,项目名称:gcc-4.7.0-PS3,代码行数:27,
示例3: write_ts_decl_common_tree_pointersstatic voidwrite_ts_decl_common_tree_pointers (struct output_block *ob, tree expr, bool ref_p){ stream_write_tree (ob, DECL_SIZE (expr), ref_p); stream_write_tree (ob, DECL_SIZE_UNIT (expr), ref_p); /* Note, DECL_INITIAL is not handled here. Since DECL_INITIAL needs special handling in LTO, it must be handled by streamer hooks. */ stream_write_tree (ob, DECL_ATTRIBUTES (expr), ref_p); /* Do not stream DECL_ABSTRACT_ORIGIN. We cannot handle debug information for early inlining so drop it on the floor instead of ICEing in dwarf2out.c. */ if (TREE_CODE (expr) == PARM_DECL) streamer_write_chain (ob, TREE_CHAIN (expr), ref_p); if ((TREE_CODE (expr) == VAR_DECL || TREE_CODE (expr) == PARM_DECL) && DECL_HAS_VALUE_EXPR_P (expr)) stream_write_tree (ob, DECL_VALUE_EXPR (expr), ref_p); if (TREE_CODE (expr) == VAR_DECL) stream_write_tree (ob, DECL_DEBUG_EXPR (expr), ref_p);}
开发者ID:Samsara00,项目名称:DragonFlyBSD,代码行数:27,
示例4: target_for_debug_bindtreetarget_for_debug_bind (tree var){ if (!MAY_HAVE_DEBUG_STMTS) return NULL_TREE; if (TREE_CODE (var) == SSA_NAME) { var = SSA_NAME_VAR (var); if (var == NULL_TREE) return NULL_TREE; } if ((TREE_CODE (var) != VAR_DECL || VAR_DECL_IS_VIRTUAL_OPERAND (var)) && TREE_CODE (var) != PARM_DECL) return NULL_TREE; if (DECL_HAS_VALUE_EXPR_P (var)) return target_for_debug_bind (DECL_VALUE_EXPR (var)); if (DECL_IGNORED_P (var)) return NULL_TREE; /* var-tracking only tracks registers. */ if (!is_gimple_reg_type (TREE_TYPE (var))) return NULL_TREE; return var;}
开发者ID:Caleb1994,项目名称:stewieos-gcc,代码行数:30,
示例5: build_capture_proxytreebuild_capture_proxy (tree member){ tree var, object, fn, closure, name, lam, type; if (PACK_EXPANSION_P (member)) member = PACK_EXPANSION_PATTERN (member); closure = DECL_CONTEXT (member); fn = lambda_function (closure); lam = CLASSTYPE_LAMBDA_EXPR (closure); /* The proxy variable forwards to the capture field. */ object = build_fold_indirect_ref (DECL_ARGUMENTS (fn)); object = finish_non_static_data_member (member, object, NULL_TREE); if (REFERENCE_REF_P (object)) object = TREE_OPERAND (object, 0); /* Remove the __ inserted by add_capture. */ if (DECL_NORMAL_CAPTURE_P (member)) name = get_identifier (IDENTIFIER_POINTER (DECL_NAME (member)) + 2); else name = DECL_NAME (member); type = lambda_proxy_type (object); if (DECL_VLA_CAPTURE_P (member)) { /* Rebuild the VLA type from the pointer and maxindex. */ tree field = next_initializable_field (TYPE_FIELDS (type)); tree ptr = build_simple_component_ref (object, field); field = next_initializable_field (DECL_CHAIN (field)); tree max = build_simple_component_ref (object, field); type = build_cplus_array_type (TREE_TYPE (TREE_TYPE (ptr)), build_index_type (max)); type = build_reference_type (type); REFERENCE_VLA_OK (type) = true; object = convert (type, ptr); } var = build_decl (input_location, VAR_DECL, name, type); SET_DECL_VALUE_EXPR (var, object); DECL_HAS_VALUE_EXPR_P (var) = 1; DECL_ARTIFICIAL (var) = 1; TREE_USED (var) = 1; DECL_CONTEXT (var) = fn; if (name == this_identifier) { gcc_assert (LAMBDA_EXPR_THIS_CAPTURE (lam) == member); LAMBDA_EXPR_THIS_CAPTURE (lam) = var; } if (fn == current_function_decl) insert_capture_proxy (var); else vec_safe_push (LAMBDA_EXPR_PENDING_PROXIES (lam), var); return var;}
开发者ID:alisw,项目名称:gcc-toolchain,代码行数:60,
示例6: varpool_assemble_decl/* Output one variable, if necessary. Return whether we output it. */boolvarpool_assemble_decl (struct varpool_node *node){ tree decl = node->decl; if (!TREE_ASM_WRITTEN (decl) && !node->alias && !node->in_other_partition && !DECL_EXTERNAL (decl) && (TREE_CODE (decl) != VAR_DECL || !DECL_HAS_VALUE_EXPR_P (decl))) { assemble_variable (decl, 0, 1, 0); if (TREE_ASM_WRITTEN (decl)) { node->next_needed = varpool_assembled_nodes_queue; node->prev_needed = NULL; if (varpool_assembled_nodes_queue) varpool_assembled_nodes_queue->prev_needed = node; varpool_assembled_nodes_queue = node; node->finalized = 1; assemble_aliases (node); return true; } } return false;}
开发者ID:Gwenio,项目名称:DragonFlyBSD,代码行数:28,
示例7: is_capture_proxyboolis_capture_proxy (tree decl){ return (VAR_P (decl) && DECL_HAS_VALUE_EXPR_P (decl) && !DECL_ANON_UNION_VAR_P (decl) && LAMBDA_FUNCTION_P (DECL_CONTEXT (decl)));}
开发者ID:nguyentu1602,项目名称:gcc,代码行数:8,
示例8: varpool_assemble_declboolvarpool_assemble_decl (varpool_node *node){ tree decl = node->decl; /* Aliases are outout when their target is produced or by output_weakrefs. */ if (node->alias) return false; /* Constant pool is output from RTL land when the reference survive till this level. */ if (DECL_IN_CONSTANT_POOL (decl) && TREE_ASM_WRITTEN (decl)) return false; /* Decls with VALUE_EXPR should not be in the varpool at all. They are not real variables, but just info for debugging and codegen. Unfortunately at the moment emutls is not updating varpool correctly after turning real vars into value_expr vars. */ if (DECL_HAS_VALUE_EXPR_P (decl) && !targetm.have_tls) return false; /* Hard register vars do not need to be output. */ if (DECL_HARD_REGISTER (decl)) return false; gcc_checking_assert (!TREE_ASM_WRITTEN (decl) && TREE_CODE (decl) == VAR_DECL && !DECL_HAS_VALUE_EXPR_P (decl)); if (!node->in_other_partition && !DECL_EXTERNAL (decl)) { assemble_variable (decl, 0, 1, 0); gcc_assert (TREE_ASM_WRITTEN (decl)); node->definition = true; assemble_aliases (node); return true; } return false;}
开发者ID:palves,项目名称:gcc,代码行数:43,
示例9: varpool_finalize_named_section_flags/* For variables in named sections make sure get_variable_section is called before we switch to those sections. Then section conflicts between read-only and read-only requiring relocations sections can be resolved. */voidvarpool_finalize_named_section_flags (varpool_node *node){ if (!TREE_ASM_WRITTEN (node->decl) && !node->alias && !node->in_other_partition && !DECL_EXTERNAL (node->decl) && TREE_CODE (node->decl) == VAR_DECL && !DECL_HAS_VALUE_EXPR_P (node->decl) && DECL_SECTION_NAME (node->decl)) get_variable_section (node->decl, false);}
开发者ID:palves,项目名称:gcc,代码行数:16,
示例10: mf_decl_eligible_p/* Check whether the given decl, generally a VAR_DECL or PARM_DECL, is eligible for instrumentation. For the mudflap1 pass, this implies that it should be registered with the libmudflap runtime. For the mudflap2 pass this means instrumenting an indirection operation with respect to the object.*/static intmf_decl_eligible_p (tree decl){ return ((TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == PARM_DECL) /* The decl must have its address taken. In the case of arrays, this flag is also set if the indexes are not compile-time known valid constants. */ && TREE_ADDRESSABLE (decl) /* XXX: not sufficient: return-by-value structs! */ /* The type of the variable must be complete. */ && COMPLETE_OR_VOID_TYPE_P (TREE_TYPE (decl)) /* The decl hasn't been decomposed somehow. */ && !DECL_HAS_VALUE_EXPR_P (decl));}
开发者ID:0mp,项目名称:freebsd,代码行数:19,
示例11: unpack_ts_decl_common_value_fieldsstatic voidunpack_ts_decl_common_value_fields (struct bitpack_d *bp, tree expr){ DECL_MODE (expr) = bp_unpack_machine_mode (bp); DECL_NONLOCAL (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_VIRTUAL_P (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_IGNORED_P (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_ABSTRACT_P (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_ARTIFICIAL (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_USER_ALIGN (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_PRESERVE_P (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_EXTERNAL (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_GIMPLE_REG_P (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_ALIGN (expr) = (unsigned) bp_unpack_var_len_unsigned (bp);#ifdef ACCEL_COMPILER if (DECL_ALIGN (expr) > targetm.absolute_biggest_alignment) DECL_ALIGN (expr) = targetm.absolute_biggest_alignment;#endif if (TREE_CODE (expr) == LABEL_DECL) { EH_LANDING_PAD_NR (expr) = (int) bp_unpack_var_len_unsigned (bp); /* Always assume an initial value of -1 for LABEL_DECL_UID to force gimple_set_bb to recreate label_to_block_map. */ LABEL_DECL_UID (expr) = -1; } if (TREE_CODE (expr) == FIELD_DECL) { DECL_PACKED (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_NONADDRESSABLE_P (expr) = (unsigned) bp_unpack_value (bp, 1); expr->decl_common.off_align = bp_unpack_value (bp, 8); } if (TREE_CODE (expr) == VAR_DECL) { DECL_HAS_DEBUG_EXPR_P (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_NONLOCAL_FRAME (expr) = (unsigned) bp_unpack_value (bp, 1); } if (TREE_CODE (expr) == RESULT_DECL || TREE_CODE (expr) == PARM_DECL || TREE_CODE (expr) == VAR_DECL) { DECL_BY_REFERENCE (expr) = (unsigned) bp_unpack_value (bp, 1); if (TREE_CODE (expr) == VAR_DECL || TREE_CODE (expr) == PARM_DECL) DECL_HAS_VALUE_EXPR_P (expr) = (unsigned) bp_unpack_value (bp, 1); }}
开发者ID:pdziepak,项目名称:gcc,代码行数:50,
示例12: gfc_omp_predetermined_sharingenum omp_clause_default_kindgfc_omp_predetermined_sharing (tree decl){ if (DECL_ARTIFICIAL (decl) && ! GFC_DECL_RESULT (decl)) return OMP_CLAUSE_DEFAULT_SHARED; /* Cray pointees shouldn't be listed in any clauses and should be gimplified to dereference of the corresponding Cray pointer. Make them all private, so that they are emitted in the debug information. */ if (GFC_DECL_CRAY_POINTEE (decl)) return OMP_CLAUSE_DEFAULT_PRIVATE; /* Assumed-size arrays are predetermined to inherit sharing attributes of the associated actual argument, which is shared for all we care. */ if (TREE_CODE (decl) == PARM_DECL && GFC_ARRAY_TYPE_P (TREE_TYPE (decl)) && GFC_TYPE_ARRAY_AKIND (TREE_TYPE (decl)) == GFC_ARRAY_UNKNOWN && GFC_TYPE_ARRAY_UBOUND (TREE_TYPE (decl), GFC_TYPE_ARRAY_RANK (TREE_TYPE (decl)) - 1) == NULL) return OMP_CLAUSE_DEFAULT_SHARED; /* COMMON and EQUIVALENCE decls are shared. They are only referenced through DECL_VALUE_EXPR of the variables contained in them. If those are privatized, they will not be gimplified to the COMMON or EQUIVALENCE decls. */ if (GFC_DECL_COMMON_OR_EQUIV (decl) && ! DECL_HAS_VALUE_EXPR_P (decl)) return OMP_CLAUSE_DEFAULT_SHARED; if (GFC_DECL_RESULT (decl) && ! DECL_HAS_VALUE_EXPR_P (decl)) return OMP_CLAUSE_DEFAULT_SHARED; return OMP_CLAUSE_DEFAULT_UNSPECIFIED;}
开发者ID:Scorpiion,项目名称:Renux_cross_gcc,代码行数:36,
示例13: pack_ts_decl_common_value_fieldsstatic voidpack_ts_decl_common_value_fields (struct bitpack_d *bp, tree expr){ bp_pack_enum (bp, machine_mode, MAX_MACHINE_MODE, DECL_MODE (expr)); bp_pack_value (bp, DECL_NONLOCAL (expr), 1); bp_pack_value (bp, DECL_VIRTUAL_P (expr), 1); bp_pack_value (bp, DECL_IGNORED_P (expr), 1); bp_pack_value (bp, DECL_ABSTRACT (expr), 1); bp_pack_value (bp, DECL_ARTIFICIAL (expr), 1); bp_pack_value (bp, DECL_USER_ALIGN (expr), 1); bp_pack_value (bp, DECL_PRESERVE_P (expr), 1); bp_pack_value (bp, DECL_EXTERNAL (expr), 1); bp_pack_value (bp, DECL_GIMPLE_REG_P (expr), 1); bp_pack_var_len_unsigned (bp, DECL_ALIGN (expr)); if (TREE_CODE (expr) == LABEL_DECL) { /* Note that we do not write LABEL_DECL_UID. The reader will always assume an initial value of -1 so that the label_to_block_map is recreated by gimple_set_bb. */ bp_pack_value (bp, DECL_ERROR_ISSUED (expr), 1); bp_pack_var_len_unsigned (bp, EH_LANDING_PAD_NR (expr)); } if (TREE_CODE (expr) == FIELD_DECL) { bp_pack_value (bp, DECL_PACKED (expr), 1); bp_pack_value (bp, DECL_NONADDRESSABLE_P (expr), 1); bp_pack_value (bp, expr->decl_common.off_align, 8); } if (TREE_CODE (expr) == VAR_DECL) { bp_pack_value (bp, DECL_HAS_DEBUG_EXPR_P (expr), 1); bp_pack_value (bp, DECL_NONLOCAL_FRAME (expr), 1); } if (TREE_CODE (expr) == RESULT_DECL || TREE_CODE (expr) == PARM_DECL || TREE_CODE (expr) == VAR_DECL) { bp_pack_value (bp, DECL_BY_REFERENCE (expr), 1); if (TREE_CODE (expr) == VAR_DECL || TREE_CODE (expr) == PARM_DECL) bp_pack_value (bp, DECL_HAS_VALUE_EXPR_P (expr), 1); }}
开发者ID:delkon,项目名称:gcc,代码行数:47,
示例14: unpack_ts_decl_common_value_fieldsstatic voidunpack_ts_decl_common_value_fields (struct bitpack_d *bp, tree expr){ DECL_MODE (expr) = bp_unpack_enum (bp, machine_mode, MAX_MACHINE_MODE); DECL_NONLOCAL (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_VIRTUAL_P (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_IGNORED_P (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_ABSTRACT (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_ARTIFICIAL (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_USER_ALIGN (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_PRESERVE_P (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_DEBUG_EXPR_IS_FROM (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_EXTERNAL (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_GIMPLE_REG_P (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_ALIGN (expr) = (unsigned) bp_unpack_var_len_unsigned (bp); if (TREE_CODE (expr) == LABEL_DECL) { DECL_ERROR_ISSUED (expr) = (unsigned) bp_unpack_value (bp, 1); EH_LANDING_PAD_NR (expr) = (int) bp_unpack_var_len_unsigned (bp); /* Always assume an initial value of -1 for LABEL_DECL_UID to force gimple_set_bb to recreate label_to_block_map. */ LABEL_DECL_UID (expr) = -1; } if (TREE_CODE (expr) == FIELD_DECL) { DECL_PACKED (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_NONADDRESSABLE_P (expr) = (unsigned) bp_unpack_value (bp, 1); expr->decl_common.off_align = bp_unpack_value (bp, 8); } if (TREE_CODE (expr) == VAR_DECL) DECL_NONLOCAL_FRAME (expr) = (unsigned) bp_unpack_value (bp, 1); if (TREE_CODE (expr) == RESULT_DECL || TREE_CODE (expr) == PARM_DECL || TREE_CODE (expr) == VAR_DECL) { DECL_BY_REFERENCE (expr) = (unsigned) bp_unpack_value (bp, 1); if (TREE_CODE (expr) == VAR_DECL || TREE_CODE (expr) == PARM_DECL) DECL_HAS_VALUE_EXPR_P (expr) = (unsigned) bp_unpack_value (bp, 1); }}
开发者ID:MaddTheSane,项目名称:haiku-buildtools,代码行数:46,
示例15: gcc_cp_genericizevoidgcc_cp_genericize (tree fndecl){ register_src_file(fndecl); tree t; struct cp_genericize_data wtd; /* Fix up the types of parms passed by invisible reference. */ for (t = DECL_ARGUMENTS (fndecl); t; t = DECL_CHAIN (t)) if (TREE_ADDRESSABLE (TREE_TYPE (t))) { /* If a function's arguments are copied to create a thunk, then DECL_BY_REFERENCE will be set -- but the type of the argument will be a pointer type, so we will never get here. */ gcc_assert (!DECL_BY_REFERENCE (t)); gcc_assert (DECL_ARG_TYPE (t) != TREE_TYPE (t)); TREE_TYPE (t) = DECL_ARG_TYPE (t); DECL_BY_REFERENCE (t) = 1; TREE_ADDRESSABLE (t) = 0; relayout_decl (t); } /* Do the same for the return value. */ if (TREE_ADDRESSABLE (TREE_TYPE (DECL_RESULT (fndecl)))) { t = DECL_RESULT (fndecl); TREE_TYPE (t) = build_reference_type (TREE_TYPE (t)); DECL_BY_REFERENCE (t) = 1; TREE_ADDRESSABLE (t) = 0; relayout_decl (t); if (DECL_NAME (t)) { /* Adjust DECL_VALUE_EXPR of the original var. */ tree outer = outer_curly_brace_block (current_function_decl); tree var; if (outer) for (var = BLOCK_VARS (outer); var; var = DECL_CHAIN (var)) if (DECL_NAME (t) == DECL_NAME (var) && DECL_HAS_VALUE_EXPR_P (var) && DECL_VALUE_EXPR (var) == t) { tree val = convert_from_reference (t); SET_DECL_VALUE_EXPR (var, val); break; } } } /* If we're a clone, the body is already GIMPLE. */ if (DECL_CLONED_FUNCTION_P (fndecl)) return; /* We do want to see every occurrence of the parms, so we can't just use walk_tree's hash functionality. */ wtd.p_set = pointer_set_create (); wtd.bind_expr_stack = NULL; cp_walk_tree (&DECL_SAVED_TREE (fndecl), cp_genericize_r, &wtd, NULL); pointer_set_destroy (wtd.p_set); VEC_free (tree, heap, wtd.bind_expr_stack); /* Do everything else. */ gcc_genericize (fndecl); gcc_assert (bc_label[bc_break] == NULL); gcc_assert (bc_label[bc_continue] == NULL);}
开发者ID:pkzhiking,项目名称:yy,代码行数:68,
示例16: print_node//.........这里部分代码省略......... if (CODE_CONTAINS_STRUCT (code, TS_DECL_NON_COMMON)) { print_node (file, "result", DECL_RESULT_FLD (node), indent + 4); } lang_hooks.print_decl (file, node, indent); if (DECL_RTL_SET_P (node)) { indent_to (file, indent + 4); print_rtl (file, DECL_RTL (node)); } if (code == PARM_DECL) { print_node (file, "arg-type", DECL_ARG_TYPE (node), indent + 4); if (DECL_INCOMING_RTL (node) != 0) { indent_to (file, indent + 4); fprintf (file, "incoming-rtl "); print_rtl (file, DECL_INCOMING_RTL (node)); } } else if (code == FUNCTION_DECL && DECL_STRUCT_FUNCTION (node) != 0) { print_node (file, "arguments", DECL_ARGUMENTS (node), indent + 4); indent_to (file, indent + 4); dump_addr (file, "struct-function ", DECL_STRUCT_FUNCTION (node)); } if ((code == VAR_DECL || code == PARM_DECL) && DECL_HAS_VALUE_EXPR_P (node)) print_node (file, "value-expr", DECL_VALUE_EXPR (node), indent + 4); /* Print the decl chain only if decl is at second level. */ if (indent == 4) print_node (file, "chain", TREE_CHAIN (node), indent + 4); else print_node_brief (file, "chain", TREE_CHAIN (node), indent + 4); break; case tcc_type: if (TYPE_UNSIGNED (node)) fputs (" unsigned", file); if (TYPE_NO_FORCE_BLK (node)) fputs (" no-force-blk", file); if (TYPE_STRING_FLAG (node)) fputs (" string-flag", file); if (TYPE_NEEDS_CONSTRUCTING (node)) fputs (" needs-constructing", file); if ((code == RECORD_TYPE || code == UNION_TYPE || code == QUAL_UNION_TYPE || code == ARRAY_TYPE) && TYPE_REVERSE_STORAGE_ORDER (node)) fputs (" reverse-storage-order", file); /* The transparent-union flag is used for different things in different nodes. */ if ((code == UNION_TYPE || code == RECORD_TYPE)
开发者ID:RajibTheKing,项目名称:gcc,代码行数:67,
示例17: use_thunk//.........这里部分代码省略......... { TREE_ASM_WRITTEN (thunk_fndecl) = 1; return; } push_to_top_level (); if (TARGET_USE_LOCAL_THUNK_ALIAS_P (function) && targetm.have_named_sections) { resolve_unique_section (function, 0, flag_function_sections); if (DECL_SECTION_NAME (function) != NULL && DECL_ONE_ONLY (function)) { resolve_unique_section (thunk_fndecl, 0, flag_function_sections); /* Output the thunk into the same section as function. */ DECL_SECTION_NAME (thunk_fndecl) = DECL_SECTION_NAME (function); } } /* The back-end expects DECL_INITIAL to contain a BLOCK, so we create one. */ DECL_INITIAL (thunk_fndecl) = make_node (BLOCK); /* Set up cloned argument trees for the thunk. */ t = NULL_TREE; for (a = DECL_ARGUMENTS (function); a; a = TREE_CHAIN (a)) { tree x = copy_node (a); TREE_CHAIN (x) = t; DECL_CONTEXT (x) = thunk_fndecl; SET_DECL_RTL (x, NULL_RTX); DECL_HAS_VALUE_EXPR_P (x) = 0; t = x; } a = nreverse (t); DECL_ARGUMENTS (thunk_fndecl) = a; BLOCK_VARS (DECL_INITIAL (thunk_fndecl)) = a; if (this_adjusting && targetm.asm_out.can_output_mi_thunk (thunk_fndecl, fixed_offset, virtual_value, alias)) { const char *fnname; current_function_decl = thunk_fndecl; DECL_RESULT (thunk_fndecl) = build_decl (RESULT_DECL, 0, integer_type_node); fnname = XSTR (XEXP (DECL_RTL (thunk_fndecl), 0), 0); init_function_start (thunk_fndecl); current_function_is_thunk = 1; assemble_start_function (thunk_fndecl, fnname); targetm.asm_out.output_mi_thunk (asm_out_file, thunk_fndecl, fixed_offset, virtual_value, alias); assemble_end_function (thunk_fndecl, fnname); init_insn_lengths (); current_function_decl = 0; cfun = 0; TREE_ASM_WRITTEN (thunk_fndecl) = 1; } else { /* If this is a covariant thunk, or we don't have the necessary code for efficient thunks, generate a thunk function that
开发者ID:asdlei00,项目名称:freebsd,代码行数:67,
示例18: cp_genericizevoidcp_genericize (tree fndecl){ tree t; /* Fix up the types of parms passed by invisible reference. */ for (t = DECL_ARGUMENTS (fndecl); t; t = DECL_CHAIN (t)) if (TREE_ADDRESSABLE (TREE_TYPE (t))) { /* If a function's arguments are copied to create a thunk, then DECL_BY_REFERENCE will be set -- but the type of the argument will be a pointer type, so we will never get here. */ gcc_assert (!DECL_BY_REFERENCE (t)); gcc_assert (DECL_ARG_TYPE (t) != TREE_TYPE (t)); TREE_TYPE (t) = DECL_ARG_TYPE (t); DECL_BY_REFERENCE (t) = 1; TREE_ADDRESSABLE (t) = 0; relayout_decl (t); } /* Do the same for the return value. */ if (TREE_ADDRESSABLE (TREE_TYPE (DECL_RESULT (fndecl)))) { t = DECL_RESULT (fndecl); TREE_TYPE (t) = build_reference_type (TREE_TYPE (t)); DECL_BY_REFERENCE (t) = 1; TREE_ADDRESSABLE (t) = 0; relayout_decl (t); if (DECL_NAME (t)) { /* Adjust DECL_VALUE_EXPR of the original var. */ tree outer = outer_curly_brace_block (current_function_decl); tree var; if (outer) for (var = BLOCK_VARS (outer); var; var = DECL_CHAIN (var)) if (DECL_NAME (t) == DECL_NAME (var) && DECL_HAS_VALUE_EXPR_P (var) && DECL_VALUE_EXPR (var) == t) { tree val = convert_from_reference (t); SET_DECL_VALUE_EXPR (var, val); break; } } } /* If we're a clone, the body is already GIMPLE. */ if (DECL_CLONED_FUNCTION_P (fndecl)) return; /* Expand all the array notations here. */ if (flag_enable_cilkplus && contains_array_notation_expr (DECL_SAVED_TREE (fndecl))) DECL_SAVED_TREE (fndecl) = expand_array_notation_exprs (DECL_SAVED_TREE (fndecl)); /* We do want to see every occurrence of the parms, so we can't just use walk_tree's hash functionality. */ cp_genericize_tree (&DECL_SAVED_TREE (fndecl)); if (flag_sanitize & SANITIZE_RETURN) cp_ubsan_maybe_instrument_return (fndecl); /* Do everything else. */ c_genericize (fndecl); gcc_assert (bc_label[bc_break] == NULL); gcc_assert (bc_label[bc_continue] == NULL);}
开发者ID:didemoto,项目名称:gcc,代码行数:71,
示例19: build_cgraph_edgesstatic unsigned intbuild_cgraph_edges (void){ basic_block bb; struct cgraph_node *node = cgraph_get_node (current_function_decl); struct pointer_set_t *visited_nodes = pointer_set_create (); gimple_stmt_iterator gsi; tree decl; unsigned ix; /* Create the callgraph edges and record the nodes referenced by the function. body. */ FOR_EACH_BB_FN (bb, cfun) { for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi)) { gimple stmt = gsi_stmt (gsi); tree decl; if (is_gimple_debug (stmt)) continue; if (is_gimple_call (stmt)) { int freq = compute_call_stmt_bb_frequency (current_function_decl, bb); decl = gimple_call_fndecl (stmt); if (decl) cgraph_create_edge (node, cgraph_get_create_node (decl), stmt, bb->count, freq); else if (gimple_call_internal_p (stmt)) ; else cgraph_create_indirect_edge (node, stmt, gimple_call_flags (stmt), bb->count, freq); } ipa_record_stmt_references (node, stmt); if (gimple_code (stmt) == GIMPLE_OMP_PARALLEL && gimple_omp_parallel_child_fn (stmt)) { tree fn = gimple_omp_parallel_child_fn (stmt); ipa_record_reference (node, cgraph_get_create_node (fn), IPA_REF_ADDR, stmt); } if (gimple_code (stmt) == GIMPLE_OMP_TASK) { tree fn = gimple_omp_task_child_fn (stmt); if (fn) ipa_record_reference (node, cgraph_get_create_node (fn), IPA_REF_ADDR, stmt); fn = gimple_omp_task_copy_fn (stmt); if (fn) ipa_record_reference (node, cgraph_get_create_node (fn), IPA_REF_ADDR, stmt); } } for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi)) ipa_record_stmt_references (node, gsi_stmt (gsi)); } /* Look for initializers of constant variables and private statics. */ FOR_EACH_LOCAL_DECL (cfun, ix, decl) if (TREE_CODE (decl) == VAR_DECL && (TREE_STATIC (decl) && !DECL_EXTERNAL (decl)) && !DECL_HAS_VALUE_EXPR_P (decl)) varpool_finalize_decl (decl); record_eh_tables (node, cfun); pointer_set_destroy (visited_nodes); return 0;}
开发者ID:ArtemL,项目名称:GCC,代码行数:75,
示例20: create_common//.........这里部分代码省略......... /* Has SAVE attribute. */ if (s->sym->attr.save) is_saved = true; } finish_record_layout (rli, true); if (com) decl = build_common_decl (com, union_type, is_init); else decl = build_equiv_decl (union_type, is_init, is_saved); if (is_init) { tree ctor, tmp; VEC(constructor_elt,gc) *v = NULL; if (field != NULL_TREE && field_init != NULL_TREE) CONSTRUCTOR_APPEND_ELT (v, field, field_init); else for (s = head; s; s = s->next) { if (s->sym->value) { /* Add the initializer for this field. */ tmp = gfc_conv_initializer (s->sym->value, &s->sym->ts, TREE_TYPE (s->field), s->sym->attr.dimension, s->sym->attr.pointer || s->sym->attr.allocatable, false); CONSTRUCTOR_APPEND_ELT (v, s->field, tmp); } } gcc_assert (!VEC_empty (constructor_elt, v)); ctor = build_constructor (union_type, v); TREE_CONSTANT (ctor) = 1; TREE_STATIC (ctor) = 1; DECL_INITIAL (decl) = ctor;#ifdef ENABLE_CHECKING { tree field, value; unsigned HOST_WIDE_INT idx; FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (ctor), idx, field, value) gcc_assert (TREE_CODE (field) == FIELD_DECL); }#endif } /* Build component reference for each variable. */ for (s = head; s; s = next_s) { tree var_decl; var_decl = build_decl (s->sym->declared_at.lb->location, VAR_DECL, DECL_NAME (s->field), TREE_TYPE (s->field)); TREE_STATIC (var_decl) = TREE_STATIC (decl); /* Mark the variable as used in order to avoid warnings about unused variables. */ TREE_USED (var_decl) = 1; if (s->sym->attr.use_assoc) DECL_IGNORED_P (var_decl) = 1; if (s->sym->attr.target) TREE_ADDRESSABLE (var_decl) = 1; /* Fake variables are not visible from other translation units. */ TREE_PUBLIC (var_decl) = 0; /* To preserve identifier names in COMMON, chain to procedure scope unless at top level in a module definition. */ if (com && s->sym->ns->proc_name && s->sym->ns->proc_name->attr.flavor == FL_MODULE) var_decl = pushdecl_top_level (var_decl); else gfc_add_decl_to_function (var_decl); SET_DECL_VALUE_EXPR (var_decl, fold_build3_loc (input_location, COMPONENT_REF, TREE_TYPE (s->field), decl, s->field, NULL_TREE)); DECL_HAS_VALUE_EXPR_P (var_decl) = 1; GFC_DECL_COMMON_OR_EQUIV (var_decl) = 1; if (s->sym->attr.assign) { gfc_allocate_lang_decl (var_decl); GFC_DECL_ASSIGN (var_decl) = 1; GFC_DECL_STRING_LEN (var_decl) = GFC_DECL_STRING_LEN (s->field); GFC_DECL_ASSIGN_ADDR (var_decl) = GFC_DECL_ASSIGN_ADDR (s->field); } s->sym->backend_decl = var_decl; next_s = s->next; free (s); }}
开发者ID:BoxianLai,项目名称:moxiedev,代码行数:101,
示例21: use_thunkvoiduse_thunk (tree thunk_fndecl, bool emit_p){ tree a, t, function, alias; tree virtual_offset; HOST_WIDE_INT fixed_offset, virtual_value; bool this_adjusting = DECL_THIS_THUNK_P (thunk_fndecl); /* We should have called finish_thunk to give it a name. */ gcc_assert (DECL_NAME (thunk_fndecl)); /* We should never be using an alias, always refer to the aliased thunk. */ gcc_assert (!THUNK_ALIAS (thunk_fndecl)); if (TREE_ASM_WRITTEN (thunk_fndecl)) return; function = THUNK_TARGET (thunk_fndecl); if (DECL_RESULT (thunk_fndecl)) /* We already turned this thunk into an ordinary function. There's no need to process this thunk again. */ return; if (DECL_THUNK_P (function)) /* The target is itself a thunk, process it now. */ use_thunk (function, emit_p); /* Thunks are always addressable; they only appear in vtables. */ TREE_ADDRESSABLE (thunk_fndecl) = 1; /* Figure out what function is being thunked to. It's referenced in this translation unit. */ TREE_ADDRESSABLE (function) = 1; mark_used (function); if (!emit_p) return; if (0 && TARGET_USE_LOCAL_THUNK_ALIAS_P (function)) alias = make_alias_for_thunk (function); else alias = function; fixed_offset = THUNK_FIXED_OFFSET (thunk_fndecl); virtual_offset = THUNK_VIRTUAL_OFFSET (thunk_fndecl); if (virtual_offset) { if (!this_adjusting) virtual_offset = BINFO_VPTR_FIELD (virtual_offset); virtual_value = tree_low_cst (virtual_offset, /*pos=*/0); gcc_assert (virtual_value); } else virtual_value = 0; /* And, if we need to emit the thunk, it's used. */ mark_used (thunk_fndecl); /* This thunk is actually defined. */ DECL_EXTERNAL (thunk_fndecl) = 0; /* The linkage of the function may have changed. FIXME in linkage rewrite. */ TREE_PUBLIC (thunk_fndecl) = TREE_PUBLIC (function); DECL_VISIBILITY (thunk_fndecl) = DECL_VISIBILITY (function); DECL_VISIBILITY_SPECIFIED (thunk_fndecl) = DECL_VISIBILITY_SPECIFIED (function); if (DECL_ONE_ONLY (function) || DECL_WEAK (function)) make_decl_one_only (thunk_fndecl, cxx_comdat_group (thunk_fndecl)); if (flag_syntax_only) { TREE_ASM_WRITTEN (thunk_fndecl) = 1; return; } push_to_top_level (); if (TARGET_USE_LOCAL_THUNK_ALIAS_P (function) && targetm.have_named_sections) { resolve_unique_section (function, 0, flag_function_sections); if (DECL_SECTION_NAME (function) != NULL && DECL_ONE_ONLY (function)) { resolve_unique_section (thunk_fndecl, 0, flag_function_sections); /* Output the thunk into the same section as function. */ DECL_SECTION_NAME (thunk_fndecl) = DECL_SECTION_NAME (function); } } /* Set up cloned argument trees for the thunk. */ t = NULL_TREE; for (a = DECL_ARGUMENTS (function); a; a = TREE_CHAIN (a)) { tree x = copy_node (a); TREE_CHAIN (x) = t; DECL_CONTEXT (x) = thunk_fndecl; SET_DECL_RTL (x, NULL_RTX); DECL_HAS_VALUE_EXPR_P (x) = 0;//.........这里部分代码省略.........
开发者ID:fabio-d,项目名称:xc16plusplus-source,代码行数:101,
注:本文中的DECL_HAS_VALUE_EXPR_P函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ DECL_IGNORED_P函数代码示例 C++ DECL_G函数代码示例 |