~pixelherodev/zyg

2526950ae3418bca06b01c0742c5e60f40797b7d — Noam Preil 5 months ago d8d6339
[sema] reenable analysis
2 files changed, 22 insertions(+), 21 deletions(-)

M profile.sh -rwxr-xr-x => -rw-r--r--
M sema.c
M profile.sh => profile.sh +0 -0
M sema.c => sema.c +22 -21
@@ 39,32 39,33 @@ static int
anal_execute(struct c3tree *tree)
{
	uint32_t i;
	uint32_t dep_node;
	uint32_t dep_node, t;
	uint16_t kids = c3nodekids(*tree, tree->graphs.deps);
	for(i = 0; i < kids; i += 1){
		dep_node = c3nodechild(*tree, tree->graphs.deps, i);
		t = c3nodechild(*tree, tree->graphs.deps, i);
		dep_node = c3nodechild(*tree, t, 0);
		// TODO: comptime engine
//		if(!t_node(dep_node)){
//			ERROR("Type analysis failed!", 0);
//			return 0;
//		}
		if(!t_node(dep_node)){
			ERROR("Type analysis failed!", 0);
			return 0;
		}
		if(c3nodetag(*tree, dep_node) == C3_VALUE_FN){
//			if(l_fn(dep_node) == -1){
//				ERROR("Failed to extract expression semantics", 0);
//				return 0;
//			}
			printf("expranal %u: %u\n", dep_node, t);
			if(l_fn(dep_node) == -1){
				ERROR("Failed to extract expression semantics", 0);
				return 0;
			}
		}
	}
	WARN("analysis is currently disabled, pending major changes being merged.", 0);
	return 0;
	return 1;
}

static int
anal_finish(struct c3tree *tree, int good, int out)
{
	char c = 1;
//	if(!expr_finish())
//		return 0;
	if(good && !expr_finish())
		return 0;
	if(!good)
		return 0;
	if(out == -1)


@@ 84,10 85,10 @@ int
analysis(struct c3tree *tree, int out)
{
	int good;
//	if(!t_init(tree))
//		return 0;
//	if(!expr_init(tree))
//		return 0;
	if(!t_init(tree))
		return 0;
	if(!expr_init(tree))
		return 0;
	if(!resolve_tree(tree)){
		ERROR("Tree resolution failed!", 0);
		return 0;


@@ 97,9 98,9 @@ analysis(struct c3tree *tree, int out)
		ERROR("ICE: dependency graph not found, old analysis is gone!", 0);
		return 0;
	}
//	if(zyg_ctx.tests)
//		if(!expr_gen_test())
//			return 0;
	if(zyg_ctx.tests)
		if(!expr_gen_test())
			return 0;
	if(!serialize_deps(tree))
		return 0;
	if(zyg_ctx.usage_debug)