print-tree.c
#include "config.h"
#include "tree.h"
#include <stdio.h>
/* Names of tree components.
Used for printing out the tree and error messages. */
#define DEFTREECODE(SYM, NAME, TYPE, LEN) NAME,
char *tree_code_name[] = {
#include "tree.def"
};
#undef DEFTREECODE
同样的debug_tree()函数放在哪里才有用是个重要而有用的问题,
只有看完相关的代码才能知道。
我认为放到expr.c文件中比较好。
if (mode != Pmode && modifier == EXPAND_SUM)
modifier = EXPAND_NORMAL;
fprintf(stderr ,"expand_expr code = %x\n",code);
debug_tree (exp);
/* Ensure we reference a volatile object even if value is ignored. */
if (ignore && TREE_THIS_VOLATILE (exp)
&& mode != VOIDmode && mode != BLKmode)
{
target = gen_reg_rtx (mode);
temp = expand_expr (exp, target, VOIDmode, modifier);
if (temp != target)
emit_move_insn (target, temp);
return target;
}
switch (code)
/*再这个关键的分支处,之前打印出语法树是个明智的选择*/
{
case PARM_DECL:
if (DECL_RTL (exp) == 0)
{
error_with_decl (exp, "prior parameter‘s size depends on `%s‘");
return const0_rtx;
}
case FUNCTION_DECL:
case VAR_DECL:
原文地址:http://blog.csdn.net/oldlinux/article/details/42370355