这篇教程C++ DECL_BUILT_IN_CLASS函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中DECL_BUILT_IN_CLASS函数的典型用法代码示例。如果您正苦于以下问题:C++ DECL_BUILT_IN_CLASS函数的具体用法?C++ DECL_BUILT_IN_CLASS怎么用?C++ DECL_BUILT_IN_CLASS使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了DECL_BUILT_IN_CLASS函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: streamer_write_builtinvoidstreamer_write_builtin (struct output_block *ob, tree expr){ gcc_assert (streamer_handle_as_builtin_p (expr)); if (DECL_BUILT_IN_CLASS (expr) == BUILT_IN_MD && !targetm.builtin_decl) sorry ("tree bytecode streams do not support machine specific builtin " "functions on this target"); streamer_write_record_start (ob, LTO_builtin_decl); streamer_write_enum (ob->main_stream, built_in_class, BUILT_IN_LAST, DECL_BUILT_IN_CLASS (expr)); streamer_write_uhwi (ob, DECL_FUNCTION_CODE (expr)); if (DECL_ASSEMBLER_NAME_SET_P (expr)) { /* When the assembler name of a builtin gets a user name, the new name is always prefixed with '*' by set_builtin_user_assembler_name. So, to prevent the reader side from adding a second '*', we omit it here. */ const char *str = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (expr)); if (strlen (str) > 1 && str[0] == '*') streamer_write_string (ob, ob->main_stream, &str[1], true); else streamer_write_string (ob, ob->main_stream, NULL, true); } else streamer_write_string (ob, ob->main_stream, NULL, true);}
开发者ID:Samsara00,项目名称:DragonFlyBSD,代码行数:30,
示例2: pack_ts_function_decl_value_fieldsstatic voidpack_ts_function_decl_value_fields (struct bitpack_d *bp, tree expr){ /* For normal/md builtins we only write the class and code, so they should never be handled here. */ gcc_assert (!streamer_handle_as_builtin_p (expr)); bp_pack_enum (bp, built_in_class, BUILT_IN_LAST, DECL_BUILT_IN_CLASS (expr)); bp_pack_value (bp, DECL_STATIC_CONSTRUCTOR (expr), 1); bp_pack_value (bp, DECL_STATIC_DESTRUCTOR (expr), 1); bp_pack_value (bp, DECL_UNINLINABLE (expr), 1); bp_pack_value (bp, DECL_POSSIBLY_INLINED (expr), 1); bp_pack_value (bp, DECL_IS_NOVOPS (expr), 1); bp_pack_value (bp, DECL_IS_RETURNS_TWICE (expr), 1); bp_pack_value (bp, DECL_IS_MALLOC (expr), 1); bp_pack_value (bp, DECL_IS_OPERATOR_NEW (expr), 1); bp_pack_value (bp, DECL_DECLARED_INLINE_P (expr), 1); bp_pack_value (bp, DECL_STATIC_CHAIN (expr), 1); bp_pack_value (bp, DECL_NO_INLINE_WARNING_P (expr), 1); bp_pack_value (bp, DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (expr), 1); bp_pack_value (bp, DECL_NO_LIMIT_STACK (expr), 1); bp_pack_value (bp, DECL_DISREGARD_INLINE_LIMITS (expr), 1); bp_pack_value (bp, DECL_PURE_P (expr), 1); bp_pack_value (bp, DECL_LOOPING_CONST_OR_PURE_P (expr), 1); if (DECL_BUILT_IN_CLASS (expr) != NOT_BUILT_IN) bp_pack_value (bp, DECL_FUNCTION_CODE (expr), 11); if (DECL_STATIC_DESTRUCTOR (expr)) bp_pack_var_len_unsigned (bp, DECL_FINI_PRIORITY (expr));}
开发者ID:Samsara00,项目名称:DragonFlyBSD,代码行数:30,
示例3: pass_through_callstatic treepass_through_call (tree call){ tree callee = get_callee_fndecl (call); tree arglist = TREE_OPERAND (call, 1); if (callee && DECL_BUILT_IN_CLASS (callee) == BUILT_IN_NORMAL) switch (DECL_FUNCTION_CODE (callee)) { case BUILT_IN_MEMCPY: case BUILT_IN_MEMMOVE: case BUILT_IN_MEMSET: case BUILT_IN_STRCPY: case BUILT_IN_STRNCPY: case BUILT_IN_STRCAT: case BUILT_IN_STRNCAT: case BUILT_IN_MEMCPY_CHK: case BUILT_IN_MEMMOVE_CHK: case BUILT_IN_MEMSET_CHK: case BUILT_IN_STRCPY_CHK: case BUILT_IN_STRNCPY_CHK: case BUILT_IN_STRCAT_CHK: case BUILT_IN_STRNCAT_CHK: if (arglist) return TREE_VALUE (arglist); break; default: break; } return NULL_TREE;}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:33,
示例4: is_cilkplus_reduce_builtinenum built_in_functionis_cilkplus_reduce_builtin (tree fndecl){ if (!fndecl) return BUILT_IN_NONE; if (TREE_CODE (fndecl) == ADDR_EXPR) fndecl = TREE_OPERAND (fndecl, 0); if (TREE_CODE (fndecl) == FUNCTION_DECL && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL) switch (DECL_FUNCTION_CODE (fndecl)) { case BUILT_IN_CILKPLUS_SEC_REDUCE_ADD: case BUILT_IN_CILKPLUS_SEC_REDUCE_MUL: case BUILT_IN_CILKPLUS_SEC_REDUCE_ALL_ZERO: case BUILT_IN_CILKPLUS_SEC_REDUCE_ANY_ZERO: case BUILT_IN_CILKPLUS_SEC_REDUCE_MAX: case BUILT_IN_CILKPLUS_SEC_REDUCE_MIN: case BUILT_IN_CILKPLUS_SEC_REDUCE_MIN_IND: case BUILT_IN_CILKPLUS_SEC_REDUCE_MAX_IND: case BUILT_IN_CILKPLUS_SEC_REDUCE_ANY_NONZERO: case BUILT_IN_CILKPLUS_SEC_REDUCE_ALL_NONZERO: case BUILT_IN_CILKPLUS_SEC_REDUCE: case BUILT_IN_CILKPLUS_SEC_REDUCE_MUTATING: return DECL_FUNCTION_CODE (fndecl); default: break; } return BUILT_IN_NONE;}
开发者ID:chainalgit,项目名称:gcc,代码行数:31,
示例5: pass_through_callstatic treepass_through_call (const_gimple call){ tree callee = gimple_call_fndecl (call); if (callee && DECL_BUILT_IN_CLASS (callee) == BUILT_IN_NORMAL) switch (DECL_FUNCTION_CODE (callee)) { case BUILT_IN_MEMCPY: case BUILT_IN_MEMMOVE: case BUILT_IN_MEMSET: case BUILT_IN_STRCPY: case BUILT_IN_STRNCPY: case BUILT_IN_STRCAT: case BUILT_IN_STRNCAT: case BUILT_IN_MEMCPY_CHK: case BUILT_IN_MEMMOVE_CHK: case BUILT_IN_MEMSET_CHK: case BUILT_IN_STRCPY_CHK: case BUILT_IN_STRNCPY_CHK: case BUILT_IN_STPNCPY_CHK: case BUILT_IN_STRCAT_CHK: case BUILT_IN_STRNCAT_CHK: case BUILT_IN_ASSUME_ALIGNED: if (gimple_call_num_args (call) >= 1) return gimple_call_arg (call, 0); break; default: break; } return NULL_TREE;}
开发者ID:ChaosJohn,项目名称:gcc,代码行数:34,
示例6: alloc_object_sizestatic unsigned HOST_WIDE_INTalloc_object_size (const_gimple call, int object_size_type){ tree callee, bytes = NULL_TREE; tree alloc_size; int arg1 = -1, arg2 = -1; gcc_assert (is_gimple_call (call)); callee = gimple_call_fndecl (call); if (!callee) return unknown[object_size_type]; alloc_size = lookup_attribute ("alloc_size", TYPE_ATTRIBUTES (TREE_TYPE (callee))); if (alloc_size && TREE_VALUE (alloc_size)) { tree p = TREE_VALUE (alloc_size); arg1 = TREE_INT_CST_LOW (TREE_VALUE (p))-1; if (TREE_CHAIN (p)) arg2 = TREE_INT_CST_LOW (TREE_VALUE (TREE_CHAIN (p)))-1; } if (DECL_BUILT_IN_CLASS (callee) == BUILT_IN_NORMAL) switch (DECL_FUNCTION_CODE (callee)) { case BUILT_IN_CALLOC: arg2 = 1; /* fall through */ case BUILT_IN_MALLOC: case BUILT_IN_ALLOCA: case BUILT_IN_ALLOCA_WITH_ALIGN: arg1 = 0; default: break; } if (arg1 < 0 || arg1 >= (int)gimple_call_num_args (call) || TREE_CODE (gimple_call_arg (call, arg1)) != INTEGER_CST || (arg2 >= 0 && (arg2 >= (int)gimple_call_num_args (call) || TREE_CODE (gimple_call_arg (call, arg2)) != INTEGER_CST))) return unknown[object_size_type]; if (arg2 >= 0) bytes = size_binop (MULT_EXPR, fold_convert (sizetype, gimple_call_arg (call, arg1)), fold_convert (sizetype, gimple_call_arg (call, arg2))); else if (arg1 >= 0) bytes = fold_convert (sizetype, gimple_call_arg (call, arg1)); if (bytes && host_integerp (bytes, 1)) return tree_low_cst (bytes, 1); return unknown[object_size_type];}
开发者ID:ChaosJohn,项目名称:gcc,代码行数:57,
示例7: stmt_coststatic unsignedstmt_cost (tree stmt){ tree rhs; unsigned cost = 1; /* Always try to create possibilities for unswitching. */ if (TREE_CODE (stmt) == COND_EXPR) return LIM_EXPENSIVE; rhs = GENERIC_TREE_OPERAND (stmt, 1); /* Hoisting memory references out should almost surely be a win. */ if (stmt_references_memory_p (stmt)) cost += 20; switch (TREE_CODE (rhs)) { case CALL_EXPR: /* We should be hoisting calls if possible. */ /* Unless the call is a builtin_constant_p; this always folds to a constant, so moving it is useless. */ rhs = get_callee_fndecl (rhs); if (DECL_BUILT_IN_CLASS (rhs) == BUILT_IN_NORMAL && DECL_FUNCTION_CODE (rhs) == BUILT_IN_CONSTANT_P) return 0; cost += 20; break; case MULT_EXPR: case TRUNC_DIV_EXPR: case CEIL_DIV_EXPR: case FLOOR_DIV_EXPR: case ROUND_DIV_EXPR: case EXACT_DIV_EXPR: case CEIL_MOD_EXPR: case FLOOR_MOD_EXPR: case ROUND_MOD_EXPR: case TRUNC_MOD_EXPR: case RDIV_EXPR: /* Division and multiplication are usually expensive. */ cost += 20; break; case LSHIFT_EXPR: case RSHIFT_EXPR: cost += 20; break; default: break; } return cost;}
开发者ID:mdezeeuw,项目名称:mb-rvex,代码行数:57,
示例8: unpack_ts_function_decl_value_fieldsstatic voidunpack_ts_function_decl_value_fields (struct bitpack_d *bp, tree expr){ DECL_BUILT_IN_CLASS (expr) = bp_unpack_enum (bp, built_in_class, BUILT_IN_LAST); DECL_STATIC_CONSTRUCTOR (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_STATIC_DESTRUCTOR (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_UNINLINABLE (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_POSSIBLY_INLINED (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_IS_NOVOPS (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_IS_RETURNS_TWICE (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_IS_MALLOC (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_IS_OPERATOR_NEW (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_DECLARED_INLINE_P (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_STATIC_CHAIN (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_NO_INLINE_WARNING_P (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_NO_LIMIT_STACK (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_DISREGARD_INLINE_LIMITS (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_PURE_P (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_LOOPING_CONST_OR_PURE_P (expr) = (unsigned) bp_unpack_value (bp, 1); if (DECL_BUILT_IN_CLASS (expr) != NOT_BUILT_IN) { DECL_FUNCTION_CODE (expr) = (enum built_in_function) bp_unpack_value (bp, 11); if (DECL_BUILT_IN_CLASS (expr) == BUILT_IN_NORMAL && DECL_FUNCTION_CODE (expr) >= END_BUILTINS) fatal_error ("machine independent builtin code out of range"); else if (DECL_BUILT_IN_CLASS (expr) == BUILT_IN_MD) { tree result = targetm.builtin_decl (DECL_FUNCTION_CODE (expr), true); if (!result || result == error_mark_node) fatal_error ("target specific builtin not available"); } } if (DECL_STATIC_DESTRUCTOR (expr)) { priority_type p; p = (priority_type) bp_unpack_var_len_unsigned (bp); SET_DECL_FINI_PRIORITY (expr, p); }}
开发者ID:JuanMiguelBG,项目名称:gcc-4.7.0-PS3,代码行数:43,
示例9: is_sec_implicit_index_fnboolis_sec_implicit_index_fn (tree fndecl){ if (TREE_CODE (fndecl) == ADDR_EXPR) fndecl = TREE_OPERAND (fndecl, 0); return (TREE_CODE (fndecl) == FUNCTION_DECL && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL && DECL_FUNCTION_CODE (fndecl) == BUILT_IN_CILKPLUS_SEC_IMPLICIT_INDEX);}
开发者ID:AlissonLinhares,项目名称:NativeKit,代码行数:11,
示例10: alloc_object_sizestatic unsigned HOST_WIDE_INTalloc_object_size (tree call, int object_size_type){ tree callee, arglist, a, bytes = NULL_TREE; unsigned int arg_mask = 0; gcc_assert (TREE_CODE (call) == CALL_EXPR); callee = get_callee_fndecl (call); arglist = TREE_OPERAND (call, 1); if (callee && DECL_BUILT_IN_CLASS (callee) == BUILT_IN_NORMAL) switch (DECL_FUNCTION_CODE (callee)) { case BUILT_IN_MALLOC: case BUILT_IN_ALLOCA: arg_mask = 1; break; /* case BUILT_IN_REALLOC: arg_mask = 2; break; */ case BUILT_IN_CALLOC: arg_mask = 3; break; default: break; } for (a = arglist; arg_mask && a; arg_mask >>= 1, a = TREE_CHAIN (a)) if (arg_mask & 1) { tree arg = TREE_VALUE (a); if (TREE_CODE (arg) != INTEGER_CST) break; if (! bytes) bytes = fold_convert (sizetype, arg); else bytes = size_binop (MULT_EXPR, bytes, fold_convert (sizetype, arg)); } if (! arg_mask && bytes && host_integerp (bytes, 1)) return tree_low_cst (bytes, 1); return unknown[object_size_type];}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:50,
示例11: pack_ts_function_decl_value_fieldsstatic voidpack_ts_function_decl_value_fields (struct bitpack_d *bp, tree expr){ bp_pack_enum (bp, built_in_class, BUILT_IN_LAST, DECL_BUILT_IN_CLASS (expr)); bp_pack_value (bp, DECL_STATIC_CONSTRUCTOR (expr), 1); bp_pack_value (bp, DECL_STATIC_DESTRUCTOR (expr), 1); bp_pack_value (bp, DECL_UNINLINABLE (expr), 1); bp_pack_value (bp, DECL_POSSIBLY_INLINED (expr), 1); bp_pack_value (bp, DECL_IS_NOVOPS (expr), 1); bp_pack_value (bp, DECL_IS_RETURNS_TWICE (expr), 1); bp_pack_value (bp, DECL_IS_MALLOC (expr), 1); bp_pack_value (bp, DECL_IS_OPERATOR_NEW (expr), 1); bp_pack_value (bp, DECL_DECLARED_INLINE_P (expr), 1); bp_pack_value (bp, DECL_STATIC_CHAIN (expr), 1); bp_pack_value (bp, DECL_NO_INLINE_WARNING_P (expr), 1); bp_pack_value (bp, DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (expr), 1); bp_pack_value (bp, DECL_NO_LIMIT_STACK (expr), 1); bp_pack_value (bp, DECL_DISREGARD_INLINE_LIMITS (expr), 1); bp_pack_value (bp, DECL_PURE_P (expr), 1); bp_pack_value (bp, DECL_LOOPING_CONST_OR_PURE_P (expr), 1); if (DECL_BUILT_IN_CLASS (expr) != NOT_BUILT_IN) bp_pack_value (bp, DECL_FUNCTION_CODE (expr), 12);}
开发者ID:Droufte,项目名称:gcc,代码行数:24,
示例12: install_builtinstatic treeinstall_builtin (const char *name, tree fntype, enum built_in_function code, bool publish){ tree fndecl = build_fn_decl (name, fntype); DECL_BUILT_IN_CLASS (fndecl) = BUILT_IN_NORMAL; DECL_FUNCTION_CODE (fndecl) = code; if (publish) { tree t = lang_hooks.decls.pushdecl (fndecl); if (t) fndecl = t; } set_builtin_decl (code, fndecl, true); return fndecl;}
开发者ID:krichter722,项目名称:gcc,代码行数:16,
示例13: define_builtin/* Define a single builtin. */static voiddefine_builtin (enum built_in_function val, const char *name, tree type, const char *libname, int flags){ tree decl; decl = build_decl (BUILTINS_LOCATION, FUNCTION_DECL, get_identifier (name), type); DECL_EXTERNAL (decl) = 1; TREE_PUBLIC (decl) = 1; SET_DECL_ASSEMBLER_NAME (decl, get_identifier (libname)); pushdecl (decl); DECL_BUILT_IN_CLASS (decl) = BUILT_IN_NORMAL; DECL_FUNCTION_CODE (decl) = val; set_call_expr_flags (decl, flags); set_builtin_decl (val, decl, true);}
开发者ID:Nodplus,项目名称:gcc,代码行数:22,
示例14: get_decl_hashunsigned int get_decl_hash(const_tree decl, const char *decl_name){ struct decl_hash decl_hash_data; enum tree_code code = TREE_CODE(decl); gcc_assert(code == FIELD_DECL || code == FUNCTION_DECL || code == VAR_DECL); // skip builtins __builtin_constant_p if (code == FUNCTION_DECL && (DECL_BUILT_IN(decl) || DECL_BUILT_IN_CLASS(decl) == BUILT_IN_NORMAL)) return NO_HASH; decl_hash_data.fn_name = decl_name; decl_hash_data.decl = decl; decl_hash_data.context = get_decl_context(decl); if (!decl_hash_data.context) return NO_HASH; decl_hash_data.tree_codes_len = 0; set_decl_codes(&decl_hash_data); gcc_assert(decl_hash_data.tree_codes_len != 0); set_hash(&decl_hash_data); return decl_hash_data.hash;}
开发者ID:ephox-gcc-plugins,项目名称:size_overflow,代码行数:23,
示例15: print_node//.........这里部分代码省略......... fprintf (file, " %s", GET_MODE_NAME (mode)); } if ((code == VAR_DECL || code == PARM_DECL || code == RESULT_DECL) && DECL_BY_REFERENCE (node)) fputs (" passed-by-reference", file); if (CODE_CONTAINS_STRUCT (code, TS_DECL_WITH_VIS) && DECL_DEFER_OUTPUT (node)) fputs (" defer-output", file); xloc = expand_location (DECL_SOURCE_LOCATION (node)); fprintf (file, " file %s line %d col %d", xloc.file, xloc.line, xloc.column); if (CODE_CONTAINS_STRUCT (code, TS_DECL_COMMON)) { print_node (file, "size", DECL_SIZE (node), indent + 4); print_node (file, "unit size", DECL_SIZE_UNIT (node), indent + 4); if (code != FUNCTION_DECL || DECL_BUILT_IN (node)) indent_to (file, indent + 3); if (DECL_USER_ALIGN (node)) fprintf (file, " user"); fprintf (file, " align %d", DECL_ALIGN (node)); if (code == FIELD_DECL) fprintf (file, " offset_align " HOST_WIDE_INT_PRINT_UNSIGNED, DECL_OFFSET_ALIGN (node)); if (code == FUNCTION_DECL && DECL_BUILT_IN (node)) { if (DECL_BUILT_IN_CLASS (node) == BUILT_IN_MD) fprintf (file, " built-in BUILT_IN_MD %d", DECL_FUNCTION_CODE (node)); else fprintf (file, " built-in %s:%s", built_in_class_names[(int) DECL_BUILT_IN_CLASS (node)], built_in_names[(int) DECL_FUNCTION_CODE (node)]); } } if (code == FIELD_DECL) { print_node (file, "offset", DECL_FIELD_OFFSET (node), indent + 4); print_node (file, "bit offset", DECL_FIELD_BIT_OFFSET (node), indent + 4); if (DECL_BIT_FIELD_TYPE (node)) print_node (file, "bit_field_type", DECL_BIT_FIELD_TYPE (node), indent + 4); } print_node_brief (file, "context", DECL_CONTEXT (node), indent + 4); if (CODE_CONTAINS_STRUCT (code, TS_DECL_COMMON)) { print_node_brief (file, "attributes", DECL_ATTRIBUTES (node), indent + 4); if (code != PARM_DECL) print_node_brief (file, "initial", DECL_INITIAL (node), indent + 4); } if (CODE_CONTAINS_STRUCT (code, TS_DECL_WRTL)) { print_node_brief (file, "abstract_origin", DECL_ABSTRACT_ORIGIN (node), indent + 4); }
开发者ID:RajibTheKing,项目名称:gcc,代码行数:67,
示例16: lto_symtab_merge_pstatic boollto_symtab_merge_p (tree prevailing, tree decl){ if (TREE_CODE (prevailing) != TREE_CODE (decl)) { if (symtab->dump_file) fprintf (symtab->dump_file, "Not merging decls; " "TREE_CODE mismatch/n"); return false; } gcc_checking_assert (TREE_CHAIN (prevailing) == TREE_CHAIN (decl)); if (TREE_CODE (prevailing) == FUNCTION_DECL) { if (DECL_BUILT_IN (prevailing) != DECL_BUILT_IN (decl)) { if (symtab->dump_file) fprintf (symtab->dump_file, "Not merging decls; " "DECL_BUILT_IN mismatch/n"); return false; } if (DECL_BUILT_IN (prevailing) && (DECL_BUILT_IN_CLASS (prevailing) != DECL_BUILT_IN_CLASS (decl) || DECL_FUNCTION_CODE (prevailing) != DECL_FUNCTION_CODE (decl))) { if (symtab->dump_file) fprintf (symtab->dump_file, "Not merging decls; " "DECL_BUILT_IN_CLASS or CODE mismatch/n"); return false; } } /* FIXME: after MPX is removed, use flags_from_decl_or_type function instead. PR lto/85248. */ if (DECL_ATTRIBUTES (prevailing) != DECL_ATTRIBUTES (decl)) { tree prev_attr = lookup_attribute ("error", DECL_ATTRIBUTES (prevailing)); tree attr = lookup_attribute ("error", DECL_ATTRIBUTES (decl)); if ((prev_attr == NULL) != (attr == NULL) || (prev_attr && !attribute_value_equal (prev_attr, attr))) { if (symtab->dump_file) fprintf (symtab->dump_file, "Not merging decls; " "error attribute mismatch/n"); return false; } prev_attr = lookup_attribute ("warning", DECL_ATTRIBUTES (prevailing)); attr = lookup_attribute ("warning", DECL_ATTRIBUTES (decl)); if ((prev_attr == NULL) != (attr == NULL) || (prev_attr && !attribute_value_equal (prev_attr, attr))) { if (symtab->dump_file) fprintf (symtab->dump_file, "Not merging decls; " "warning attribute mismatch/n"); return false; } prev_attr = lookup_attribute ("noreturn", DECL_ATTRIBUTES (prevailing)); attr = lookup_attribute ("noreturn", DECL_ATTRIBUTES (decl)); if ((prev_attr == NULL) != (attr == NULL)) { if (symtab->dump_file) fprintf (symtab->dump_file, "Not merging decls; " "noreturn attribute mismatch/n"); return false; } } return true;}
开发者ID:KangDroid,项目名称:gcc,代码行数:70,
示例17: lto_symtab_merge_pstatic boollto_symtab_merge_p (tree prevailing, tree decl){ if (TREE_CODE (prevailing) != TREE_CODE (decl)) { if (symtab->dump_file) fprintf (symtab->dump_file, "Not merging decls; " "TREE_CODE mismatch/n"); return false; } gcc_checking_assert (TREE_CHAIN (prevailing) == TREE_CHAIN (decl)); if (TREE_CODE (prevailing) == FUNCTION_DECL) { if (DECL_BUILT_IN (prevailing) != DECL_BUILT_IN (decl)) { if (symtab->dump_file) fprintf (symtab->dump_file, "Not merging decls; " "DECL_BUILT_IN mismatch/n"); return false; } if (DECL_BUILT_IN (prevailing) && (DECL_BUILT_IN_CLASS (prevailing) != DECL_BUILT_IN_CLASS (decl) || DECL_FUNCTION_CODE (prevailing) != DECL_FUNCTION_CODE (decl))) { if (symtab->dump_file) fprintf (symtab->dump_file, "Not merging decls; " "DECL_BUILT_IN_CLASS or CODE mismatch/n"); return false; } } if (DECL_ATTRIBUTES (prevailing) != DECL_ATTRIBUTES (decl)) { tree prev_attr = lookup_attribute ("error", DECL_ATTRIBUTES (prevailing)); tree attr = lookup_attribute ("error", DECL_ATTRIBUTES (decl)); if ((prev_attr == NULL) != (attr == NULL) || (prev_attr && TREE_VALUE (TREE_VALUE (prev_attr)) != TREE_VALUE (TREE_VALUE (attr)))) { if (symtab->dump_file) fprintf (symtab->dump_file, "Not merging decls; " "error attribute mismatch/n"); return false; } prev_attr = lookup_attribute ("warning", DECL_ATTRIBUTES (prevailing)); attr = lookup_attribute ("warning", DECL_ATTRIBUTES (decl)); if ((prev_attr == NULL) != (attr == NULL) || (prev_attr && TREE_VALUE (TREE_VALUE (prev_attr)) != TREE_VALUE (TREE_VALUE (attr)))) { if (symtab->dump_file) fprintf (symtab->dump_file, "Not merging decls; " "warning attribute mismatch/n"); return false; } } return true;}
开发者ID:chinabin,项目名称:gcc-tiny,代码行数:61,
示例18: chkp_optimize_string_function_calls/* Find memcpy, mempcpy, memmove and memset calls, perform checks before call and then call no_chk version of functions. We do it on O2 to enable inlining of these functions during expand. Also try to find memcpy, mempcpy, memmove and memset calls which are known to not write pointers to memory and use faster function versions for them. */static voidchkp_optimize_string_function_calls (void){ basic_block bb; if (dump_file && (dump_flags & TDF_DETAILS)) fprintf (dump_file, "Searching for replaceable string function calls.../n"); FOR_EACH_BB_FN (bb, cfun) { gimple_stmt_iterator i; for (i = gsi_start_bb (bb); !gsi_end_p (i); gsi_next (&i)) { gimple *stmt = gsi_stmt (i); tree fndecl; if (gimple_code (stmt) != GIMPLE_CALL || !gimple_call_with_bounds_p (stmt)) continue; fndecl = gimple_call_fndecl (stmt); if (!fndecl || DECL_BUILT_IN_CLASS (fndecl) != BUILT_IN_NORMAL) continue; if (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_MEMCPY_CHKP || DECL_FUNCTION_CODE (fndecl) == BUILT_IN_MEMPCPY_CHKP || DECL_FUNCTION_CODE (fndecl) == BUILT_IN_MEMMOVE_CHKP || DECL_FUNCTION_CODE (fndecl) == BUILT_IN_MEMSET_CHKP) { tree dst = gimple_call_arg (stmt, 0); tree dst_bnd = gimple_call_arg (stmt, 1); bool is_memset = DECL_FUNCTION_CODE (fndecl) == BUILT_IN_MEMSET_CHKP; tree size = gimple_call_arg (stmt, is_memset ? 3 : 4); tree fndecl_nochk; gimple_stmt_iterator j; basic_block check_bb; address_t size_val; int sign; bool known; /* We may replace call with corresponding __chkp_*_nobnd call in case destination pointer base type is not void or pointer. */ if (POINTER_TYPE_P (TREE_TYPE (dst)) && !VOID_TYPE_P (TREE_TYPE (TREE_TYPE (dst))) && !chkp_type_has_pointer (TREE_TYPE (TREE_TYPE (dst)))) { tree fndecl_nobnd = chkp_get_nobnd_fndecl (DECL_FUNCTION_CODE (fndecl)); if (fndecl_nobnd) fndecl = fndecl_nobnd; } fndecl_nochk = chkp_get_nochk_fndecl (DECL_FUNCTION_CODE (fndecl)); if (fndecl_nochk) fndecl = fndecl_nochk; if (fndecl != gimple_call_fndecl (stmt)) { if (dump_file && (dump_flags & TDF_DETAILS)) { fprintf (dump_file, "Replacing call: "); print_gimple_stmt (dump_file, stmt, 0, TDF_VOPS|TDF_MEMSYMS); } gimple_call_set_fndecl (stmt, fndecl); if (dump_file && (dump_flags & TDF_DETAILS)) { fprintf (dump_file, "With a new call: "); print_gimple_stmt (dump_file, stmt, 0, TDF_VOPS|TDF_MEMSYMS); } } /* If there is no nochk version of function then do nothing. Otherwise insert checks before the call. */ if (!fndecl_nochk) continue; /* If size passed to call is known and > 0 then we may insert checks unconditionally. */ size_val.pol.create (0); chkp_collect_value (size, size_val); known = chkp_is_constant_addr (size_val, &sign); size_val.pol.release ();//.........这里部分代码省略.........
开发者ID:paranoiacblack,项目名称:gcc,代码行数:101,
示例19: vect_recog_pow_patternstatic gimplevect_recog_pow_pattern (gimple last_stmt, tree *type_in, tree *type_out){ tree fn, base, exp = NULL; gimple stmt; tree var; if (!is_gimple_call (last_stmt) || gimple_call_lhs (last_stmt) == NULL) return NULL; fn = gimple_call_fndecl (last_stmt); if (fn == NULL_TREE || DECL_BUILT_IN_CLASS (fn) != BUILT_IN_NORMAL) return NULL; switch (DECL_FUNCTION_CODE (fn)) { case BUILT_IN_POWIF: case BUILT_IN_POWI: case BUILT_IN_POWF: case BUILT_IN_POW: base = gimple_call_arg (last_stmt, 0); exp = gimple_call_arg (last_stmt, 1); if (TREE_CODE (exp) != REAL_CST && TREE_CODE (exp) != INTEGER_CST) return NULL; break; default: return NULL; } /* We now have a pow or powi builtin function call with a constant exponent. */ *type_out = NULL_TREE; /* Catch squaring. */ if ((host_integerp (exp, 0) && tree_low_cst (exp, 0) == 2) || (TREE_CODE (exp) == REAL_CST && REAL_VALUES_EQUAL (TREE_REAL_CST (exp), dconst2))) { *type_in = TREE_TYPE (base); var = vect_recog_temp_ssa_var (TREE_TYPE (base), NULL); stmt = gimple_build_assign_with_ops (MULT_EXPR, var, base, base); SSA_NAME_DEF_STMT (var) = stmt; return stmt; } /* Catch square root. */ if (TREE_CODE (exp) == REAL_CST && REAL_VALUES_EQUAL (TREE_REAL_CST (exp), dconsthalf)) { tree newfn = mathfn_built_in (TREE_TYPE (base), BUILT_IN_SQRT); *type_in = get_vectype_for_scalar_type (TREE_TYPE (base)); if (*type_in) { gimple stmt = gimple_build_call (newfn, 1, base); if (vectorizable_function (stmt, *type_in, *type_in) != NULL_TREE) { var = vect_recog_temp_ssa_var (TREE_TYPE (base), stmt); gimple_call_set_lhs (stmt, var); return stmt; } } } return NULL;}
开发者ID:kallolpar,项目名称:gcc,代码行数:71,
示例20: aarch64_builtin_vectorized_functiontreeaarch64_builtin_vectorized_function (tree fndecl, tree type_out, tree type_in){ machine_mode in_mode, out_mode; int in_n, out_n; if (TREE_CODE (type_out) != VECTOR_TYPE || TREE_CODE (type_in) != VECTOR_TYPE) return NULL_TREE; out_mode = TYPE_MODE (TREE_TYPE (type_out)); out_n = TYPE_VECTOR_SUBPARTS (type_out); in_mode = TYPE_MODE (TREE_TYPE (type_in)); in_n = TYPE_VECTOR_SUBPARTS (type_in);#undef AARCH64_CHECK_BUILTIN_MODE#define AARCH64_CHECK_BUILTIN_MODE(C, N) 1#define AARCH64_FIND_FRINT_VARIANT(N) / (AARCH64_CHECK_BUILTIN_MODE (2, D) / ? aarch64_builtin_decls[AARCH64_SIMD_BUILTIN_UNOP_##N##v2df] / : (AARCH64_CHECK_BUILTIN_MODE (4, S) / ? aarch64_builtin_decls[AARCH64_SIMD_BUILTIN_UNOP_##N##v4sf] / : (AARCH64_CHECK_BUILTIN_MODE (2, S) / ? aarch64_builtin_decls[AARCH64_SIMD_BUILTIN_UNOP_##N##v2sf] / : NULL_TREE))) if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL) { enum built_in_function fn = DECL_FUNCTION_CODE (fndecl); switch (fn) {#undef AARCH64_CHECK_BUILTIN_MODE#define AARCH64_CHECK_BUILTIN_MODE(C, N) / (out_mode == N##Fmode && out_n == C / && in_mode == N##Fmode && in_n == C) case BUILT_IN_FLOOR: case BUILT_IN_FLOORF: return AARCH64_FIND_FRINT_VARIANT (floor); case BUILT_IN_CEIL: case BUILT_IN_CEILF: return AARCH64_FIND_FRINT_VARIANT (ceil); case BUILT_IN_TRUNC: case BUILT_IN_TRUNCF: return AARCH64_FIND_FRINT_VARIANT (btrunc); case BUILT_IN_ROUND: case BUILT_IN_ROUNDF: return AARCH64_FIND_FRINT_VARIANT (round); case BUILT_IN_NEARBYINT: case BUILT_IN_NEARBYINTF: return AARCH64_FIND_FRINT_VARIANT (nearbyint); case BUILT_IN_SQRT: case BUILT_IN_SQRTF: return AARCH64_FIND_FRINT_VARIANT (sqrt);#undef AARCH64_CHECK_BUILTIN_MODE#define AARCH64_CHECK_BUILTIN_MODE(C, N) / (out_mode == SImode && out_n == C / && in_mode == N##Imode && in_n == C) case BUILT_IN_CLZ: { if (AARCH64_CHECK_BUILTIN_MODE (4, S)) return aarch64_builtin_decls[AARCH64_SIMD_BUILTIN_UNOP_clzv4si]; return NULL_TREE; }#undef AARCH64_CHECK_BUILTIN_MODE#define AARCH64_CHECK_BUILTIN_MODE(C, N) / (out_mode == N##Imode && out_n == C / && in_mode == N##Fmode && in_n == C) case BUILT_IN_LFLOOR: case BUILT_IN_LFLOORF: case BUILT_IN_LLFLOOR: case BUILT_IN_IFLOORF: { enum aarch64_builtins builtin; if (AARCH64_CHECK_BUILTIN_MODE (2, D)) builtin = AARCH64_SIMD_BUILTIN_UNOP_lfloorv2dfv2di; else if (AARCH64_CHECK_BUILTIN_MODE (4, S)) builtin = AARCH64_SIMD_BUILTIN_UNOP_lfloorv4sfv4si; else if (AARCH64_CHECK_BUILTIN_MODE (2, S)) builtin = AARCH64_SIMD_BUILTIN_UNOP_lfloorv2sfv2si; else return NULL_TREE; return aarch64_builtin_decls[builtin]; } case BUILT_IN_LCEIL: case BUILT_IN_LCEILF: case BUILT_IN_LLCEIL: case BUILT_IN_ICEILF: { enum aarch64_builtins builtin; if (AARCH64_CHECK_BUILTIN_MODE (2, D)) builtin = AARCH64_SIMD_BUILTIN_UNOP_lceilv2dfv2di; else if (AARCH64_CHECK_BUILTIN_MODE (4, S)) builtin = AARCH64_SIMD_BUILTIN_UNOP_lceilv4sfv4si; else if (AARCH64_CHECK_BUILTIN_MODE (2, S)) builtin = AARCH64_SIMD_BUILTIN_UNOP_lceilv2sfv2si; else return NULL_TREE; return aarch64_builtin_decls[builtin]; }//.........这里部分代码省略.........
开发者ID:rockflying,项目名称:gcc,代码行数:101,
示例21: lower_stmtstatic voidlower_stmt (gimple_stmt_iterator *gsi, struct lower_data *data){ gimple stmt = gsi_stmt (*gsi); gimple_set_block (stmt, data->block); switch (gimple_code (stmt)) { case GIMPLE_BIND: lower_gimple_bind (gsi, data); /* Propagate fallthruness. */ return; case GIMPLE_COND: case GIMPLE_GOTO: case GIMPLE_SWITCH: data->cannot_fallthru = true; gsi_next (gsi); return; case GIMPLE_RETURN: if (data->cannot_fallthru) { gsi_remove (gsi, false); /* Propagate fallthruness. */ } else { lower_gimple_return (gsi, data); data->cannot_fallthru = true; } return; case GIMPLE_TRY: if (gimple_try_kind (stmt) == GIMPLE_TRY_CATCH) lower_try_catch (gsi, data); else { /* It must be a GIMPLE_TRY_FINALLY. */ bool cannot_fallthru; lower_sequence (gimple_try_eval_ptr (stmt), data); cannot_fallthru = data->cannot_fallthru; /* The finally clause is always executed after the try clause, so if it does not fall through, then the try-finally will not fall through. Otherwise, if the try clause does not fall through, then when the finally clause falls through it will resume execution wherever the try clause was going. So the whole try-finally will only fall through if both the try clause and the finally clause fall through. */ data->cannot_fallthru = false; lower_sequence (gimple_try_cleanup_ptr (stmt), data); data->cannot_fallthru |= cannot_fallthru; gsi_next (gsi); } return; case GIMPLE_EH_ELSE: lower_sequence (gimple_eh_else_n_body_ptr (stmt), data); lower_sequence (gimple_eh_else_e_body_ptr (stmt), data); break; case GIMPLE_NOP: case GIMPLE_ASM: case GIMPLE_ASSIGN: case GIMPLE_PREDICT: case GIMPLE_LABEL: case GIMPLE_EH_MUST_NOT_THROW: case GIMPLE_OMP_FOR: case GIMPLE_OMP_SECTIONS: case GIMPLE_OMP_SECTIONS_SWITCH: case GIMPLE_OMP_SECTION: case GIMPLE_OMP_SINGLE: case GIMPLE_OMP_MASTER: case GIMPLE_OMP_ORDERED: case GIMPLE_OMP_CRITICAL: case GIMPLE_OMP_RETURN: case GIMPLE_OMP_ATOMIC_LOAD: case GIMPLE_OMP_ATOMIC_STORE: case GIMPLE_OMP_CONTINUE: break; case GIMPLE_CALL: { tree decl = gimple_call_fndecl (stmt); unsigned i; for (i = 0; i < gimple_call_num_args (stmt); i++) { tree arg = gimple_call_arg (stmt, i); if (EXPR_P (arg)) TREE_SET_BLOCK (arg, data->block); } if (decl && DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL && DECL_FUNCTION_CODE (decl) == BUILT_IN_SETJMP) { lower_builtin_setjmp (gsi);//.........这里部分代码省略.........
开发者ID:hnaik,项目名称:gcc,代码行数:101,
示例22: gimple_simplify//.........这里部分代码省略......... && rcode2.is_tree_code ()) { valueized = true; if (TREE_CODE_CLASS ((enum tree_code)rcode2) == tcc_comparison) rhs1 = build2 (rcode2, TREE_TYPE (rhs1), ops2[0], ops2[1]); else if (rcode2 == SSA_NAME || rcode2 == INTEGER_CST) rhs1 = ops2[0]; else valueized = false; } } } tree rhs2 = gimple_assign_rhs2 (stmt); tree rhs3 = gimple_assign_rhs3 (stmt); rhs1 = do_valueize (rhs1, top_valueize, valueized); rhs2 = do_valueize (rhs2, top_valueize, valueized); rhs3 = do_valueize (rhs3, top_valueize, valueized); *rcode = code; ops[0] = rhs1; ops[1] = rhs2; ops[2] = rhs3; return (gimple_resimplify3 (seq, rcode, type, ops, valueize) || valueized); } default: gcc_unreachable (); } break; } case GIMPLE_CALL: /* ??? This way we can't simplify calls with side-effects. */ if (gimple_call_lhs (stmt) != NULL_TREE && gimple_call_num_args (stmt) >= 1 && gimple_call_num_args (stmt) <= 3) { tree fn = gimple_call_fn (stmt); /* ??? Internal function support missing. */ if (!fn) return false; bool valueized = false; fn = do_valueize (fn, top_valueize, valueized); if (TREE_CODE (fn) != ADDR_EXPR || TREE_CODE (TREE_OPERAND (fn, 0)) != FUNCTION_DECL) return false; tree decl = TREE_OPERAND (fn, 0); if (DECL_BUILT_IN_CLASS (decl) != BUILT_IN_NORMAL || !builtin_decl_implicit (DECL_FUNCTION_CODE (decl)) || !gimple_builtin_call_types_compatible_p (stmt, decl)) return false; tree type = TREE_TYPE (gimple_call_lhs (stmt)); *rcode = DECL_FUNCTION_CODE (decl); for (unsigned i = 0; i < gimple_call_num_args (stmt); ++i) { tree arg = gimple_call_arg (stmt, i); ops[i] = do_valueize (arg, top_valueize, valueized); } switch (gimple_call_num_args (stmt)) { case 1: return (gimple_resimplify1 (seq, rcode, type, ops, valueize) || valueized); case 2: return (gimple_resimplify2 (seq, rcode, type, ops, valueize) || valueized); case 3: return (gimple_resimplify3 (seq, rcode, type, ops, valueize) || valueized); default: gcc_unreachable (); } } break; case GIMPLE_COND: { tree lhs = gimple_cond_lhs (stmt); tree rhs = gimple_cond_rhs (stmt); bool valueized = false; lhs = do_valueize (lhs, top_valueize, valueized); rhs = do_valueize (rhs, top_valueize, valueized); *rcode = gimple_cond_code (stmt); ops[0] = lhs; ops[1] = rhs; return (gimple_resimplify2 (seq, rcode, boolean_type_node, ops, valueize) || valueized); } default: break; } return false;}
开发者ID:jtramm,项目名称:gcc,代码行数:101,
示例23: lower_stmt//.........这里部分代码省略......... } break; case GIMPLE_DEBUG: gcc_checking_assert (cfun->debug_nonbind_markers); /* We can't possibly have debug bind stmts before lowering, we first emit them when entering SSA. */ gcc_checking_assert (gimple_debug_nonbind_marker_p (stmt)); /* Propagate fallthruness. */ /* If the function (e.g. from PCH) had debug stmts, but they're disabled for this compilation, remove them. */ if (!MAY_HAVE_DEBUG_MARKER_STMTS) gsi_remove (gsi, true); else gsi_next (gsi); return; case GIMPLE_NOP: case GIMPLE_ASM: case GIMPLE_ASSIGN: case GIMPLE_PREDICT: case GIMPLE_LABEL: case GIMPLE_EH_MUST_NOT_THROW: case GIMPLE_OMP_FOR: case GIMPLE_OMP_SECTIONS: case GIMPLE_OMP_SECTIONS_SWITCH: case GIMPLE_OMP_SECTION: case GIMPLE_OMP_SINGLE: case GIMPLE_OMP_MASTER: case GIMPLE_OMP_TASKGROUP: case GIMPLE_OMP_ORDERED: case GIMPLE_OMP_CRITICAL: case GIMPLE_OMP_RETURN: case GIMPLE_OMP_ATOMIC_LOAD: case GIMPLE_OMP_ATOMIC_STORE: case GIMPLE_OMP_CONTINUE: break; case GIMPLE_CALL: { tree decl = gimple_call_fndecl (stmt); unsigned i; for (i = 0; i < gimple_call_num_args (stmt); i++) { tree arg = gimple_call_arg (stmt, i); if (EXPR_P (arg)) TREE_SET_BLOCK (arg, data->block); } if (decl && DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL) { if (DECL_FUNCTION_CODE (decl) == BUILT_IN_SETJMP) { lower_builtin_setjmp (gsi); data->cannot_fallthru = false; return; } else if (DECL_FUNCTION_CODE (decl) == BUILT_IN_POSIX_MEMALIGN && flag_tree_bit_ccp && gimple_builtin_call_types_compatible_p (stmt, decl)) { lower_builtin_posix_memalign (gsi); return; } } if (decl && (flags_from_decl_or_type (decl) & ECF_NORETURN)) { data->cannot_fallthru = true; gsi_next (gsi); return; } } break; case GIMPLE_OMP_PARALLEL: case GIMPLE_OMP_TASK: case GIMPLE_OMP_TARGET: case GIMPLE_OMP_TEAMS: case GIMPLE_OMP_GRID_BODY: data->cannot_fallthru = false; lower_omp_directive (gsi, data); data->cannot_fallthru = false; return; case GIMPLE_TRANSACTION: lower_sequence (gimple_transaction_body_ptr ( as_a <gtransaction *> (stmt)), data); break; default: gcc_unreachable (); } data->cannot_fallthru = false; gsi_next (gsi);}
开发者ID:KangDroid,项目名称:gcc,代码行数:101,
示例24: gimple_simplify//.........这里部分代码省略......... tree tem = valueize (rhs3); if (tem) rhs3 = tem; } *rcode = code; ops[0] = rhs1; ops[1] = rhs2; ops[2] = rhs3; return gimple_resimplify3 (seq, rcode, type, ops, valueize); } default: gcc_unreachable (); } break; } case GIMPLE_CALL: /* ??? This way we can't simplify calls with side-effects. */ if (gimple_call_lhs (stmt) != NULL_TREE) { tree fn = gimple_call_fn (stmt); /* ??? Internal function support missing. */ if (!fn) return false; if (valueize && TREE_CODE (fn) == SSA_NAME) { tree tem = valueize (fn); if (tem) fn = tem; } if (!fn || TREE_CODE (fn) != ADDR_EXPR || TREE_CODE (TREE_OPERAND (fn, 0)) != FUNCTION_DECL || DECL_BUILT_IN_CLASS (TREE_OPERAND (fn, 0)) != BUILT_IN_NORMAL || !builtin_decl_implicit (DECL_FUNCTION_CODE (TREE_OPERAND (fn, 0))) || !gimple_builtin_call_types_compatible_p (stmt, TREE_OPERAND (fn, 0))) return false; tree decl = TREE_OPERAND (fn, 0); tree type = TREE_TYPE (gimple_call_lhs (stmt)); switch (gimple_call_num_args (stmt)) { case 1: { tree arg1 = gimple_call_arg (stmt, 0); if (valueize && TREE_CODE (arg1) == SSA_NAME) { tree tem = valueize (arg1); if (tem) arg1 = tem; } *rcode = DECL_FUNCTION_CODE (decl); ops[0] = arg1; return gimple_resimplify1 (seq, rcode, type, ops, valueize); } case 2: { tree arg1 = gimple_call_arg (stmt, 0); if (valueize && TREE_CODE (arg1) == SSA_NAME) { tree tem = valueize (arg1); if (tem) arg1 = tem; } tree arg2 = gimple_call_arg (stmt, 1);
开发者ID:angrysnail,项目名称:gcc,代码行数:67,
示例25: do_jump//.........这里部分代码省略......... break; case TRUTH_AND_EXPR: /* High branch cost, expand as the bitwise AND of the conditions. Do the same if the RHS has side effects, because we're effectively turning a TRUTH_AND_EXPR into a TRUTH_ANDIF_EXPR. */ if (BRANCH_COST >= 4 || TREE_SIDE_EFFECTS (TREE_OPERAND (exp, 1))) goto normal; if (if_false_label == NULL_RTX) { drop_through_label = gen_label_rtx (); do_jump (TREE_OPERAND (exp, 0), drop_through_label, NULL_RTX); do_jump (TREE_OPERAND (exp, 1), NULL_RTX, if_true_label); } else { do_jump (TREE_OPERAND (exp, 0), if_false_label, NULL_RTX); do_jump (TREE_OPERAND (exp, 1), if_false_label, if_true_label); } break; case TRUTH_OR_EXPR: /* High branch cost, expand as the bitwise OR of the conditions. Do the same if the RHS has side effects, because we're effectively turning a TRUTH_OR_EXPR into a TRUTH_ORIF_EXPR. */ if (BRANCH_COST >= 4 || TREE_SIDE_EFFECTS (TREE_OPERAND (exp, 1))) goto normal; if (if_true_label == NULL_RTX) { drop_through_label = gen_label_rtx (); do_jump (TREE_OPERAND (exp, 0), NULL_RTX, drop_through_label); do_jump (TREE_OPERAND (exp, 1), if_false_label, NULL_RTX); } else { do_jump (TREE_OPERAND (exp, 0), NULL_RTX, if_true_label); do_jump (TREE_OPERAND (exp, 1), if_false_label, if_true_label); } break; /* Special case: __builtin_expect (<test>, 0) and __builtin_expect (<test>, 1) We need to do this here, so that <test> is not converted to a SCC operation on machines that use condition code registers and COMPARE like the PowerPC, and then the jump is done based on whether the SCC operation produced a 1 or 0. */ case CALL_EXPR: /* Check for a built-in function. */ { tree fndecl = get_callee_fndecl (exp); tree arglist = TREE_OPERAND (exp, 1); if (fndecl && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL && DECL_FUNCTION_CODE (fndecl) == BUILT_IN_EXPECT && arglist != NULL_TREE && TREE_CHAIN (arglist) != NULL_TREE) { rtx seq = expand_builtin_expect_jump (exp, if_false_label, if_true_label); if (seq != NULL_RTX) { emit_insn (seq); return; } } } /* Fall through and generate the normal code. */ default: normal: temp = expand_normal (exp); do_pending_stack_adjust (); /* The RTL optimizers prefer comparisons against pseudos. */ if (GET_CODE (temp) == SUBREG) { /* Compare promoted variables in their promoted mode. */ if (SUBREG_PROMOTED_VAR_P (temp) && REG_P (XEXP (temp, 0))) temp = XEXP (temp, 0); else temp = copy_to_reg (temp); } do_compare_rtx_and_jump (temp, CONST0_RTX (GET_MODE (temp)), NE, TYPE_UNSIGNED (TREE_TYPE (exp)), GET_MODE (temp), NULL_RTX, if_false_label, if_true_label); } if (drop_through_label) { do_pending_stack_adjust (); emit_label (drop_through_label); }}
开发者ID:Abioy,项目名称:gccxml,代码行数:101,
注:本文中的DECL_BUILT_IN_CLASS函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ DECL_CHAIN函数代码示例 C++ DECL_ATTRIBUTES函数代码示例 |