本文整理匯總了C++中DECL_P函數的典型用法代碼示例。如果您正苦於以下問題:C++ DECL_P函數的具體用法?C++ DECL_P怎麽用?C++ DECL_P使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了DECL_P函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: check_ipa_store
static bool
check_ipa_store (gimple, tree op, tree, void *data)
{
if (DECL_P (op))
check_decl ((funct_state)data, op, true, true);
else
check_op ((funct_state)data, op, true);
return false;
}
示例2: check_ipa_load
static bool
check_ipa_load (gimple stmt ATTRIBUTE_UNUSED, tree op, void *data)
{
if (DECL_P (op))
check_decl ((funct_state)data, op, false, true);
else
check_op ((funct_state)data, op, false);
return false;
}
示例3: pp_cxx_id_expression
static inline void
pp_cxx_id_expression (cxx_pretty_printer *pp, tree t)
{
if (TREE_CODE (t) == OVERLOAD)
t = OVL_CURRENT (t);
if (DECL_P (t) && DECL_CONTEXT (t))
pp_cxx_qualified_id (pp, t);
else
pp_cxx_unqualified_id (pp, t);
}
示例4: cxx_dwarf_name
static const char *
cxx_dwarf_name (tree t, int verbosity)
{
gcc_assert (DECL_P (t));
if (verbosity >= 2)
return decl_as_string (t, TFF_DECL_SPECIFIERS | TFF_UNQUALIFIED_NAME);
return cxx_printable_name (t, verbosity);
}
示例5: mark_address_taken
static void
mark_address_taken (tree ref)
{
tree var;
/* Note that it is *NOT OKAY* to use the target of a COMPONENT_REF
as the only thing we take the address of. If VAR is a structure,
taking the address of a field means that the whole structure may
be referenced using pointer arithmetic. See PR 21407 and the
ensuing mailing list discussion. */
var = get_base_address (ref);
if (var)
{
if (DECL_P (var))
TREE_ADDRESSABLE (var) = 1;
else if (TREE_CODE (var) == MEM_REF
&& TREE_CODE (TREE_OPERAND (var, 0)) == ADDR_EXPR
&& DECL_P (TREE_OPERAND (TREE_OPERAND (var, 0), 0)))
TREE_ADDRESSABLE (TREE_OPERAND (TREE_OPERAND (var, 0), 0)) = 1;
}
}
示例6: xml_location
void xml_location(tree x, FILE *out)
{
expanded_location l;
if (!CAN_HAVE_LOCATION_P(x) && !DECL_P(x))
return;
if (EXPR_P(x))
{
l = expand_location(EXPR_LOCATION(x));
goto write;
} else if (DECL_P(x)) {
l = expand_location(DECL_SOURCE_LOCATION(x));
goto write;
}
return;
write:
fprintf(out, " location='%s:%d:%d'",
filter_built_in(l.file), l.line, l.column);
}
示例7: get_base_loadstore
static tree
get_base_loadstore (tree op)
{
while (handled_component_p (op))
op = TREE_OPERAND (op, 0);
if (DECL_P (op)
|| INDIRECT_REF_P (op)
|| TREE_CODE (op) == MEM_REF
|| TREE_CODE (op) == TARGET_MEM_REF)
return op;
return NULL_TREE;
}
示例8: unpack_ts_base_value_fields
static inline void
unpack_ts_base_value_fields (struct bitpack_d *bp, tree expr)
{
/* Note that the code for EXPR has already been unpacked to create EXPR in
streamer_alloc_tree. */
if (!TYPE_P (expr))
{
TREE_SIDE_EFFECTS (expr) = (unsigned) bp_unpack_value (bp, 1);
TREE_CONSTANT (expr) = (unsigned) bp_unpack_value (bp, 1);
TREE_READONLY (expr) = (unsigned) bp_unpack_value (bp, 1);
/* TREE_PUBLIC is used on types to indicate that the type
has a TYPE_CACHED_VALUES vector. This is not streamed out,
so we skip it here. */
TREE_PUBLIC (expr) = (unsigned) bp_unpack_value (bp, 1);
}
else
bp_unpack_value (bp, 4);
TREE_ADDRESSABLE (expr) = (unsigned) bp_unpack_value (bp, 1);
TREE_THIS_VOLATILE (expr) = (unsigned) bp_unpack_value (bp, 1);
if (DECL_P (expr))
DECL_UNSIGNED (expr) = (unsigned) bp_unpack_value (bp, 1);
else if (TYPE_P (expr))
TYPE_UNSIGNED (expr) = (unsigned) bp_unpack_value (bp, 1);
else
bp_unpack_value (bp, 1);
TREE_ASM_WRITTEN (expr) = (unsigned) bp_unpack_value (bp, 1);
if (TYPE_P (expr))
TYPE_ARTIFICIAL (expr) = (unsigned) bp_unpack_value (bp, 1);
else
TREE_NO_WARNING (expr) = (unsigned) bp_unpack_value (bp, 1);
TREE_NOTHROW (expr) = (unsigned) bp_unpack_value (bp, 1);
TREE_STATIC (expr) = (unsigned) bp_unpack_value (bp, 1);
if (TREE_CODE (expr) != TREE_BINFO)
TREE_PRIVATE (expr) = (unsigned) bp_unpack_value (bp, 1);
else
bp_unpack_value (bp, 1);
TREE_PROTECTED (expr) = (unsigned) bp_unpack_value (bp, 1);
TREE_DEPRECATED (expr) = (unsigned) bp_unpack_value (bp, 1);
if (TYPE_P (expr))
{
TYPE_SATURATING (expr) = (unsigned) bp_unpack_value (bp, 1);
TYPE_ADDR_SPACE (expr) = (unsigned) bp_unpack_value (bp, 8);
}
else if (TREE_CODE (expr) == SSA_NAME)
{
SSA_NAME_IS_DEFAULT_DEF (expr) = (unsigned) bp_unpack_value (bp, 1);
bp_unpack_value (bp, 8);
}
else
bp_unpack_value (bp, 9);
}
示例9: pp_c_storage_class_specifier
void
pp_c_storage_class_specifier (c_pretty_printer *pp, tree t)
{
if (TREE_CODE (t) == TYPE_DECL)
pp_c_identifier (pp, "typedef");
else if (DECL_P (t))
{
if (DECL_REGISTER (t))
pp_c_identifier (pp, "register");
else if (TREE_STATIC (t) && TREE_CODE (t) == VAR_DECL)
pp_c_identifier (pp, "static");
}
}
示例10: make_ssa_name
tree
make_ssa_name (tree var, tree stmt)
{
tree t;
use_operand_p imm;
gcc_assert (DECL_P (var)
|| TREE_CODE (var) == INDIRECT_REF);
gcc_assert (!stmt
|| EXPR_P (stmt) || GIMPLE_STMT_P (stmt)
|| TREE_CODE (stmt) == PHI_NODE);
/* If our free list has an element, then use it. */
if (FREE_SSANAMES (cfun))
{
t = FREE_SSANAMES (cfun);
FREE_SSANAMES (cfun) = TREE_CHAIN (FREE_SSANAMES (cfun));
#ifdef GATHER_STATISTICS
ssa_name_nodes_reused++;
#endif
/* The node was cleared out when we put it on the free list, so
there is no need to do so again here. */
gcc_assert (ssa_name (SSA_NAME_VERSION (t)) == NULL);
VEC_replace (tree, SSANAMES (cfun), SSA_NAME_VERSION (t), t);
}
else
{
t = make_node (SSA_NAME);
SSA_NAME_VERSION (t) = num_ssa_names;
VEC_safe_push (tree, gc, SSANAMES (cfun), t);
#ifdef GATHER_STATISTICS
ssa_name_nodes_created++;
#endif
}
TREE_TYPE (t) = TREE_TYPE (var);
SSA_NAME_VAR (t) = var;
SSA_NAME_DEF_STMT (t) = stmt;
SSA_NAME_PTR_INFO (t) = NULL;
SSA_NAME_IN_FREE_LIST (t) = 0;
SSA_NAME_IS_DEFAULT_DEF (t) = 0;
imm = &(SSA_NAME_IMM_USE_NODE (t));
imm->use = NULL;
imm->prev = imm;
imm->next = imm;
imm->stmt = t;
return t;
}
示例11: cxx_dwarf_name
static const char *
cxx_dwarf_name (tree t, int verbosity)
{
gcc_assert (DECL_P (t));
if (DECL_NAME (t) && IDENTIFIER_ANON_P (DECL_NAME (t)))
return NULL;
if (verbosity >= 2)
return decl_as_dwarf_string (t,
TFF_DECL_SPECIFIERS | TFF_UNQUALIFIED_NAME
| TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS);
return lang_decl_dwarf_name (t, verbosity, false);
}
示例12: fill_decls_vec
bool
fill_decls_vec (tree const &key0, tree *val0, auto_vec<struct cilk_decls> *v)
{
tree t1 = key0;
struct cilk_decls dp;
if (DECL_P (t1))
{
dp.key = t1;
dp.val = val0;
v->safe_push (dp);
}
return true;
}
示例13: set_save_expr_context
static tree
set_save_expr_context (tree *tp,
int *walk_subtrees,
void *data)
{
if (TREE_CODE (*tp) == SAVE_EXPR && !SAVE_EXPR_CONTEXT (*tp))
SAVE_EXPR_CONTEXT (*tp) = (tree) data;
/* Do not walk back into the SAVE_EXPR_CONTEXT; that will cause
circularity. */
else if (DECL_P (*tp))
*walk_subtrees = 0;
return NULL;
}
示例14: instrument_assignments_plugin_exec
static unsigned int instrument_assignments_plugin_exec(void)
{
#ifdef DEBUG
fprintf(stderr, "* Inspecting function `%s'\n", FN_NAME);
#endif
basic_block bb;
FOR_EACH_BB(bb) {
gimple_stmt_iterator gsi;
for (gsi = gsi_start_bb(bb) ; !gsi_end_p(gsi) ; gsi_next(&gsi)) {
gimple curr_stmt = gsi_stmt(gsi);
tree lhs = gimple_get_lhs(curr_stmt);
// We only care about assignments to “real” variables – i.e. not
// variable versions that were created as part of the transformation
// to SSA form.
if (gimple_code(curr_stmt) == GIMPLE_ASSIGN
&& lhs != NULL_TREE && TREE_CODE(lhs) != SSA_NAME && DECL_P(lhs)) {
tree attrlist = DECL_ATTRIBUTES(lhs);
tree attr = lookup_attribute("instrument", attrlist);
// the princess is in another castle
if (attr == NULL_TREE) continue;
// read the variable id that was passed to the `instrument'
// attribute
const_tree arg = TREE_VALUE(TREE_VALUE(attr));
tree var_id = build_int_cst(NULL_TREE, tree_low_cst (arg, 1));
#ifdef DEBUG
fprintf(stderr, " > found assignment to instrumented variable `%s': \n\t", get_name(lhs));
print_gimple_stmt(stderr, curr_stmt, 0, 0);
fprintf(stderr, "\tbase address of `%s' is %p\n", get_name(lhs), get_base_address(lhs));
#endif
// insert our instrumentation function before the current
// statement and pass along the rhs (i.e. the new value)
tree rhs = gimple_op(curr_stmt, 1);
insert_instrumentation_fn(curr_stmt, var_id, rhs);
}
}
}
#ifdef DEBUG
fprintf(stderr, "\n");
#endif
return 0;
}
示例15: pack_ts_base_value_fields
static void
pack_ts_base_value_fields (struct bitpack_d *bp, tree expr)
{
bp_pack_value (bp, TREE_CODE (expr), 16);
if (!TYPE_P (expr))
{
bp_pack_value (bp, TREE_SIDE_EFFECTS (expr), 1);
bp_pack_value (bp, TREE_CONSTANT (expr), 1);
bp_pack_value (bp, TREE_READONLY (expr), 1);
/* TREE_PUBLIC is used on types to indicate that the type
has a TYPE_CACHED_VALUES vector. This is not streamed out,
so we skip it here. */
bp_pack_value (bp, TREE_PUBLIC (expr), 1);
}
else
bp_pack_value (bp, 0, 4);
bp_pack_value (bp, TREE_ADDRESSABLE (expr), 1);
bp_pack_value (bp, TREE_THIS_VOLATILE (expr), 1);
if (DECL_P (expr))
bp_pack_value (bp, DECL_UNSIGNED (expr), 1);
else if (TYPE_P (expr))
bp_pack_value (bp, TYPE_UNSIGNED (expr), 1);
else
bp_pack_value (bp, 0, 1);
/* We write debug info two times, do not confuse the second one.
The only relevant TREE_ASM_WRITTEN use is on SSA names. */
bp_pack_value (bp, (TREE_CODE (expr) != SSA_NAME
? 0 : TREE_ASM_WRITTEN (expr)), 1);
if (TYPE_P (expr))
bp_pack_value (bp, TYPE_ARTIFICIAL (expr), 1);
else
bp_pack_value (bp, TREE_NO_WARNING (expr), 1);
bp_pack_value (bp, TREE_NOTHROW (expr), 1);
bp_pack_value (bp, TREE_STATIC (expr), 1);
if (TREE_CODE (expr) != TREE_BINFO)
bp_pack_value (bp, TREE_PRIVATE (expr), 1);
bp_pack_value (bp, TREE_PROTECTED (expr), 1);
bp_pack_value (bp, TREE_DEPRECATED (expr), 1);
if (TYPE_P (expr))
{
bp_pack_value (bp, TYPE_SATURATING (expr), 1);
bp_pack_value (bp, TYPE_ADDR_SPACE (expr), 8);
}
else if (TREE_CODE (expr) == SSA_NAME)
bp_pack_value (bp, SSA_NAME_IS_DEFAULT_DEF (expr), 1);
else
bp_pack_value (bp, 0, 1);
}