gcc-8.3/gcc/make_node()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#mfac7c73]
#backlinks
*説明 [#cc4a93f3]
-パス: [[gcc-8.3/gcc/tree.c]]
-FIXME: これは何?
--説明
**引数 [#defa0564]
-enum tree_code code MEM_STAT_DECL
--
--[[gcc-8.3/gcc/tree_code]]
**返り値 [#f4449f62]
-tree
--
--[[gcc-8.3/gcc/tree]]
**参考 [#taa7356c]
*実装 [#y8f0a131]
/* Return a newly allocated node of code CODE. For decl...
nodes, some other fields are initialized. The rest o...
initialized to zero. This function cannot be used fo...
INTEGER_CST or OMP_CLAUSE nodes, which is enforced by...
tree_code_size.
Achoo! I got a code in the node. */
tree
make_node (enum tree_code code MEM_STAT_DECL)
{
tree t;
enum tree_code_class type = TREE_CODE_CLASS (code);
size_t length = tree_code_size (code);
-
--[[gcc-8.3/gcc/tree]]
--[[gcc-8.3/gcc/tree_code_class]]
--[[gcc-8.3/gcc/TREE_CODE_CLASS()]]
--[[gcc-8.3/gcc/tree_code_size()]]
record_node_allocation_statistics (code, length);
t = ggc_alloc_cleared_tree_node_stat (length PASS_MEM_...
TREE_SET_CODE (t, code);
-
--[[gcc-8.3/gcc/record_node_allocation_statistics()]]
--[[gcc-8.3/gcc/ggc_alloc_cleared_tree_node_stat()]]
--[[gcc-8.3/gcc/TREE_SET_CODE()]]
switch (type)
{
case tcc_statement:
if (code != DEBUG_BEGIN_STMT)
TREE_SIDE_EFFECTS (t) = 1;
break;
-
--[[gcc-8.3/gcc/TREE_SIDE_EFFECTS()]]
case tcc_declaration:
if (CODE_CONTAINS_STRUCT (code, TS_DECL_COMMON))
{
if (code == FUNCTION_DECL)
{
SET_DECL_ALIGN (t, FUNCTION_ALIGNMENT (FUNCTION_B...
SET_DECL_MODE (t, FUNCTION_MODE);
}
else
SET_DECL_ALIGN (t, 1);
}
DECL_SOURCE_LOCATION (t) = input_location;
if (TREE_CODE (t) == DEBUG_EXPR_DECL)
DECL_UID (t) = --next_debug_decl_uid;
else
{
DECL_UID (t) = allocate_decl_uid ();
SET_DECL_PT_UID (t, -1);
}
if (TREE_CODE (t) == LABEL_DECL)
LABEL_DECL_UID (t) = -1;
break;
-
--[[gcc-8.3/gcc/CODE_CONTAINS_STRUCT()]]
--[[gcc-8.3/gcc/SET_DECL_ALIGN()]]
--[[gcc-8.3/gcc/FUNCTION_ALIGNMENT()]]
--[[gcc-8.3/gcc/SET_DECL_MODE()]]
--[[gcc-8.3/gcc/DECL_SOURCE_LOCATION()]]
--[[gcc-8.3/gcc/TREE_CODE()]]
--[[gcc-8.3/gcc/DECL_UID()]]
--[[gcc-8.3/gcc/allocate_decl_uid()]]
--[[gcc-8.3/gcc/LABEL_DECL_UID()]]
case tcc_type:
TYPE_UID (t) = next_type_uid++;
SET_TYPE_ALIGN (t, BITS_PER_UNIT);
TYPE_USER_ALIGN (t) = 0;
TYPE_MAIN_VARIANT (t) = t;
TYPE_CANONICAL (t) = t;
/* Default to no attributes for type, but let targ...
TYPE_ATTRIBUTES (t) = NULL_TREE;
targetm.set_default_type_attributes (t);
/* We have not yet computed the alias set for this...
TYPE_ALIAS_SET (t) = -1;
break;
-
--[[gcc-8.3/gcc/TYPE_UID()]]
--[[gcc-8.3/gcc/SET_TYPE_ALIGN()]]
--[[gcc-8.3/gcc/TYPE_USER_ALIGN()]]
--[[gcc-8.3/gcc/TYPE_MAIN_VARIANT()]]
--[[gcc-8.3/gcc/TYPE_CANONICAL()]]
--[[gcc-8.3/gcc/TYPE_ATTRIBUTES()]]
--[[gcc-8.3/gcc/targetm(global)]]
--[[gcc-8.3/gcc/TYPE_ALIAS_SET()]]
case tcc_constant:
TREE_CONSTANT (t) = 1;
break;
-
--[[gcc-8.3/gcc/TREE_CONSTANT()]]
case tcc_expression:
switch (code)
{
case INIT_EXPR:
case MODIFY_EXPR:
case VA_ARG_EXPR:
case PREDECREMENT_EXPR:
case PREINCREMENT_EXPR:
case POSTDECREMENT_EXPR:
case POSTINCREMENT_EXPR:
/* All of these have side-effects, no matter what their
operands are. */
TREE_SIDE_EFFECTS (t) = 1;
break;
default:
break;
}
break;
-
--[[gcc-8.3/gcc/TREE_SIDE_EFFECTS()]]
case tcc_exceptional:
switch (code)
{
case TARGET_OPTION_NODE:
TREE_TARGET_OPTION(t)
= ggc_cleared_alloc<struct cl_target_option> ();
break;
-
--[[gcc-8.3/gcc/TREE_TARGET_OPTION()]]
--[[gcc-8.3/gcc/ggc_cleared_alloc()]]
case OPTIMIZATION_NODE:
TREE_OPTIMIZATION (t)
= ggc_cleared_alloc<struct cl_optimization> ();
break;
-
--[[gcc-8.3/gcc/TREE_OPTIMIZATION()]]
--[[gcc-8.3/gcc/ggc_cleared_alloc()]]
default:
break;
}
break;
default:
/* Other classes need no special treatment. */
break;
}
return t;
}
*コメント [#d956d9c0]
終了行:
*参照元 [#mfac7c73]
#backlinks
*説明 [#cc4a93f3]
-パス: [[gcc-8.3/gcc/tree.c]]
-FIXME: これは何?
--説明
**引数 [#defa0564]
-enum tree_code code MEM_STAT_DECL
--
--[[gcc-8.3/gcc/tree_code]]
**返り値 [#f4449f62]
-tree
--
--[[gcc-8.3/gcc/tree]]
**参考 [#taa7356c]
*実装 [#y8f0a131]
/* Return a newly allocated node of code CODE. For decl...
nodes, some other fields are initialized. The rest o...
initialized to zero. This function cannot be used fo...
INTEGER_CST or OMP_CLAUSE nodes, which is enforced by...
tree_code_size.
Achoo! I got a code in the node. */
tree
make_node (enum tree_code code MEM_STAT_DECL)
{
tree t;
enum tree_code_class type = TREE_CODE_CLASS (code);
size_t length = tree_code_size (code);
-
--[[gcc-8.3/gcc/tree]]
--[[gcc-8.3/gcc/tree_code_class]]
--[[gcc-8.3/gcc/TREE_CODE_CLASS()]]
--[[gcc-8.3/gcc/tree_code_size()]]
record_node_allocation_statistics (code, length);
t = ggc_alloc_cleared_tree_node_stat (length PASS_MEM_...
TREE_SET_CODE (t, code);
-
--[[gcc-8.3/gcc/record_node_allocation_statistics()]]
--[[gcc-8.3/gcc/ggc_alloc_cleared_tree_node_stat()]]
--[[gcc-8.3/gcc/TREE_SET_CODE()]]
switch (type)
{
case tcc_statement:
if (code != DEBUG_BEGIN_STMT)
TREE_SIDE_EFFECTS (t) = 1;
break;
-
--[[gcc-8.3/gcc/TREE_SIDE_EFFECTS()]]
case tcc_declaration:
if (CODE_CONTAINS_STRUCT (code, TS_DECL_COMMON))
{
if (code == FUNCTION_DECL)
{
SET_DECL_ALIGN (t, FUNCTION_ALIGNMENT (FUNCTION_B...
SET_DECL_MODE (t, FUNCTION_MODE);
}
else
SET_DECL_ALIGN (t, 1);
}
DECL_SOURCE_LOCATION (t) = input_location;
if (TREE_CODE (t) == DEBUG_EXPR_DECL)
DECL_UID (t) = --next_debug_decl_uid;
else
{
DECL_UID (t) = allocate_decl_uid ();
SET_DECL_PT_UID (t, -1);
}
if (TREE_CODE (t) == LABEL_DECL)
LABEL_DECL_UID (t) = -1;
break;
-
--[[gcc-8.3/gcc/CODE_CONTAINS_STRUCT()]]
--[[gcc-8.3/gcc/SET_DECL_ALIGN()]]
--[[gcc-8.3/gcc/FUNCTION_ALIGNMENT()]]
--[[gcc-8.3/gcc/SET_DECL_MODE()]]
--[[gcc-8.3/gcc/DECL_SOURCE_LOCATION()]]
--[[gcc-8.3/gcc/TREE_CODE()]]
--[[gcc-8.3/gcc/DECL_UID()]]
--[[gcc-8.3/gcc/allocate_decl_uid()]]
--[[gcc-8.3/gcc/LABEL_DECL_UID()]]
case tcc_type:
TYPE_UID (t) = next_type_uid++;
SET_TYPE_ALIGN (t, BITS_PER_UNIT);
TYPE_USER_ALIGN (t) = 0;
TYPE_MAIN_VARIANT (t) = t;
TYPE_CANONICAL (t) = t;
/* Default to no attributes for type, but let targ...
TYPE_ATTRIBUTES (t) = NULL_TREE;
targetm.set_default_type_attributes (t);
/* We have not yet computed the alias set for this...
TYPE_ALIAS_SET (t) = -1;
break;
-
--[[gcc-8.3/gcc/TYPE_UID()]]
--[[gcc-8.3/gcc/SET_TYPE_ALIGN()]]
--[[gcc-8.3/gcc/TYPE_USER_ALIGN()]]
--[[gcc-8.3/gcc/TYPE_MAIN_VARIANT()]]
--[[gcc-8.3/gcc/TYPE_CANONICAL()]]
--[[gcc-8.3/gcc/TYPE_ATTRIBUTES()]]
--[[gcc-8.3/gcc/targetm(global)]]
--[[gcc-8.3/gcc/TYPE_ALIAS_SET()]]
case tcc_constant:
TREE_CONSTANT (t) = 1;
break;
-
--[[gcc-8.3/gcc/TREE_CONSTANT()]]
case tcc_expression:
switch (code)
{
case INIT_EXPR:
case MODIFY_EXPR:
case VA_ARG_EXPR:
case PREDECREMENT_EXPR:
case PREINCREMENT_EXPR:
case POSTDECREMENT_EXPR:
case POSTINCREMENT_EXPR:
/* All of these have side-effects, no matter what their
operands are. */
TREE_SIDE_EFFECTS (t) = 1;
break;
default:
break;
}
break;
-
--[[gcc-8.3/gcc/TREE_SIDE_EFFECTS()]]
case tcc_exceptional:
switch (code)
{
case TARGET_OPTION_NODE:
TREE_TARGET_OPTION(t)
= ggc_cleared_alloc<struct cl_target_option> ();
break;
-
--[[gcc-8.3/gcc/TREE_TARGET_OPTION()]]
--[[gcc-8.3/gcc/ggc_cleared_alloc()]]
case OPTIMIZATION_NODE:
TREE_OPTIMIZATION (t)
= ggc_cleared_alloc<struct cl_optimization> ();
break;
-
--[[gcc-8.3/gcc/TREE_OPTIMIZATION()]]
--[[gcc-8.3/gcc/ggc_cleared_alloc()]]
default:
break;
}
break;
default:
/* Other classes need no special treatment. */
break;
}
return t;
}
*コメント [#d956d9c0]
ページ名: