コード例 #1
0
ファイル: ir_gvn.cpp プロジェクト: Grainspring/xoc
void IR_GVN::dump_bb_labs(LIST<LABEL_INFO*> & lst)
{
	for (LABEL_INFO * li = lst.get_head(); li != NULL; li = lst.get_next()) {
		switch (LABEL_INFO_type(li)) {
		case L_CLABEL:
			note(CLABEL_STR_FORMAT, CLABEL_CONT(li));
			break;
		case L_ILABEL:
			note(ILABEL_STR_FORMAT, ILABEL_CONT(li));
			break;
		case L_PRAGMA:
			note("%s", LABEL_INFO_pragma(li));
			break;
		default: IS_TRUE(0,("unsupport"));
		}
		if (LABEL_INFO_is_try_start(li) ||
			LABEL_INFO_is_try_end(li) ||
			LABEL_INFO_is_catch_start(li)) {
			fprintf(g_tfile, "(");
			if (LABEL_INFO_is_try_start(li)) {
				fprintf(g_tfile, "try_start,");
			}
			if (LABEL_INFO_is_try_end(li)) {
				fprintf(g_tfile, "try_end,");
			}
			if (LABEL_INFO_is_catch_start(li)) {
				fprintf(g_tfile, "catch_start");
			}
			fprintf(g_tfile, ")");
		}
		fprintf(g_tfile, " ");
	}
}
コード例 #2
0
ファイル: label.cpp プロジェクト: clear-wing/xoc
void dumpLabel(LabelInfo const* li)
{
    if (g_tfile == NULL) return;
    if (LABEL_INFO_type(li) == L_ILABEL) {
        fprintf(g_tfile, "\nilabel(" ILABEL_STR_FORMAT ")",
                ILABEL_CONT(li));
    } else if (LABEL_INFO_type(li) == L_CLABEL) {
        fprintf(g_tfile, "\nclabel(" CLABEL_STR_FORMAT ")",
                CLABEL_CONT(li));
    } else if (LABEL_INFO_type(li) == L_PRAGMA) {
        ASSERT0(LABEL_INFO_pragma(li));
        fprintf(g_tfile, "\npragms(%s)",
                SYM_name(LABEL_INFO_pragma(li)));
    } else { UNREACH(); }

    if (LABEL_INFO_b1(li) != 0) {
        fprintf(g_tfile, "(");
    }
    if (LABEL_INFO_is_try_start(li)) {
        fprintf(g_tfile, "try_start ");
    }
    if (LABEL_INFO_is_try_end(li)) {
        fprintf(g_tfile, "try_end ");
    }
    if (LABEL_INFO_is_catch_start(li)) {
        fprintf(g_tfile, "catch_start ");
    }
    if (LABEL_INFO_b1(li) != 0) {
        fprintf(g_tfile, ")");
    }
    fflush(g_tfile);
}
コード例 #3
0
ファイル: label.cpp プロジェクト: VoidSpeaker/xocfe
void dump_lab(LABEL_INFO const* li)
{
	if (g_tfile == NULL) return;
	if (LABEL_INFO_type(li) == L_ILABEL) {
		fprintf(g_tfile, "\nilabel(" ILABEL_STR_FORMAT ")",
				ILABEL_CONT(li));
	} else if (LABEL_INFO_type(li) == L_CLABEL) {
		fprintf(g_tfile, "\nclabel(" CLABEL_STR_FORMAT ")",
				CLABEL_CONT(li));
	} else if (LABEL_INFO_type(li) == L_PRAGMA) {
		fprintf(g_tfile, "\npragms(%s)",
				SYM_name(LABEL_INFO_pragma(li)));
	} else { IS_TRUE0(0); }

	if (LABEL_INFO_b1(li) != 0) {
		fprintf(g_tfile, "(");
	}
	if (LABEL_INFO_is_try_start(li)) {
		fprintf(g_tfile, "try_start ");
	}
	if (LABEL_INFO_is_try_end(li)) {
		fprintf(g_tfile, "try_end ");
	}
	if (LABEL_INFO_is_catch_start(li)) {
		fprintf(g_tfile, "catch_start ");
	}
	if (LABEL_INFO_is_used(li)) {
		fprintf(g_tfile, "used ");
	}
	if (LABEL_INFO_b1(li) != 0) {
		fprintf(g_tfile, ")");
	}
	fflush(g_tfile);
}
コード例 #4
0
ファイル: ir_bb.cpp プロジェクト: alibaba/xoc
void dumpBBLabel(List<LabelInfo const*> & lablist, FILE * h)
{
    ASSERT0(h);
    C<LabelInfo const*> * ct;
    for (lablist.get_head(&ct); ct != lablist.end(); ct = lablist.get_next(ct)) {
        LabelInfo const* li = ct->val();
        switch (LABEL_INFO_type(li)) {
        case L_CLABEL:
            fprintf(h, CLABEL_STR_FORMAT, CLABEL_CONT(li));
            break;
        case L_ILABEL:
            fprintf(h, ILABEL_STR_FORMAT, ILABEL_CONT(li));
            break;
        case L_PRAGMA:
            ASSERT0(LABEL_INFO_pragma(li));
            fprintf(h, "%s", SYM_name(LABEL_INFO_pragma(li)));
            break;
        default: UNREACH();
        }

        if (LABEL_INFO_is_try_start(li) ||
            LABEL_INFO_is_try_end(li) ||
            LABEL_INFO_is_catch_start(li)) {
            fprintf(g_tfile, "(");
            if (LABEL_INFO_is_try_start(li)) {
                fprintf(g_tfile, "try_start,");
            }
            if (LABEL_INFO_is_try_end(li)) {
                fprintf(g_tfile, "try_end,");
            }
            if (LABEL_INFO_is_catch_start(li)) {
                fprintf(g_tfile, "catch_start");
            }
            fprintf(g_tfile, ")");
        }
        fprintf(g_tfile, " ");
    }
}