Lines Matching refs:guard

2219 /* Returns the initialization guard variable for the variable DECL,
2226 tree guard;
2229 guard = IDENTIFIER_GLOBAL_VALUE (sname);
2230 if (! guard)
2237 guard = build_decl (VAR_DECL, sname, guard_type);
2239 /* The guard should have the same linkage as what it guards. */
2240 TREE_PUBLIC (guard) = TREE_PUBLIC (decl);
2241 TREE_STATIC (guard) = TREE_STATIC (decl);
2242 DECL_COMMON (guard) = DECL_COMMON (decl);
2243 DECL_ONE_ONLY (guard) = DECL_ONE_ONLY (decl);
2245 DECL_WEAK (guard) = DECL_WEAK (decl);
2247 DECL_ARTIFICIAL (guard) = 1;
2248 DECL_IGNORED_P (guard) = 1;
2249 TREE_USED (guard) = 1;
2250 pushdecl_top_level_and_finish (guard, NULL_TREE);
2252 return guard;
2259 get_guard_bits (tree guard)
2263 /* We only set the first byte of the guard, in order to leave room
2265 guard = build1 (ADDR_EXPR,
2266 build_pointer_type (TREE_TYPE (guard)),
2267 guard);
2268 guard = build1 (NOP_EXPR,
2270 guard);
2271 guard = build1 (INDIRECT_REF, char_type_node, guard);
2274 return guard;
2281 get_guard_cond (tree guard)
2286 guard = get_guard_bits (guard);
2292 if (!same_type_p (TREE_TYPE (guard_value), TREE_TYPE (guard)))
2293 guard_value = convert (TREE_TYPE (guard), guard_value);
2294 guard = cp_build_binary_op (BIT_AND_EXPR, guard, guard_value);
2298 if (!same_type_p (TREE_TYPE (guard_value), TREE_TYPE (guard)))
2299 guard_value = convert (TREE_TYPE (guard), guard_value);
2300 return cp_build_binary_op (EQ_EXPR, guard, guard_value);
2307 set_guard (tree guard)
2312 guard = get_guard_bits (guard);
2314 if (!same_type_p (TREE_TYPE (guard_init), TREE_TYPE (guard)))
2315 guard_init = convert (TREE_TYPE (guard), guard_init);
2316 return build_modify_expr (guard, NOP_EXPR, guard_init);
2580 /* Whether a DECL needs a guard to protect it against multiple
2595 tree guard;
2627 /* Assume we don't need a guard. */
2628 guard = NULL_TREE;
2629 /* We need a guard if this is an object with external linkage that
2637 guard = get_guard (decl);
2646 guard_cond = get_guard_cond (guard);
2659 guard,
2666 guard,
2677 if (guard && initp && flag_use_cxa_atexit)
2678 finish_expr_stmt (set_guard (guard));
2694 /* Finish the guard if-stmt, if necessary. */
2695 if (guard)