gcc原始碼分析,debug_tree()函數,又一利器啊

來源:互聯網
上載者:User

標籤:gcc   原始碼   分析   

gcc原始碼分析,debug_rtx()函數,利器啊


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:



gcc原始碼分析,debug_tree()函數,又一利器啊

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.